aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2021-07-02 13:54:57 -0400
committerPatrick Palka <ppalka@redhat.com>2021-07-02 13:54:57 -0400
commite3528ce197f8886869f95e8a8f901861a319851c (patch)
tree052326ad1c396e980b2467d1c88408ee9904ff98 /gcc/c/c-parser.c
parent42a9e4e1381ba14d8ef21b331494945c2f51e6be (diff)
downloadgcc-e3528ce197f8886869f95e8a8f901861a319851c.zip
gcc-e3528ce197f8886869f95e8a8f901861a319851c.tar.gz
gcc-e3528ce197f8886869f95e8a8f901861a319851c.tar.bz2
c++: unqualified member template in constraint [PR101247]
Here any_template_parm_r is failing to mark the template parameters implicitly used by the unqualified use of 'd' inside the constraint because the code to do so assumes each level of a template parameter list points to the corresponding primary template, but here the parameter level for A in the out-of-line definition of A::B does not (nor do the parameter levels for A and C in the definition of A::C), which causes us to overlook the sharing. So it seems we can't in general depend on the TREE_TYPE of a template parameter level being non-empty here. This patch partially fixes this by rewriting the relevant part of any_template_parm_r to not depend on the TREE_TYPE of outer levels. We still depend on the innermost level to point to the innermost primary template, so we still crash on the commented out line in the below testcase. PR c++/101247 gcc/cp/ChangeLog: * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to use common_enclosing_class and to not depend on the TREE_TYPE of outer levels pointing to the corresponding primary template. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-memtmpl4.C: New test.
Diffstat (limited to 'gcc/c/c-parser.c')
0 files changed, 0 insertions, 0 deletions