public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2298: imported namespace variables not visible
@ 2007-08-11 22:48 franke.daniel
0 siblings, 0 replies; only message in thread
From: franke.daniel @ 2007-08-11 22:48 UTC (permalink / raw)
To: gdb-gnats
>Number: 2298
>Category: c++
>Synopsis: imported namespace variables not visible
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Aug 11 22:48:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator: franke.daniel@gmail.com
>Release: gdb-6.6
>Organization:
>Environment:
>Description:
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
>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
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-11 22:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-11 22:48 c++/2298: imported namespace variables not visible franke.daniel
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).