https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102123
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:e952290874d6b99946dc02e125c0fb0e9b13a1e3 commit r11-9703-ge952290874d6b99946dc02e125c0fb0e9b13a1e3 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.c (tsubst_copy): Use make_unbound_class_template for rewriting a type template reference. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/class-deduction110.C: New test.