https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104470
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:73b47159d7811cf1d7aaaf78dbdd141161b93ca3 commit r12-8379-g73b47159d7811cf1d7aaaf78dbdd141161b93ca3 Author: Jason Merrill <ja...@redhat.com> Date: Wed Apr 27 11:13:24 2022 -0400 c++: alias CTAD and member alias templates [PR104470] In this testcase, we were trying to substitute into variant<Foo<T>>::__accepted_type, but failed to look it up because variant<Foo<T>> doesn't exist. In other cases we already rewrite such things into a dependent reference; we need to do that for alias templates as well. This caused some testsuite regressions on alias uses outside of deduction guides, so I've made all of this rewriting conditional on a new tf_dguide tsubst flag. PR c++/104470 gcc/cp/ChangeLog: * cp-tree.h (enum tsubst_flags): Add tf_dguide. * pt.cc (tsubst_aggr_type): Check it. (tsubst_baselink, tsubst_copy): Check it. (maybe_dependent_member_ref): Check it. (instantiate_alias_template): Handle it. (build_deduction_guide): Set it. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/explicit11.C: Second example also ill-formed. * g++.dg/cpp2a/class-deduction-alias12.C: New test.