https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96199
--- Comment #5 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:b871301f09be7061904dc87880919d30e6afef8f commit r11-2748-gb871301f09be7061904dc87880919d30e6afef8f Author: Jason Merrill <ja...@redhat.com> Date: Fri Aug 14 18:01:27 2020 -0400 c++: Rewrite members for all deduction guides. [PR96199] After the last patch, it occurred to me that we could run into the specialization issue with non-alias deduction guides as well, so this patch extends the rewriting to C++17 mode. Doing this revealed that we weren't properly pushing into class scope for normalization. gcc/cp/ChangeLog: PR c++/96199 * pt.c (tsubst_aggr_type): Rewrite in C++17, too. (maybe_dependent_member_ref): Likewise. (build_deduction_guide): Re-substitute template parms. * cp-tree.h (struct push_nested_class_guard): New. * constraint.cc (get_normalized_constraints_from_decl): Use it. gcc/testsuite/ChangeLog: PR c++/96199 * g++.dg/cpp1z/class-deduction-spec1.C: New test.