diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-08-11 13:25:58 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-08-11 13:25:58 -0400 |
commit | ca2676654736e6b0bd1ba88edf5694df43718cd9 (patch) | |
tree | 114b27172aa359191eac56a72d2248d5f7a50836 /gcc/analyzer/sm-malloc.cc | |
parent | 9e33d71834416b7eddadae2b0f68e85f04cd0c7f (diff) | |
download | gcc-ca2676654736e6b0bd1ba88edf5694df43718cd9.zip gcc-ca2676654736e6b0bd1ba88edf5694df43718cd9.tar.gz gcc-ca2676654736e6b0bd1ba88edf5694df43718cd9.tar.bz2 |
c++: recognize in-class var tmpl partial spec [PR71954]
This makes us recognize member variable template partial specializations
defined directly inside the class body. It seems we mainly just need to
call check_explicit_specialization when we see a static TEMPLATE_ID_EXPR
data member, which sets SET_DECL_TEMPLATE_SPECIALIZATION for us and which
we otherwise don't call (for the out-of-class case we call it from
grokvardecl).
We also need to make finish_member_template_decl return NULL_TREE for
such partial specializations, matching its behavior for class template
partial specializations, so that later we don't try to register it as a
separate member declaration.
PR c++/71954
gcc/cp/ChangeLog:
* decl.cc (grokdeclarator): Pass 'dname' instead of
'unqualified_id' as the name when building the VAR_DECL for a
static data member. Call check_explicit_specialization for a
TEMPLATE_ID_EXPR such member.
* pt.cc (finish_member_template_decl): Return NULL_TREE
instead of 'decl' when DECL_TEMPLATE_SPECIALIZATION is not
set.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1y/var-templ84.C: New test.
* g++.dg/cpp1y/var-templ84a.C: New test.
Diffstat (limited to 'gcc/analyzer/sm-malloc.cc')
0 files changed, 0 insertions, 0 deletions