From: Marek Polacek Date: Tue, 3 Mar 2026 14:40:31 +0000 (-0500) Subject: c++/reflection: add fixed test [PR124324] X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86bfcedd0fe3b3f2833a04d8ffc80b40d902dfbd;p=thirdparty%2Fgcc.git c++/reflection: add fixed test [PR124324] Another test for the recently-fixed PR124324. PR c++/124324 gcc/testsuite/ChangeLog: * g++.dg/reflect/substitute6.C: New test. --- diff --git a/gcc/testsuite/g++.dg/reflect/substitute6.C b/gcc/testsuite/g++.dg/reflect/substitute6.C new file mode 100644 index 00000000000..8d9665ba933 --- /dev/null +++ b/gcc/testsuite/g++.dg/reflect/substitute6.C @@ -0,0 +1,13 @@ +// PR c++/124324 +// { dg-do compile { target c++26 } } +// { dg-additional-options "-freflection" } + +#include + +template +void function (); + +constexpr auto substituted = substitute (^^function, {^^int}); +static_assert (is_function (substituted)); +constexpr auto t = type_of (substituted); +[: t :] bar;