aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2020-01-29 12:02:14 -0500
committerMarek Polacek <polacek@redhat.com>2020-01-29 14:14:40 -0500
commite3b60da8e07030b1417067295f047b25015f21f2 (patch)
tree6c497a22156de30d0464486756e4fe5c5fcf9673 /gcc/go
parent423284053ec51832bc4c823fb90dc41e632e37ac (diff)
downloadgcc-e3b60da8e07030b1417067295f047b25015f21f2.zip
gcc-e3b60da8e07030b1417067295f047b25015f21f2.tar.gz
gcc-e3b60da8e07030b1417067295f047b25015f21f2.tar.bz2
c++: Fix template arguments comparison with class NTTP [PR91754]
Here we fail to compile the attached test, stating that the use of T<s> in T<s>::T() {} is "invalid use of incomplete type". It is a function definition so grokdeclarator checks that the qualifying type is complete. When we parsed the class T, finish_struct gave the class a non-null TYPE_SIZE, making it COMPLETE_TYPE_P. But then we're parsing T<s>, a TEMPLATE_ID, in T<s>::T() {} so try to lookup_template_class T. This failed because we couldn't find such a class: comp_template_args told us that the argument lists don't match, because one of the args was wrapped in a VIEW_CONVERT_EXPR to make it look const. It seems to me that we should see through these artificial wrappers and consider the args same. 2020-01-29 Marek Polacek <polacek@redhat.com> PR c++/91754 - Fix template arguments comparison with class NTTP. * pt.c (class_nttp_const_wrapper_p): New. (template_args_equal): See through class_nttp_const_wrapper_p arguments. * g++.dg/cpp2a/nontype-class30.C: New test.
Diffstat (limited to 'gcc/go')
0 files changed, 0 insertions, 0 deletions