https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105476
--- Comment #7 from CVS 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:8a98e3ff7e80bf2936f163d50309fd88d72564a0 commit r13-123-g8a98e3ff7e80bf2936f163d50309fd88d72564a0 Author: Patrick Palka <ppa...@redhat.com> Date: Wed May 4 17:08:08 2022 -0400 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.