This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33786] New: "C" data and static const data members mangled the same
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Oct 2007 18:24:35 -0000
- Subject: [Bug c++/33786] New: "C" data and static const data members mangled the same
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When compiled with gcc 4.1.0 on Linux, the program below causes the assembler
to issue an error complaining about foobar being defined twice. I believe the
program is well-formed and should compile and run successfully to completion
(it does with Intel C++ 10.0 on Linux).
$ cat x.cpp && gcc -dumpversion && gcc x.cpp
namespace N {
extern "C" {
extern const int foobar;
const int foobar = 1;
struct S { static const int foobar; };
const int S::foobar = 2;
}
}
int main () { return !(N::foobar + 1 == N::S::foobar); }
4.1.0
/tmp/ccL0oF3c.s: Assembler messages:
/tmp/ccL0oF3c.s:29: Error: symbol `foobar' is already defined
--
Summary: "C" data and static const data members mangled the same
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sebor at roguewave dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33786