C++ starter project fails to build with Clang 20+ due to Catch2 bug

Viewed 104

Hello! I just started looking at the C++ course, and while the starter project compiles fine in a Debian VM, the Catch2 subproject is currently failing to compile in macOS 26.4.1.

As far as I can tell, it's not an issue with the starter project itself, but appears to be the result of this issue, which would mean it will probably fail on any system with Clang version 20+ as its compiler: https://github.com/catchorg/Catch2/issues/2991

Just wanted to report it in case others have the same problem.

Complete terminal output:

╭─kaj@Starman in ~/Workspace/learning/c++/cpp-starter-project on master ✔ (origin/master)
╰$ clang -v
Apple clang version 21.0.0 (clang-2100.0.123.102)
Target: arm64-apple-darwin25.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

╭─kaj@Starman in ~/Workspace/learning/c++/cpp-starter-project on master ✔ (origin/master)
╰$ make
meson compile -j 10 -C /Users/kaj/Workspace/learning/c++/cpp-starter-project//builddir
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /opt/local/bin/ninja -C /Users/kaj/Workspace/learning/c++/cpp-starter-project/builddir -j 10
ninja: Entering directory `/Users/kaj/Workspace/learning/c++/cpp-starter-project/builddir'
[210/609] Compiling C object subprojects/libvorbis-1.3.7/lib/libvorbis.a.p/floor1.c.o
../subprojects/libvorbis-1.3.7/lib/floor1.c:458:26: warning: variable 'y2b' set but not used [-Wunused-but-set-variable]
  458 |   double xb=0,yb=0,x2b=0,y2b=0,xyb=0,bn=0;
      |                          ^
1 warning generated.
[222/609] Compiling C object subprojects/libvorbis-1.3.7/lib/libvorbisfile.a.p/vorbisfile.c.o
../subprojects/libvorbis-1.3.7/lib/vorbisfile.c:1992:24: warning: unused variable 'fpu' [-Wunused-variable]
 1992 |     vorbis_fpu_control fpu;
      |                        ^~~
1 warning generated.
[249/609] Compiling C object subprojects/SFML-3.0.0/libvorbis.a.p/b...368d288a4ca0a56059c4a5___CMake_build__deps_vorbis-src_lib_floor1.c.
/Users/kaj/Workspace/learning/c++/cpp-starter-project/builddir/subprojects/SFML-3.0.0/__CMake_build/_deps/vorbis-src/lib/floor1.c:458:26: warning: variable 'y2b' set but not used [-Wunused-but-set-variable]
  458 |   double xb=0,yb=0,x2b=0,y2b=0,xyb=0,bn=0;
      |                          ^
1 warning generated.
[260/609] Compiling C object subprojects/SFML-3.0.0/libvorbisfile.a...55c4e2aff1ac2f5bbd___CMake_build__deps_vorbis-src_lib_vorbisfile.c.
/Users/kaj/Workspace/learning/c++/cpp-starter-project/builddir/subprojects/SFML-3.0.0/__CMake_build/_deps/vorbis-src/lib/vorbisfile.c:1992:24: warning: unused variable 'fpu' [-Wunused-variable]
 1992 |     vorbis_fpu_control fpu;
      |                        ^~~
1 warning generated.
[340/609] Compiling Objective-C++ object subprojects/SFML-3.0.0/libsfml_window.a.p/src_SFML_Window_macOS_InputImpl.mm.o
../subprojects/SFML-3.0.0/src/SFML/Window/macOS/InputImpl.mm:66:16: warning: incompatible pointer types assigning to 'SFOpenGLView *' from 'NSView * _Nullable' [-Wincompatible-pointer-types]
   66 |         view = [nsHandle contentView];
      |                ^~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[377/609] Compiling C object subprojects/SFML-3.0.0/libfreetype.a.p...e5a5d982296a58b6857ec16529b6b__deps_freetype-src_src_gzip_ftgzip.c.
In file included from /Users/kaj/Workspace/learning/c++/cpp-starter-project/builddir/subprojects/SFML-3.0.0/__CMake_build/_deps/freetype-src/src/gzip/ftgzip.c:99:
In file included from /Users/kaj/Workspace/learning/c++/cpp-starter-project/builddir/subprojects/SFML-3.0.0/__CMake_build/_deps/freetype-src/src/gzip/zutil.c:8:
/Users/kaj/Workspace/learning/c++/cpp-starter-project/builddir/subprojects/SFML-3.0.0/__CMake_build/_deps/freetype-src/src/gzip/zutil.h:172:11: warning: 'OS_CODE' macro redefined [-Wmacro-redefined]
  172 | #  define OS_CODE 19
      |           ^
/Users/kaj/Workspace/learning/c++/cpp-starter-project/builddir/subprojects/SFML-3.0.0/__CMake_build/_deps/freetype-src/src/gzip/zutil.h:143:11: note: previous definition is here
  143 | #  define OS_CODE  7
      |           ^
1 warning generated.
[458/609] Compiling C++ object subprojects/box2d-2.4.1/src/libbox2d.a.p/dynamics_b2_distance_joint.cpp.o
../subprojects/box2d-2.4.1/src/dynamics/b2_distance_joint.cpp:395:8: warning: unused variable 'length' [-Wunused-variable]
  395 |         float length = axis.Normalize();
      |               ^~~~~~
1 warning generated.
[467/609] Compiling C++ object subprojects/box2d-2.4.1/src/libbox2d.a.p/dynamics_b2_mouse_joint.cpp.o
../subprojects/box2d-2.4.1/src/dynamics/b2_mouse_joint.cpp:87:8: warning: unused variable 'mass' [-Wunused-variable]
   87 |         float mass = m_bodyB->GetMass();
      |               ^~~~
1 warning generated.
[522/609] Compiling C++ object subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o
FAILED: [code=1] subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o 
c++ -Isubprojects/Catch2-3.7.1/tests/SelfTest.p -Isubprojects/Catch2-3.7.1/tests -I../subprojects/Catch2-3.7.1/tests -Isubprojects/Catch2-3.7.1/src -I../subprojects/Catch2-3.7.1/src -I../subprojects/Catch2-3.7.1/tests/SelfTest -fdiagnostics-color=always -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST -Wall -Winvalid-pch -std=c++23 -O0 -g -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1 -MD -MQ subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o -MF subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o.d -o subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o -c ../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: error: no matching function for call to 'get_wrapper'
  387 | TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/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)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387: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.7.1/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.7.1/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.7.1/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.7.1/src/catch2/internal/catch_preprocessor.hpp:108:20: note: expanded from macro 'INTERNAL_CATCH_TYPE_GEN'
  108 |     constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> { return {}; }\
      |                    ^
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'Ts'
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/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.7.1/src/catch2/internal/catch_preprocessor.hpp:105:20: note: expanded from macro 'INTERNAL_CATCH_TYPE_GEN'
  105 |     constexpr auto get_wrapper() noexcept -> TypeList<Ts...> { return {}; }\
      |                    ^
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: error: expected a qualified name after 'typename'
  387 | TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
      | ^
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/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)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                           ^
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: error: expected ';' after alias declaration
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/src/catch2/internal/catch_template_test_registry.hpp:142:218: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  142 |                 using TestInit = typename create<TestName, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                                                                                                                                                                                                          ^
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: error: unknown type name 'TestInit'
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/src/catch2/internal/catch_template_test_registry.hpp:143:17: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  143 |                 TestInit t;                                           \
      |                 ^
4 errors generated.
[531/609] Compiling C++ object subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_ToStringVariant.tests.cpp.o
ninja: build stopped: subcommand failed.
make: *** [build] Error 1
2 Answers

Unfortunately, the issue does not appear to be limited to only Apple/ARM, as I do get what appear to be the same errors on my x86_64 Linux box when using Clang 21.1.8. :-/

However, I did also try it with Clang 22 just now (the current version in Arch Linux), and it actually did compile successfully! It seems possible the issue may have already been solved upstream and would go away on MacOS as well once Apple eventually updates their bundled version of Clang?

If there's anything you'd like me to test on my ARM Mac, I'd be happy to!

The change I made to reset_build.sh for this test:

diff --git a/scripts/reset_build.sh b/scripts/reset_build.sh
index 89931e7..5e9556b 100755
--- a/scripts/reset_build.sh
+++ b/scripts/reset_build.sh
@@ -7,4 +7,4 @@ mv -f packagecache ./subprojects/ && true
 mkdir builddir
 cp wraps/*.wrap subprojects/
 # on OSX you can't do this with static
-meson setup --default-library=static --prefer-static  builddir
+CC=clang CXX=clang++ meson setup --default-library=static --prefer-static  builddir

Full failed terminal output (Clang 21, Arch Linux x86_64):

╭─kaj@magicant in /workspace/learning/c++/cpp-starter-project on master ✔ (origin/master)
╰$ clang -v
clang version 21.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/15.2.1
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/15.2.1
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/15.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Found HIP installation: /opt/rocm, version 7.2.53211
╭─kaj@magicant in /workspace/learning/c++/cpp-starter-project on master ✔ (origin/master)
╰$ make
meson compile -j 10 -C /workspace/learning/c++/cpp-starter-project//builddir
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/sbin/ninja -C /workspace/learning/c++/cpp-starter-project/builddir -j 10
ninja: Entering directory `/workspace/learning/c++/cpp-starter-project/builddir'
[187/494] Compiling C object subprojects/flac-1.4.3/src/share/getopt/libgetopt.a.p/getopt.c.o
../subprojects/flac-1.4.3/src/share/getopt/getopt.c:779:11: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  779 |     char *temp = my_index (optstring, c);
      |           ^      ~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[212/494] Compiling C object subprojects/libvorbis-1.3.7/lib/libvorbis.a.p/floor1.c.o
../subprojects/libvorbis-1.3.7/lib/floor1.c:458:26: warning: variable 'y2b' set but not used [-Wunused-but-set-variable]
  458 |   double xb=0,yb=0,x2b=0,y2b=0,xyb=0,bn=0;
      |                          ^
1 warning generated.
[350/494] Compiling C++ object subprojects/box2d-2.4.1/src/libbox2d.a.p/dynamics_b2_distance_joint.cpp.o
../subprojects/box2d-2.4.1/src/dynamics/b2_distance_joint.cpp:395:8: warning: unused variable 'length' [-Wunused-variable]
  395 |         float length = axis.Normalize();
      |               ^~~~~~
1 warning generated.
[359/494] Compiling C++ object subprojects/box2d-2.4.1/src/libbox2d.a.p/dynamics_b2_mouse_joint.cpp.o
../subprojects/box2d-2.4.1/src/dynamics/b2_mouse_joint.cpp:87:8: warning: unused variable 'mass' [-Wunused-variable]
   87 |         float mass = m_bodyB->GetMass();
      |               ^~~~
1 warning generated.
[413/494] Compiling C++ object subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o
FAILED: [code=1] subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o
clang++ -Isubprojects/Catch2-3.7.1/tests/SelfTest.p -Isubprojects/Catch2-3.7.1/tests -I../subprojects/Catch2-3.7.1/tests -Isubprojects/Catch2-3.7.1/src -I../subprojects/Catch2-3.7.1/src -I../subprojects/Catch2-3.7.1/tests/SelfTest -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++23 -O0 -g -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1 -MD -MQ subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o -MF subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o.d -o subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_Misc.tests.cpp.o -c ../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: error: no matching function for call to 'get_wrapper'
  387 | TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/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)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387: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.7.1/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.7.1/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.7.1/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.7.1/src/catch2/internal/catch_preprocessor.hpp:108:20: note: expanded from macro 'INTERNAL_CATCH_TYPE_GEN'
  108 |     constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> { return {}; }\
      |                    ^
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'Ts'
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/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.7.1/src/catch2/internal/catch_preprocessor.hpp:105:20: note: expanded from macro 'INTERNAL_CATCH_TYPE_GEN'
  105 |     constexpr auto get_wrapper() noexcept -> TypeList<Ts...> { return {}; }\
      |                    ^
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: error: expected a qualified name after 'typename'
  387 | TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
      | ^
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/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)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                           ^
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: error: expected ';' after alias declaration
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/src/catch2/internal/catch_template_test_registry.hpp:142:218: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  142 |                 using TestInit = typename create<TestName, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
      |                                                                                                                                                                                                                          ^
../subprojects/Catch2-3.7.1/tests/SelfTest/UsageTests/Misc.tests.cpp:387:1: error: unknown type name 'TestInit'
../subprojects/Catch2-3.7.1/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.7.1/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.7.1/src/catch2/internal/catch_template_test_registry.hpp:143:17: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2'
  143 |                 TestInit t;                                           \
      |                 ^
4 errors generated.
[422/494] Compiling C++ object subprojects/Catch2-3.7.1/tests/SelfTest.p/SelfTest_UsageTests_ToStringVariant.tests.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:13: build] Error 1

===

Full successful terminal output (Clang 22, Arch Linux x86_64):

╭─kaj@magicant in /workspace/learning/c++/cpp-starter-project on master ✔ (origin/master)
╰$ clang -v
clang version 22.1.3
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/15.2.1
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/15.2.1
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/15.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Found HIP installation: /opt/rocm, version 7.2.53211
╭─kaj@magicant in /workspace/learning/c++/cpp-starter-project on master ✔ (origin/master)
╰$ make
meson compile -j 10 -C /workspace/learning/c++/cpp-starter-project//builddir
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/sbin/ninja -C /workspace/learning/c++/cpp-starter-project/builddir -j 10
ninja: Entering directory `/workspace/learning/c++/cpp-starter-project/builddir'
[188/494] Compiling C object subprojects/flac-1.4.3/src/share/getopt/libgetopt.a.p/getopt.c.o
../subprojects/flac-1.4.3/src/share/getopt/getopt.c:779:11: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  779 |     char *temp = my_index (optstring, c);
      |           ^      ~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[213/494] Compiling C object subprojects/libvorbis-1.3.7/lib/libvorbis.a.p/floor1.c.o
../subprojects/libvorbis-1.3.7/lib/floor1.c:458:26: warning: variable 'y2b' set but not used [-Wunused-but-set-variable]
  458 |   double xb=0,yb=0,x2b=0,y2b=0,xyb=0,bn=0;
      |                          ^
1 warning generated.
[349/494] Compiling C++ object subprojects/box2d-2.4.1/src/libbox2d.a.p/dynamics_b2_distance_joint.cpp.o
../subprojects/box2d-2.4.1/src/dynamics/b2_distance_joint.cpp:395:8: warning: unused variable 'length' [-Wunused-variable]
  395 |         float length = axis.Normalize();
      |               ^~~~~~
1 warning generated.
[360/494] Compiling C++ object subprojects/box2d-2.4.1/src/libbox2d.a.p/dynamics_b2_mouse_joint.cpp.o
../subprojects/box2d-2.4.1/src/dynamics/b2_mouse_joint.cpp:87:8: warning: unused variable 'mass' [-Wunused-variable]
   87 |         float mass = m_bodyB->GetMass();
      |               ^~~~
1 warning generated.
[433/494] Compiling C object subprojects/flac-1.4.3/src/flac/flac.p/main.c.o
../subprojects/flac-1.4.3/src/flac/main.c:1087:8: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
 1087 |                                         p = strchr(option_argument, ',');
      |                                           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[435/494] Compiling C object subprojects/flac-1.4.3/src/flac/flac.p/utils.c.o
../subprojects/flac-1.4.3/src/flac/utils.c:431:13: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  431 |         if(0 == (p = strchr((const char *)object->data.vorbis_comment.comments[offset].entry, '='))) /* should never happen, but just in case */
      |                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[454/494] Compiling C object subprojects/libvorbis-1.3.7/vq/latticebuild.p/vqgen.c.o
../subprojects/libvorbis-1.3.7/vq/vqgen.c:385:14: warning: variable 'secondentry' set but not used [-Wunused-but-set-variable]
  385 |       long   secondentry=1;
      |              ^
1 warning generated.
[455/494] Compiling C object subprojects/libvorbis-1.3.7/vq/latticebuild.p/bookutil.c.o
../subprojects/libvorbis-1.3.7/vq/bookutil.c:437:7: warning: unused variable 'i' [-Wunused-variable]
  437 |   int i,j,k;
      |       ^
1 warning generated.
[456/494] Compiling C object subprojects/libvorbis-1.3.7/vq/latticetune.p/latticetune.c.o
../subprojects/libvorbis-1.3.7/vq/latticetune.c:44:18: warning: variable 'dim' set but not used [-Wunused-but-set-variable]
   44 |   int entries=-1,dim=-1,guard=1;
      |                  ^
1 warning generated.
[457/494] Compiling C object subprojects/libvorbis-1.3.7/vq/latticetune.p/vqgen.c.o
../subprojects/libvorbis-1.3.7/vq/vqgen.c:385:14: warning: variable 'secondentry' set but not used [-Wunused-but-set-variable]
  385 |       long   secondentry=1;
      |              ^
1 warning generated.
[458/494] Compiling C object subprojects/libvorbis-1.3.7/vq/latticetune.p/bookutil.c.o
../subprojects/libvorbis-1.3.7/vq/bookutil.c:437:7: warning: unused variable 'i' [-Wunused-variable]
  437 |   int i,j,k;
      |       ^
1 warning generated.
[459/494] Compiling C object subprojects/libvorbis-1.3.7/vq/huffbuild.p/huffbuild.c.o
../subprojects/libvorbis-1.3.7/vq/huffbuild.c:92:10: warning: variable 'subn' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
   92 |       if(!pos)
      |          ^~~~
../subprojects/libvorbis-1.3.7/vq/huffbuild.c:96:12: note: uninitialized use occurs here
   96 |       if(n/subn*subn != n){
      |            ^~~~
../subprojects/libvorbis-1.3.7/vq/huffbuild.c:92:7: note: remove the 'if' if its condition is always false
   92 |       if(!pos)
      |       ^~~~~~~~
   93 |         usage();
      |         ~~~~~~~~
   94 |       else
      |       ~~~~
   95 |         subn=atoi(pos+1);
../subprojects/libvorbis-1.3.7/vq/huffbuild.c:64:25: note: initialize the variable 'subn' to silence this warning
   64 |   int i,j,k,begin,n,subn,guard=1;
      |                         ^
      |                          = 0
../subprojects/libvorbis-1.3.7/vq/huffbuild.c:87:10: warning: variable 'n' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
   87 |       if(!pos)
      |          ^~~~
../subprojects/libvorbis-1.3.7/vq/huffbuild.c:96:10: note: uninitialized use occurs here
   96 |       if(n/subn*subn != n){
      |          ^
../subprojects/libvorbis-1.3.7/vq/huffbuild.c:87:7: note: remove the 'if' if its condition is always false
   87 |       if(!pos)
      |       ^~~~~~~~
   88 |         usage();
      |         ~~~~~~~~
   89 |       else
      |       ~~~~
   90 |         n=atoi(pos+1);
../subprojects/libvorbis-1.3.7/vq/huffbuild.c:64:20: note: initialize the variable 'n' to silence this warning
   64 |   int i,j,k,begin,n,subn,guard=1;
      |                    ^
      |                     = 0
2 warnings generated.
[460/494] Compiling C object subprojects/libvorbis-1.3.7/vq/huffbuild.p/vqgen.c.o
../subprojects/libvorbis-1.3.7/vq/vqgen.c:385:14: warning: variable 'secondentry' set but not used [-Wunused-but-set-variable]
  385 |       long   secondentry=1;
      |              ^
1 warning generated.
[462/494] Compiling C object subprojects/libvorbis-1.3.7/vq/huffbuild.p/bookutil.c.o
../subprojects/libvorbis-1.3.7/vq/bookutil.c:437:7: warning: unused variable 'i' [-Wunused-variable]
  437 |   int i,j,k;
      |       ^
1 warning generated.
[494/494] Linking target demo
./builddir/runtests -d yes
Randomness seeded to: 69627112
0.000 s: sample test
===============================================================================
All tests passed (1 assertion in 1 test case)

Man I really hate Catch2...and Clang for that matter. For some reason Clang became extremely pedantic this last release and won't compile code that GCC has no problem with, but then Clang has obvious bugs in things like source_location they refuse to fix for years.

Anyway, this also looks like it might be tough to solve because it's a regression in Clang maybe?

https://github.com/catchorg/Catch2/issues/2981

Which leads to:

https://github.com/llvm/llvm-project/issues/140519

I wonder if I can fix it by just not running Catch2's test suite during build. I'll give it a try tonight if I can get a matching version of Clang.

Last thing: I don't know if I can get an ARM Mac to test this on. Do you have any idea if this is also a problem on any platform with Clang 21 or just an Apple ARM thing?

Thanks for the report!