https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105476
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:8f2b7c13567250d86367c0274859f6c2fe162082 commit r12-8350-g8f2b7c13567250d86367c0274859f6c2fe162082 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. (cherry picked from commit 8a98e3ff7e80bf2936f163d50309fd88d72564a0)