public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33786] New: "C" data and static const data members mangled the same
@ 2007-10-15 18:24 sebor at roguewave dot com
2007-10-15 18:31 ` [Bug c++/33786] " pinskia at gcc dot gnu dot org
2008-01-13 8:33 ` bangerth at dealii dot org
0 siblings, 2 replies; 3+ messages in thread
From: sebor at roguewave dot com @ 2007-10-15 18:24 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/33786] "C" data and static const data members mangled the same
2007-10-15 18:24 [Bug c++/33786] New: "C" data and static const data members mangled the same sebor at roguewave dot com
@ 2007-10-15 18:31 ` pinskia at gcc dot gnu dot org
2008-01-13 8:33 ` bangerth at dealii dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-15 18:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-10-15 18:31 -------
On the trunk, I get the following error:
t.cc:5: error: previous declaration of 'const int N::S::foobar' with 'C++'
linkage
t.cc:6: error: conflicts with new declaration with 'C' linkage
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33786
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/33786] "C" data and static const data members mangled the same
2007-10-15 18:24 [Bug c++/33786] New: "C" data and static const data members mangled the same sebor at roguewave dot com
2007-10-15 18:31 ` [Bug c++/33786] " pinskia at gcc dot gnu dot org
@ 2008-01-13 8:33 ` bangerth at dealii dot org
1 sibling, 0 replies; 3+ messages in thread
From: bangerth at dealii dot org @ 2008-01-13 8:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from bangerth at dealii dot org 2008-01-13 03:12 -------
So fixed. This is the error message one would expect.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33786
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-13 3:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-15 18:24 [Bug c++/33786] New: "C" data and static const data members mangled the same sebor at roguewave dot com
2007-10-15 18:31 ` [Bug c++/33786] " pinskia at gcc dot gnu dot org
2008-01-13 8:33 ` bangerth at dealii 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).