diff options
author | Patrick Palka <ppalka@redhat.com> | 2021-03-06 00:07:43 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2021-03-06 00:07:43 -0500 |
commit | 574e7601829733d7cae20b5dc7034b876cc76b30 (patch) | |
tree | cd847fdecefd1d73301ec2d4edaffea8b592f698 /libgcc/libgcov.h | |
parent | b49d23f3e238c08bdbc5b892b2ed0a57b5f5caf9 (diff) | |
download | gcc-574e7601829733d7cae20b5dc7034b876cc76b30.zip gcc-574e7601829733d7cae20b5dc7034b876cc76b30.tar.gz gcc-574e7601829733d7cae20b5dc7034b876cc76b30.tar.bz2 |
c++: Fix tsubsting member variable template-id [PR96330]
This makes tsubst_copy appropriately handle a variable template-id, which
in turn fixes tsubsting a COMPONENT_REF whose member operand is known at
parse time to be a variable template-id, as in the initialization of 'x'
in the first testcase. Previously, we rejected this testcase with the
error "foo_t::bar<T> is not a function template", issued from
lookup_template_fuction.
We were already properly handling the analagous case where the object
operand of the COMPONENT_REF is dependent (and so the member operand is
a dependent template name), but there doesn't seems to be existing test
coverage for this, hence the second testcase below.
gcc/cp/ChangeLog:
PR c++/96330
* pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
variable 'fn' to 'tmpl'. Handle a variable template-id by
calling lookup_template_variable.
gcc/testsuite/ChangeLog:
PR c++/96330
* g++.dg/cpp1y/var-templ68.C: New test.
* g++.dg/cpp1y/var-templ68a.C: New test.
Co-authored-by: Jakub Jelinek <jakub@redhat.com>
Diffstat (limited to 'libgcc/libgcov.h')
0 files changed, 0 insertions, 0 deletions