https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124493
--- 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:6edc241e2a5fb2c9162adecda1f7c74fe043db84 commit r16-8131-g6edc241e2a5fb2c9162adecda1f7c74fe043db84 Author: Marek Polacek <[email protected]> Date: Fri Mar 13 16:25:00 2026 -0400 c++/reflection: ICE with invalid splice-spec-spec [PR124493] This is a crash on invalid [:X:]<args> where [:X:] doesn't designate a template. Like in cp_parser_template_id, we should check that we have an appropriate template before calling finish_template_type on it. PR c++/124493 gcc/cp/ChangeLog: * pt.cc (tsubst) <case TEMPLATE_ID_EXPR>: Check that templ is either DECL_TYPE_TEMPLATE_P or DECL_TEMPLATE_TEMPLATE_PARM_P. gcc/testsuite/ChangeLog: * g++.dg/reflect/crash19.C: New test. * g++.dg/reflect/crash22.C: New test. Reviewed-by: Jason Merrill <[email protected]>
