This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/11353] New: Still problems with namespaces
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jun 2003 16:05:26 -0000
- Subject: [Bug debug/11353] New: Still problems with namespaces
- 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=11353
Summary: Still problems with namespaces
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
First: support for namespaces has become much much better, many thanks
for that!
Second: something is still going wrong, though I don't know whether it's
in gcc or in gdb. Here's a small example:
----------------------------------
struct X {
virtual int f() { return 1; }
};
namespace A {
struct X {
virtual int f() { return 2;}
};
}
void stop_gdb() {}
int main () {
X x;
A::X a_x;
stop_gdb();
}
------------------------------
Compiled with a recent CSV snapshot of gcc (2003-05-20), then going
into gdb yields this:
tmp/gg> c++ -ggdb x.cc
tmp/gg> gdb a.out
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) b main
Breakpoint 1 at 0x80485c6: file x.cc, line 14.
(gdb) r
Starting program: /homes/csm2/bangerth/tmp/gg/a.out
Breakpoint 1, main () at x.cc:14
14 X x;
(gdb) n
15 A::X a_x;
(gdb)
16 stop_gdb();
(gdb) p x.f()
$1 = 1
(gdb) p a_x.f()
warning: can't find class named `A::X', as given by C++ RTTI
$2 = 2
Note that the result returned is quite right. It's just the warning that's
confusing me, and in particular that no similar warning is given for ::X.
Maybe someone can make sense out of this.
Thanks
W.