aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-manip.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-08-06 02:40:10 -0400
committerJason Merrill <jason@redhat.com>2020-08-18 16:20:08 -0400
commit9125cf8c33b710c378bfb3c7e67ec2f9f1c523c9 (patch)
tree5204a73a439256bc622a2d8ec0b53d2d4e7ea36f /gcc/tree-ssa-loop-manip.c
parent3c04bd60e56da399a441f73ebb687b5039b9cf3f (diff)
downloadgcc-9125cf8c33b710c378bfb3c7e67ec2f9f1c523c9.zip
gcc-9125cf8c33b710c378bfb3c7e67ec2f9f1c523c9.tar.gz
gcc-9125cf8c33b710c378bfb3c7e67ec2f9f1c523c9.tar.bz2
c++: Handle enumerator in C++20 alias CTAD. [PR96199]
To form a deduction guide for an alias template, we substitute the template arguments from the pattern into the deduction guide for the underlying class. In the case of B(A1<X>), that produces B(A1<B<T,1>::X>) -> B<T,1>. But since an enumerator doesn't have its own template info, and B<T,1> is a dependent scope, trying to look up B<T,1>::X fails and we crash. So we need to produce a SCOPE_REF instead. And trying to use the members of the template class is wrong for other members, as well, as it gives a nonsensical result if the class is specialized. gcc/cp/ChangeLog: PR c++/96199 * pt.c (maybe_dependent_member_ref): New. (tsubst_copy) [CONST_DECL]: Use it. [VAR_DECL]: Likewise. (tsubst_aggr_type): Handle nested type. gcc/testsuite/ChangeLog: PR c++/96199 * g++.dg/cpp2a/class-deduction-alias4.C: New test.
Diffstat (limited to 'gcc/tree-ssa-loop-manip.c')
0 files changed, 0 insertions, 0 deletions