This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument



------- Comment #4 from bangerth at dealii dot org  2007-03-23 02:37 -------
Without wanting to be a distractor, but can variables of a type that
was declared in an anonymous namespace really have external linkage?
Think of the type being declared in a header file and one .cc file
has the variable declaration/definition and another one an extern
declaration for that variable. Do they refer to the same variable? I
don't think so -- they have the same name, but distinct types, so we
have an ODR violation.

IMHO, variables with a type that comes from an anonymous namespace
can but have internal linkage.
W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]