[Converted from Gnats 2298] A variable imported from a namespace is not accessible as one would expect. While this the problem is easily circumvented in C++, it may be difficult to do with fortran. See [1] for problems to be fixed in the fortran-frontend of gcc before this might become an issue. [1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29635#c3 Release: gdb-6.6 How-To-Repeat: $> cat a.cpp #include <cstdio> namespace foo { int i = 42; } int main() { using foo::i; printf("%d\n", i); return 0; } $> g++ -g a.cpp $> gdb a.out GNU gdb 6.6 [...] This GDB was configured as "i686-pc-linux-gnu"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) break 10 Breakpoint 1 at 0x8048495: file a.cpp, line 10. (gdb) run Starting program: /home/daniel/pr/a.out Breakpoint 1, main () at a.cpp:10 10 printf("%d\n", i); (gdb) print i No symbol "i" in current context. (gdb) print foo::i $1 = 42
FWIW, this is fixed on the branch archer-keiths-expr-cumulative, in the archer repository. The relevant patches should be pushed into gdb cvs soon.
*** This bug has been marked as a duplicate of 7936 ***