https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89761
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Mon Mar 18 19:35:12 2019 New Revision: 269776 URL: https://gcc.gnu.org/viewcvs?rev=269776&root=gcc&view=rev Log: PR c++/89761 - ICE with sizeof... in pack expansion. In this testcase we get confused when looking at the sizeof... because the argument pack for 'args' has been wrapped in an ARGUMENT_PACK_SELECT as part of expanding the fold-expression. We handle this situation a bit lower down in tsubst_pack_expansion, but that doesn't help the call to argument_pack_element_is_expansion_p, which happens earlier. * pt.c (argument_pack_element_is_expansion_p): Handle ARGUMENT_PACK_SELECT. Added: trunk/gcc/testsuite/g++.dg/cpp1z/fold10.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c