diff options
author | Jason Merrill <jason@redhat.com> | 2020-08-14 18:01:27 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-08-18 16:20:09 -0400 |
commit | b871301f09be7061904dc87880919d30e6afef8f (patch) | |
tree | a4cad1e376c3f4c63ca7df8e5bc765687314aa72 /gcc/cp/constraint.cc | |
parent | 9125cf8c33b710c378bfb3c7e67ec2f9f1c523c9 (diff) | |
download | gcc-b871301f09be7061904dc87880919d30e6afef8f.zip gcc-b871301f09be7061904dc87880919d30e6afef8f.tar.gz gcc-b871301f09be7061904dc87880919d30e6afef8f.tar.bz2 |
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.
Diffstat (limited to 'gcc/cp/constraint.cc')
-rw-r--r-- | gcc/cp/constraint.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index e4aace5..48d52ec 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -840,6 +840,8 @@ get_normalized_constraints_from_decl (tree d, bool diag = false) if (tree *p = hash_map_safe_get (normalized_map, tmpl)) return *p; + push_nested_class_guard pncs (DECL_CONTEXT (d)); + tree args = generic_targs_for (tmpl); tree ci = get_constraints (decl); tree norm = get_normalized_constraints_from_info (ci, args, tmpl, diag); |