https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125096
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <[email protected]>: https://gcc.gnu.org/g:0727299846d3cfaa6c1f537019f9a9e583d07d8d commit r17-254-g0727299846d3cfaa6c1f537019f9a9e583d07d8d Author: Marek Polacek <[email protected]> Date: Wed Apr 29 17:24:19 2026 -0400 c++/reflection: propagate cv-quals for SPLICE_SCOPE [PR125096] tsubst_splice_scope isn't propagating cv-quals from the template tree to the result, which means wrongly failed asserts in the new test due to a missing 'const'. So let's add the cv-quals like we do in so many other places in tsubst. PR c++/125096 gcc/cp/ChangeLog: * pt.cc (tsubst_splice_scope): Don't return early for dependent_splice_p. Propagate cv-qualifiers from the SPLICE_SCOPE to the result. * reflect.cc (valid_splice_scope_p): Accept SPLICE_SCOPE. gcc/testsuite/ChangeLog: * g++.dg/reflect/mangle4.C: Move dg-error. * g++.dg/reflect/dep16.C: New test. Reviewed-by: Jason Merrill <[email protected]>
