[Bug c++/10591] use ODR rules to make C++ objects not be TREE_PUBLIC

geoffk at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Mar 9 00:37:00 GMT 2006



------- Comment #14 from geoffk at gcc dot gnu dot org  2006-03-09 00:37 -------
This is the same original report as bug 25915, which then was generalised as
follows:

Any entity which could be defined more than once (like a class or an inline
function) but whose token stream refers to a function or variable which is not
TREE_PUBLIC, actually can't be defined more than once, and so every part of
such entity can be made not-TREE_PUBLIC.

Exception: if the object referred to is 'const', is of scalar type, is
initialized with a constant expression, and the value but not the address of
the object is used, it doesn't count.  For additional details, including
additional cases where this applies and an explanation of how it applies to
templates, see [basic.def.odr] paragraph 5.


-- 

geoffk at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Members of anonymous        |use ODR rules to make C++
                   |namespaces should not be    |objects not be TREE_PUBLIC
                   |TREE_PUBLIC                 |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10591



More information about the Gcc-bugs mailing list