This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12291] regression in anonymous namespace variable name mangling
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Sep 2003 23:37:03 -0000
- Subject: [Bug c++/12291] regression in anonymous namespace variable name mangling
- References: <20030915201509.12291.phil.el@wanadoo.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12291
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-09-15 23:37:02
date| |
------- Additional Comments From bangerth at dealii dot org 2003-09-15 23:37 -------
A very odd failure, indeed. Consider the following code:
--------------------------
struct S {
int foo() const;
};
void bar(const S& s) { s.foo(); }
struct X {
int foo () const { return S().foo(); }
};
namespace { int option_array; }
--------------------------
Compiled with present mainline, I get the following result:
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c y.cc
g/x> nm y.o | grep option_array
00000000 B _ZN21_GLOBAL__N__Z3barRK1S12option_arrayE
There's indeed no trace of the filename in the mangled name. Now, comment
out the unrelated function bar():
-------------------------
struct S {
int foo() const;
};
//void bar(const S& s) { s.foo(); }
struct X {
int foo () const { return S().foo(); }
};
namespace { int option_array; }
---------------------------
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c y.cc
g/x> nm y.o | grep option_array
00000000 B _ZN33_GLOBAL__N_y.cc_FCBB6B6F_09E9D69B12option_arrayE
Ups -- the filename is back. What's going on here?
I can see this behavior going all the way back to gcc2.95, so this
is not a recent regression.
W.