]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: hash table ICE with variadic alias [PR105003]
authorJason Merrill <jason@redhat.com>
Fri, 25 Mar 2022 17:13:35 +0000 (13:13 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 12 Apr 2022 20:12:48 +0000 (16:12 -0400)
commit00e7d6e66638b8d2d93ff6659a140f8b3cf37aeb
tree3f542105d142a024c225853516e98ecb78596be9
parentad4b23729b2e57676efb3d8313f4fc5300b94339
c++: hash table ICE with variadic alias [PR105003]

For PR104008 we thought it might be enough to keep strip_typedefs from
removing this alias template specialization, but this PR demonstrates that
other parts of the compiler also need to know to consider it dependent.

So, this patch changes complex_alias_template_p to no longer consider
template parameters used when their only use appears in a pack expansion,
unless they are the parameter packs being expanded.

To do that I also needed to change it to use cp_walk_tree instead of
for_each_template_parm.  It occurs to me that find_template_parameters
should probably also use cp_walk_tree, but I'm not messing with that now.

PR c++/105003
PR c++/104008
PR c++/102869

gcc/cp/ChangeLog:

* pt.c (complex_alias_template_r): walk_tree callback, replacing
uses_all_template_parms_r, complex_pack_expansion_r.
(complex_alias_template_p): Adjust.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/variadic-alias6.C: New test.
* g++.dg/cpp0x/variadic-alias7.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/variadic-alias6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/variadic-alias7.C [new file with mode: 0644]