diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-10-20 14:13:10 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-10-20 14:13:10 -0400 |
commit | 14272aec22dcacbb3b937d6c5b86794faaa24620 (patch) | |
tree | 80570cdfc04695bc11f437ce0c264839a0235519 /gcc/c-family/c-semantics.c | |
parent | 1d561e1851c466a4952081caef17747781609b00 (diff) | |
download | gcc-14272aec22dcacbb3b937d6c5b86794faaa24620.zip gcc-14272aec22dcacbb3b937d6c5b86794faaa24620.tar.gz gcc-14272aec22dcacbb3b937d6c5b86794faaa24620.tar.bz2 |
c++: constraint matching, TEMPLATE_ID_EXPR, current inst
Here we're crashing during constraint matching for the instantiated
hidden friends due to two issues with dependent substitution into a
TEMPLATE_ID_EXPR that names a template from the current instantiation
(as for C<1> with T=T from maybe_substitute_reqs_for):
* tsubst_copy substitutes into such a TEMPLATE_DECL by looking it up
from the substituted class scope. But for this lookup to work when
the args are dependent, we need to substitute the class scope with
entering_scope=true so that we obtain the primary template type
A<T> (which has TYPE_BINFO) instead of the implicit instantiation
A<T> (which doesn't).
* lookup_and_finish_template_variable shouldn't instantiate a
TEMPLATE_ID_EXPR that names a TEMPLATE_DECL which has more than
one level of (unsubstituted) parameters (such as A<T>::C).
gcc/cp/ChangeLog:
* pt.cc (lookup_and_finish_template_variable): Don't
instantiate if the template's scope is dependent.
(tsubst_copy) <case TEMPLATE_DECL>: Pass entering_scope=true
when substituting the class scope.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-friend10.C: New test.
Diffstat (limited to 'gcc/c-family/c-semantics.c')
0 files changed, 0 insertions, 0 deletions