https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117849
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:49b6308d2596f7334011f84bae8d35d68c302a3c commit r14-11529-g49b6308d2596f7334011f84bae8d35d68c302a3c Author: Patrick Palka <ppa...@redhat.com> Date: Fri Apr 4 14:03:58 2025 -0400 c++: constraint variable used in evaluated context [PR117849] Here we wrongly reject the type-requirement at parse time due to its use of the constraint variable 't' within a template argument (an evaluated context). Fix this simply by refining the "use of parameter outside function body" error path to exclude constraint variables. PR c++/104255 tracks the same issue for function parameters, but fixing that would be more involved, requiring changes to the PARM_DECL case of tsubst_expr. PR c++/117849 gcc/cp/ChangeLog: * semantics.cc (finish_id_expression_1): Allow use of constraint variable outside an unevaluated context. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires41.C: New test. Reviewed-by: Jason Merrill <ja...@redhat.com> (cherry picked from commit 6e973e87e3fec6f33e97edf8fce2fcd121e53961)