https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643
--- Comment #6 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:abc79c6498a99e9c39e6056f432796c6dde3a887 commit r10-6628-gabc79c6498a99e9c39e6056f432796c6dde3a887 Author: Jason Merrill <ja...@redhat.com> Date: Thu Feb 13 16:42:04 2020 +0100 c++: Fix static local vars in extern "C". Since my patch for PR 91476 moved visibility determination sooner, a local static in a vague linkage function now gets TREE_PUBLIC set before retrofit_lang_decl calls set_decl_linkage, which was making decl_linkage think that it has external linkage. It still has no linkage according to the standard. gcc/cp/ChangeLog 2020-02-13 Jason Merrill <ja...@redhat.com> PR c++/93643 PR c++/91476 * tree.c (decl_linkage): Always lk_none for locals.