c++: ICE during aggr CTAD for member tmpl [PR105476]
authorPatrick Palka <ppalka@redhat.com>
Wed, 4 May 2022 21:08:08 +0000 (17:08 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 6 May 2022 13:11:58 +0000 (09:11 -0400)
commit8f2b7c13567250d86367c0274859f6c2fe162082
treed8386c386ff1e808b62cb9d19bca7079c2fa3bb9
parenteed2cd48cd5e8d94ceb15c5fd86cdd27926b54b5
c++: ICE during aggr CTAD for member tmpl [PR105476]

Here we're crashing from maybe_aggr_guide ultimately because
processing_template_decl isn't set when partially instantiating the
guide's parameter list; this causes us to force completion of the
dependent type Visitor_functior<Fn>, which of course fails and results
in an unexpected error_mark_node (the instantation should always succeed).

PR c++/105476

gcc/cp/ChangeLog:

* pt.cc (maybe_aggr_guide): Set processing_template_decl when
partially instantiating the guide's parameter list.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/class-deduction-aggr13.C: New test.
* g++.dg/cpp2a/class-deduction-aggr13a.C: New test.

(cherry picked from commit 8a98e3ff7e80bf2936f163d50309fd88d72564a0)
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr13.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr13a.C [new file with mode: 0644]