https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102123
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:b854ce130ebbfdf2f882ef08538746030513b44b commit r12-7853-gb854ce130ebbfdf2f882ef08538746030513b44b Author: Jason Merrill <ja...@redhat.com> Date: Sat Mar 26 23:54:22 2022 -0400 c++: CTAD and member alias template [PR102123] When building a deduction guide from the Test constructor, we need to rewrite the use of _dummy into a dependent reference, i.e. Test<T>::template _dummy. We were using SCOPE_REF for both type and non-type templates; we need to use UNBOUND_CLASS_TEMPLATE for type templates. PR c++/102123 gcc/cp/ChangeLog: * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting a type template reference. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/class-deduction110.C: New test.