[Bug c++/124150] [reflection] internal compiler error: in get_fns, at cp/tree.cc:2795
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 23 15:38:50 GMT 2026
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 <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:99b63e4ac7ee06e2f5030b72dc876bf35e9842ca
commit r16-7649-g99b63e4ac7ee06e2f5030b72dc876bf35e9842ca
Author: Marek Polacek <polacek@redhat.com>
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 <jason@redhat.com>
More information about the Gcc-bugs
mailing list