This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2007 02:37:08 -0000
- Subject: [Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
- References: <bug-31187-1827@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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