https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124150
--- Comment #1 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:99b63e4ac7ee06e2f5030b72dc876bf35e9842ca commit r16-7649-g99b63e4ac7ee06e2f5030b72dc876bf35e9842ca Author: Marek Polacek <[email protected]> Date: Tue Feb 17 17:08:52 2026 -0500 c++/reflection: ICE with missing OVERLOAD [PR124150] A function template is supposed to be wrapped in an OVERLOAD. Since in certain cases like members_of it is not, splice makes sure to add the OVERLOAD if needed. But it wasn't looking into TEMPLATE_ID_EXPRs and so we ended up with a "naked" TEMPLATE_DECL and crashed. We can add the missing OVERLOAD in eval_substitute. PR c++/124150 gcc/cp/ChangeLog: * reflect.cc (eval_substitute): Add an OVERLOAD around a DECL_FUNCTION_TEMPLATE_P. gcc/testsuite/ChangeLog: * g++.dg/reflect/substitute4.C: New test. Reviewed-by: Jason Merrill <[email protected]>
