[Bug c++/91476] [9/10 Regression] const reference variables sharing the same name in two anonymous namespaces cause a multiple definition error

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 13 21:33:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91476

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:abc79c6498a99e9c39e6056f432796c6dde3a887

commit r10-6628-gabc79c6498a99e9c39e6056f432796c6dde3a887
Author: Jason Merrill <jason@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  <jason@redhat.com>

        PR c++/93643
        PR c++/91476
        * tree.c (decl_linkage): Always lk_none for locals.


More information about the Gcc-bugs mailing list