public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31903]  New: unwanted anonymous namespacing linkage
@ 2007-05-11 21:15 mrs at apple dot com
  2007-05-11 21:20 ` [Bug target/31903] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mrs at apple dot com @ 2007-05-11 21:15 UTC (permalink / raw)
  To: gcc-bugs

It appears that 4.2 isn't making anonymous namespace variables unique (it's
also making them global). This is preventing LLVM from compiling with the 4.2
compiler.

$ cat foo.cpp
#include <typeinfo>

namespace {
  class foo {
   virtual void bar();
  };
}

void foo::bar() {}

#ifdef FOO
const std::type_info &X = typeid(foo);
#else
const std::type_info &Y = typeid(foo);
#endif

extern const std::type_info &X;

#ifndef FOO
int main() {}
#endif

$ g++-4.2 foo.cpp -c -o a.o
$ g++-4.2 foo.cpp -c -o b.o -DFOO
$ g++-4.2 a.o b.o
ld64-73.6 failed: duplicate symbol typeinfo for (anonymous namespace)::fooin
b.o and a.o


-- 
           Summary: unwanted anonymous namespacing linkage
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrs at apple dot com
GCC target triplet: i686-apple-darwin9


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-06-14 21:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-11 21:15 [Bug c++/31903] New: unwanted anonymous namespacing linkage mrs at apple dot com
2007-05-11 21:20 ` [Bug target/31903] " pinskia at gcc dot gnu dot org
2007-05-11 21:25 ` pinskia at gcc dot gnu dot org
2007-05-11 21:45 ` mrs at apple dot com
2007-05-11 21:55 ` pinskia at gcc dot gnu dot org
2007-05-11 23:01 ` mrs at apple dot com
2007-05-12  0:00 ` sabre at nondot dot org
2007-05-12 13:16 ` pinskia at gcc dot gnu dot org
2007-05-12 13:31 ` [Bug c++/31903] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-05-13 22:18 ` geoffk at gcc dot gnu dot org
2007-06-13 22:31 ` [Bug c++/31903] [4.3 Regression] typeinfo of classes in anon namespace isn't being marked static geoffk at gcc dot gnu dot org
2007-06-14 21:11 ` geoffk at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).