]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: extern template and static data member [PR99066]
authorJason Merrill <jason@redhat.com>
Mon, 5 Apr 2021 03:32:32 +0000 (23:32 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 13 May 2022 15:22:12 +0000 (11:22 -0400)
commit20b503f1125c0b0a7f4b2bb1214d4a3cc6fd9f70
treef753bf30e57e2d8b7bac15b105357095fa8c40d0
parenta86e0cadefe5a2469bb9872bb5b93017ccb23935
c++: extern template and static data member [PR99066]

'extern template' should mean that the relevant symbols are never emitted.
But in this case we were assuming that DECL_EXTERNAL was already set on the
variable, so we just needed to clear DECL_NOT_REALLY_EXTERN.  Since
DECL_EXTERNAL was not set, we emitted a definition of npos.

gcc/cp/ChangeLog:

PR c++/99066
* pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.

gcc/testsuite/ChangeLog:

PR c++/99066
* g++.dg/cpp0x/extern_template-6.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/extern_template-6.C [new file with mode: 0644]