Skip to content

Tests fail to build: error: 'Approx' was not declared in this scope, etc. #869

Closed
@barracuda156

Description

@barracuda156
:info:build In file included from /opt/local/include/catch2/benchmark/catch_benchmark.hpp:14,
:info:build                  from /opt/local/include/catch2/benchmark/catch_benchmark_all.hpp:24,
:info:build                  from /opt/local/include/catch2/catch_all.hpp:25,
:info:build                  from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/catch.hpp:9,
:info:build                  from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/app_helper.hpp:15,
:info:build                  from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/AppTest.cpp:7:
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/AppTest.cpp: In member function 'void {anonymous}::CATCH2_INTERNAL_TEST_134::test()':
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/AppTest.cpp:881:16: error: 'Approx' was not declared in this scope
:info:build   881 |     CHECK(1 == Approx(val.real()));
:info:build       |                ^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/AppTest.cpp:881:16: note: suggested alternatives:
:info:build In file included from /opt/local/include/catch2/catch_all.hpp:26:
:info:build /opt/local/include/catch2/catch_approx.hpp:17:11: note:   'Catch::Approx'
:info:build    17 |     class Approx {
:info:build       |           ^~~~~~
:info:build In file included from /opt/local/include/catch2/matchers/catch_matchers_all.hpp:33,
:info:build                  from /opt/local/include/catch2/catch_all.hpp:123:
:info:build /opt/local/include/catch2/matchers/catch_matchers_vector.hpp:182:45: note:   'Catch::Matchers::Approx'
:info:build   182 |     ApproxMatcher<T, AllocComp, AllocMatch> Approx( std::vector<T, AllocComp> const& comparator ) {
:info:build       |                                             ^~~~~~
:info:build In file included from /opt/local/include/catch2/catch_test_macros.hpp:11,
:info:build                  from /opt/local/include/catch2/catch_template_test_macros.hpp:20,
:info:build                  from /opt/local/include/catch2/catch_all.hpp:36:
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/AppTest.cpp:881:16: error: 'Approx' was not declared in this scope
:info:build   881 |     CHECK(1 == Approx(val.real()));
:info:build       |                ^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/AppTest.cpp:881:16: note: suggested alternatives:
:info:build /opt/local/include/catch2/catch_approx.hpp:17:11: note:   'Catch::Approx'
:info:build    17 |     class Approx {
:info:build       |           ^~~~~~
:info:build /opt/local/include/catch2/matchers/catch_matchers_vector.hpp:182:45: note:   'Catch::Matchers::Approx'
:info:build   182 |     ApproxMatcher<T, AllocComp, AllocMatch> Approx( std::vector<T, AllocComp> const& comparator ) {
:info:build       |                                             ^~~~~~
:info:build In file included from /opt/local/include/catch2/matchers/catch_matchers_all.hpp:25,
:info:build                  from /opt/local/include/catch2/catch_all.hpp:123,
:info:build                  from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/catch.hpp:9,
:info:build                  from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/app_helper.hpp:15,
:info:build                  from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/ConfigFileTest.cpp:7:
:info:build /opt/local/include/catch2/matchers/catch_matchers_contains.hpp: In instantiation of 'bool Catch::Matchers::ContainsElementMatcher<T, Equality>::match(RangeLike&&) const [with RangeLike = std::basic_string<char>&; T = std::basic_string<char>; Equality = std::equal_to<void>]':
:info:build /opt/local/include/catch2/matchers/internal/catch_matchers_impl.hpp:22:54:   required from 'Catch::MatchExpr<ArgT, MatcherT>::MatchExpr(ArgT&&, const MatcherT&) [with ArgT = std::basic_string<char>&; MatcherT = Catch::Matchers::ContainsElementMatcher<std::basic_string<char>, std::equal_to<void> >]'
:info:build /opt/local/include/catch2/matchers/internal/catch_matchers_impl.hpp:45:16:   required from 'Catch::MatchExpr<ArgT, MatcherT> Catch::makeMatchExpr(ArgT&&, const MatcherT&) [with ArgT = std::basic_string<char>&; MatcherT = Matchers::ContainsElementMatcher<std::basic_string<char>, std::equal_to<void> >]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/ConfigFileTest.cpp:2150:5:   required from here
:info:build /opt/local/include/catch2/matchers/catch_matchers_contains.hpp:38:30: error: no match for call to '(const std::equal_to<void>) (char&, const std::basic_string<char>&)'
:info:build    38 |                     if ( m_eq( elem, m_desired ) ) { return true; }
:info:build       |                          ~~~~^~~~~~~~~~~~~~~~~~~
:info:build /opt/local/include/gcc12/c++/bits/stl_function.h:499:9: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/bits/stl_function.h: In substitution of 'template<class _Tp, class _Up> constexpr decltype ((forward<_Tp>(__t) == forward<_Up>(__u))) std::equal_to<void>::operator()(_Tp&&, _Up&&) const [with _Tp = char&; _Up = const std::basic_string<char>&]':
:info:build /opt/local/include/catch2/matchers/catch_matchers_contains.hpp:38:30:   required from 'bool Catch::Matchers::ContainsElementMatcher<T, Equality>::match(RangeLike&&) const [with RangeLike = std::basic_string<char>&; T = std::basic_string<char>; Equality = std::equal_to<void>]'
:info:build /opt/local/include/catch2/matchers/internal/catch_matchers_impl.hpp:22:54:   required from 'Catch::MatchExpr<ArgT, MatcherT>::MatchExpr(ArgT&&, const MatcherT&) [with ArgT = std::basic_string<char>&; MatcherT = Catch::Matchers::ContainsElementMatcher<std::basic_string<char>, std::equal_to<void> >]'
:info:build /opt/local/include/catch2/matchers/internal/catch_matchers_impl.hpp:45:16:   required from 'Catch::MatchExpr<ArgT, MatcherT> Catch::makeMatchExpr(ArgT&&, const MatcherT&) [with ArgT = std::basic_string<char>&; MatcherT = Matchers::ContainsElementMatcher<std::basic_string<char>, std::equal_to<void> >]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/ConfigFileTest.cpp:2150:5:   required from here
:info:build /opt/local/include/gcc12/c++/bits/stl_function.h:501:44: error: no match for 'operator==' (operand types are 'char' and 'const std::basic_string<char>')
:info:build   501 |         -> decltype(std::forward<_Tp>(__t) == std::forward<_Up>(__u))
:info:build       |                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/include/gcc12/c++/bits/stl_function.h:499:9: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/bits/stl_function.h: In substitution of 'template<class _Tp, class _Up> constexpr decltype ((forward<_Tp>(__t) == forward<_Up>(__u))) std::equal_to<void>::operator()(_Tp&&, _Up&&) const [with _Tp = char&; _Up = const char (&)[27]]':
:info:build /opt/local/include/catch2/matchers/catch_matchers_contains.hpp:38:30:   required from 'bool Catch::Matchers::ContainsElementMatcher<T, Equality>::match(RangeLike&&) const [with RangeLike = std::basic_string<char>&; T = const char (&)[27]; Equality = std::equal_to<void>]'
:info:build /opt/local/include/catch2/matchers/internal/catch_matchers_impl.hpp:22:54:   required from 'Catch::MatchExpr<ArgT, MatcherT>::MatchExpr(ArgT&&, const MatcherT&) [with ArgT = std::basic_string<char>&; MatcherT = Catch::Matchers::ContainsElementMatcher<const char (&)[27], std::equal_to<void> >]'
:info:build /opt/local/include/catch2/matchers/internal/catch_matchers_impl.hpp:45:16:   required from 'Catch::MatchExpr<ArgT, MatcherT> Catch::makeMatchExpr(ArgT&&, const MatcherT&) [with ArgT = std::basic_string<char>&; MatcherT = Matchers::ContainsElementMatcher<const char (&)[27], std::equal_to<void> >]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/ConfigFileTest.cpp:2225:5:   required from here
:info:build /opt/local/include/gcc12/c++/bits/stl_function.h:501:44: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
:info:build   501 |         -> decltype(std::forward<_Tp>(__t) == std::forward<_Up>(__u))
:info:build       |                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
:build In file included from /opt/local/include/catch2/matchers/catch_matchers_all.hpp:25:
:info:build /opt/local/include/catch2/matchers/catch_matchers_contains.hpp: In instantiation of 'bool Catch::Matchers::ContainsElementMatcher<T, Equality>::match(RangeLike&&) const [with RangeLike = const char*&; T = const char (&)[10]; Equality = std::equal_to<void>]':
:info:build /opt/local/include/catch2/matchers/catch_matchers_templated.hpp:232:40:   required from 'bool Catch::Matchers::Detail::MatchNotOfGeneric<MatcherT>::match(Arg&&) const [with Arg = const char*&; MatcherT = Catch::Matchers::ContainsElementMatcher<const char (&)[10], std::equal_to<void> >]'
:info:build /opt/local/include/catch2/matchers/internal/catch_matchers_impl.hpp:22:54:   required from 'Catch::MatchExpr<ArgT, MatcherT>::MatchExpr(ArgT&&, const MatcherT&) [with ArgT = const char*; MatcherT = Catch::Matchers::Detail::MatchNotOfGeneric<Catch::Matchers::ContainsElementMatcher<const char (&)[10], std::equal_to<void> > >]'
:info:build /opt/local/include/catch2/matchers/internal/catch_matchers_impl.hpp:45:16:   required from 'Catch::MatchExpr<ArgT, MatcherT> Catch::makeMatchExpr(ArgT&&, const MatcherT&) [with ArgT = const char*; MatcherT = Matchers::Detail::MatchNotOfGeneric<Matchers::ContainsElementMatcher<const char (&)[10], std::equal_to<void> > >]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_CLI11/CLI11/work/CLI11-2.3.2/tests/AppTest.cpp:155:9:   required from here
:info:build /opt/local/include/catch2/matchers/catch_matchers_contains.hpp:37:17: error: 'begin' was not declared in this scope
:info:build    37 |                 for ( auto&& elem : rng ) {
:info:build       |                 ^~~

Also, include should be catch2/catch_all.hpp.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions