https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99066
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:bd89b8fe9efbdf0a95d827553d1a84fd3cefaa16 commit r11-7986-gbd89b8fe9efbdf0a95d827553d1a84fd3cefaa16 Author: Jason Merrill <ja...@redhat.com> Date: Sun Apr 4 23:32:32 2021 -0400 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.