Skip to content

Tests fail to compile under MacOS / Alpine #3115

Closed

Description

@stephanlachnit

Describe the bug

Under MacOS and Alpine, the builds fail with the following compilation error:

Log
c++ -Isubprojects/Catch2-3.15.0/tests/SelfTest.p -Isubprojects/Catch2-3.15.0/tests -I../subprojects/Catch2-3.15.0/tests -Isubprojects/Catch2-3.15.0/src -I../subprojects/Catch2-3.15.0/src -I../subprojects/Catch2-3.15.0/tests/SelfTest -fdiagnostics-color=always -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST -Wall -Winvalid-pch -O0 -g -MD -MQ subprojects/Catch2-3.15.0/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o -MF subprojects/Catch2-3.15.0/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o.d -o subprojects/Catch2-3.15.0/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o -c ../subprojects/Catch2-3.15.0/tests/SelfTest/UsageTests/Misc.tests.cpp
../subprojects/Catch2-3.15.0/tests/SelfTest/UsageTests/Misc.tests.cpp:391:1: error: no matching function for call to 'get_wrapper'
  391 | TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/Catch2-3.15.0/src/catch2/catch_template_test_macros.hpp:80:47: note: expanded from macro 'TEMPLATE_PRODUCT_TEST_CASE'
   80 |     #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:155:9: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE'
  155 |         INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:142:69: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  142 |                 using TestInit = typename create<TestName, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>(Catch::Detail::priority_tag<1>{})), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/Catch2-3.15.0/tests/SelfTest/UsageTests/Misc.tests.cpp:391:1: note: candidate template ignored: substitution failure [with Cs = <std::tuple>]: conflicting deduction 'std::tuple' against 'type-parameter-0-0' for parameter
../subprojects/Catch2-3.15.0/src/catch2/catch_template_test_macros.hpp:80:47: note: expanded from macro 'TEMPLATE_PRODUCT_TEST_CASE'
   80 |     #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
      |                                               ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:155:9: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE'
  155 |         INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__)
      |         ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:128:13: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  128 |             INTERNAL_CATCH_TYPE_GEN                                                  \
      |             ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_preprocessor.hpp:117:20: note: expanded from macro 'INTERNAL_CATCH_TYPE_GEN'
  117 |     constexpr auto get_wrapper(Catch::Detail::priority_tag<1>) noexcept -> TemplateTypeList<Cs...> { return {}; }\
      |                    ^
../subprojects/Catch2-3.15.0/tests/SelfTest/UsageTests/Misc.tests.cpp:391:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'Ts'
../subprojects/Catch2-3.15.0/src/catch2/catch_template_test_macros.hpp:80:47: note: expanded from macro 'TEMPLATE_PRODUCT_TEST_CASE'
   80 |     #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
      |                                               ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:155:9: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE'
  155 |         INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__)
      |         ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:128:13: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  128 |             INTERNAL_CATCH_TYPE_GEN                                                  \
      |             ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_preprocessor.hpp:114:20: note: expanded from macro 'INTERNAL_CATCH_TYPE_GEN'
  114 |     constexpr auto get_wrapper(Catch::Detail::priority_tag<1>) noexcept -> TypeList<Ts...> { return {}; }\
      |                    ^
../subprojects/Catch2-3.15.0/tests/SelfTest/UsageTests/Misc.tests.cpp:391:1: error: expected a qualified name after 'typename'
  391 | TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
      | ^
../subprojects/Catch2-3.15.0/src/catch2/catch_template_test_macros.hpp:80:47: note: expanded from macro 'TEMPLATE_PRODUCT_TEST_CASE'
   80 |     #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
      |                                               ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:155:9: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE'
  155 |         INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__)
      |         ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:142:43: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  142 |                 using TestInit = typename create<TestName, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>(Catch::Detail::priority_tag<1>{})), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                           ^
../subprojects/Catch2-3.15.0/tests/SelfTest/UsageTests/Misc.tests.cpp:391:1: error: expected ';' after alias declaration
../subprojects/Catch2-3.15.0/src/catch2/catch_template_test_macros.hpp:80:47: note: expanded from macro 'TEMPLATE_PRODUCT_TEST_CASE'
   80 |     #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
      |                                               ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:155:9: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE'
  155 |         INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__)
      |         ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:142:250: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  142 |                 using TestInit = typename create<TestName, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>(Catch::Detail::priority_tag<1>{})), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                                                                                                                                                                                                                                          ^
../subprojects/Catch2-3.15.0/tests/SelfTest/UsageTests/Misc.tests.cpp:391:1: error: unknown type name 'TestInit'
../subprojects/Catch2-3.15.0/src/catch2/catch_template_test_macros.hpp:80:47: note: expanded from macro 'TEMPLATE_PRODUCT_TEST_CASE'
   80 |     #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
      |                                               ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:155:9: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE'
  155 |         INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__)
      |         ^
../subprojects/Catch2-3.15.0/src/catch2/internal/catch_template_test_registry.hpp:143:17: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  143 |                 TestInit t;                                           \
      |                 ^

For the entire pipelines, see mesonbuild/wrapdb#2778

Expected behavior

The compilation does not fail

Reproduction steps

Compile catch2 via meson with tests under the mentioned platforms

Platform information:

See pipelines in mesonbuild/wrapdb#2778 for details. The only commonality I see is clang + libc++, since clang on MSYS2 seems to work.

Activity

  1. stephanlachnit commented on Jun 25, 2026

    @stephanlachnit
    Author

    Seems to be an issue with clang 20 and 21, with clang 22 this is fixed. So maybe a compiler bug.

  2. mvanhorn commented on Jul 10, 2026

    @mvanhorn
    Contributor

    Implemented in #3173.

  3. added a commit that references this issue on Aug 20, 2026
    fdfc07e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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