https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118454
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:d72e5b7be203f9bb9b7e2aac8dd812af7f70859f commit r15-6974-gd72e5b7be203f9bb9b7e2aac8dd812af7f70859f Author: Patrick Palka <ppa...@redhat.com> Date: Thu Jan 16 16:08:25 2025 -0500 c++: pack expansion arg vs non-pack parm checking ICE [PR118454] During ahead of time template argument coercion, we handle the case of passing a pack expansion to a non-pack parameter by breaking out early and using the original unconverted arguments, deferring coercion until instantiation time where we have concrete arguments. This PR illustrates we still need to strip typedefs from the original arguments in this case as in the ordinary case, for sake of our template argument hashing/equivalence routines which assume template arguments went through strip_typedefs. Since we're using the unconverted arguments we need to preserve injected-class-name typedefs because we use them to distinguish passing an injected-class-name vs the corresponding specialization as the argument to a template template parameter (the former is valid, the latter isn't). PR c++/118454 gcc/cp/ChangeLog: * cp-tree.h (STF_KEEP_INJ_CLASS_NAME): Define. * pt.cc (iterative_hash_template_argument) <case tcc_type>: Clarify comment for when we'd see an alias template specialization here. (coerce_template_parms): Strip typedefs (except for injected-class-names) in the pack expansion early break cases that defer coercion. * tree.cc (strip_typedefs): Don't strip an injected-class-name if STF_KEEP_INJ_CLASS_NAME is set. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic187.C: New test. Reviewed-by: Jason Merrill <ja...@redhat.com>