tests/beman/expected/testing/type_name.hpp has two implementations of the same contract:
- Reflection (P2996) —
std::meta::display_string_of(^^T), selected when __cpp_lib_reflection and __cpp_impl_reflection are both defined.
- Fallback — recovers the spelling from
std::source_location::function_name() by calibrating on the signatures of signature<bool> and signature<char>.
Only the fallback is covered by CI today. The reflection path is exercised locally by make TOOLCHAIN=gcc-16, because cmake/gcc-16-toolchain.cmake adds -freflection, but nothing in CI runs that toolchain.
Why the preset matrix can't cover it
The obvious move — a gcc-reflection-* preset in the preset-test matrix — does not work. The preset toolchains under infra/cmake/ set CMAKE_CXX_COMPILER to the unversioned g++, so the preset would build with whatever the user's default compiler is. g++-16 is nobody's default yet, and gcc rejects -freflection outright below -std=c++26 (a hard error, not a warning), so such a preset would break the build for almost everyone who ran it locally.
That is why the flag lives in cmake/gcc-16-toolchain.cmake, which pins CMAKE_CXX_COMPILER to g++-16 and already pins -std=gnu++26.
Candidate approach
The build-and-test matrix in .github/workflows/ci_tests.yml is the right place: it already pins explicit compiler versions, and the gcc-16 rows already select c++26:
{ "versions": ["16"],
"tests": [
{ "cxxversions": ["c++26"],
"tests": [
"Debug.Default", "Release.Default", ...,
"Debug.-DBEMAN_EXPECTED_USE_MODULES=On"
]
Entries accept extra cmake args in the "<Config>.<arg>" shape, so something like "Debug.-DCMAKE_CXX_FLAGS=-freflection" is the shape to aim for.
Open question before doing this: whether bemanproject/infra-workflows' reusable-beman-build-and-test.yml sets CMAKE_CXX_FLAGS itself. If it does, passing -DCMAKE_CXX_FLAGS would clobber the -std=c++26 selection and silently test the wrong thing (or fail). The reusable workflow needs reading before this is wired up — and it may need an append-style knob rather than an override.
Acceptance
- A CI job builds and runs the test suite with
-freflection on gcc-16 / c++26.
- The job demonstrably takes the reflection branch rather than silently falling back. Note that
__cpp_lib_reflection is a library macro and is undefined until <version> is included; the header handles this, but a coverage job that gets it wrong would look green while testing nothing new.
- The fallback path keeps its existing coverage — both implementations should stay tested.
Notes
The two implementations currently produce byte-identical spellings for every type the test suite uses, so this is about preventing future drift, not fixing a present discrepancy.
tests/beman/expected/testing/type_name.hpphas two implementations of the same contract:std::meta::display_string_of(^^T), selected when__cpp_lib_reflectionand__cpp_impl_reflectionare both defined.std::source_location::function_name()by calibrating on the signatures ofsignature<bool>andsignature<char>.Only the fallback is covered by CI today. The reflection path is exercised locally by
make TOOLCHAIN=gcc-16, becausecmake/gcc-16-toolchain.cmakeadds-freflection, but nothing in CI runs that toolchain.Why the preset matrix can't cover it
The obvious move — a
gcc-reflection-*preset in thepreset-testmatrix — does not work. The preset toolchains underinfra/cmake/setCMAKE_CXX_COMPILERto the unversionedg++, so the preset would build with whatever the user's default compiler is.g++-16is nobody's default yet, and gcc rejects-freflectionoutright below-std=c++26(a hard error, not a warning), so such a preset would break the build for almost everyone who ran it locally.That is why the flag lives in
cmake/gcc-16-toolchain.cmake, which pinsCMAKE_CXX_COMPILERtog++-16and already pins-std=gnu++26.Candidate approach
The
build-and-testmatrix in.github/workflows/ci_tests.ymlis the right place: it already pins explicit compiler versions, and the gcc-16 rows already selectc++26:Entries accept extra cmake args in the
"<Config>.<arg>"shape, so something like"Debug.-DCMAKE_CXX_FLAGS=-freflection"is the shape to aim for.Open question before doing this: whether
bemanproject/infra-workflows'reusable-beman-build-and-test.ymlsetsCMAKE_CXX_FLAGSitself. If it does, passing-DCMAKE_CXX_FLAGSwould clobber the-std=c++26selection and silently test the wrong thing (or fail). The reusable workflow needs reading before this is wired up — and it may need an append-style knob rather than an override.Acceptance
-freflectionon gcc-16 / c++26.__cpp_lib_reflectionis a library macro and is undefined until<version>is included; the header handles this, but a coverage job that gets it wrong would look green while testing nothing new.Notes
The two implementations currently produce byte-identical spellings for every type the test suite uses, so this is about preventing future drift, not fixing a present discrepancy.