old-cross-binutils/gdb/testsuite/gdb.cp/shadow.cc
Sami Wagiaalla 13387711b2 2010-03-15 Sami Wagiaalla <swagiaal@redhat.com>
PR c++/7936:
        * cp-support.h: Added char *declaration element to using_direct
        data struct.
        (cp_add_using): Added char *declaration argument.
        (cp_add_using_directive): Ditto.
        (cp_lookup_symbol_imports): made extern.
        * cp-namespace.c: Updated with the above changes.
        * dwarf2read.c (read_import_statement): Ditto.
        (read_namespace): Ditto.
        (read_import_statement): Support import declarations.
        * cp-namespace.c (cp_lookup_symbol_imports): Check for imported
        declarations.
        Added support for 'declaration_only' search.
        (cp_lookup_symbol_namespace): Attempt to search for the name as
        is before consideration of imports.
        * symtab.c (lookup_symbol_aux_local): Added a 'declaration_only'
        search at every block level search.
        Now takes language argument.
        (lookup_symbol_aux): Updated.

    2010-03-15  Sami Wagiaalla  <swagiaal@redhat.com>

        * gdb.cp/shadow.exp: Removed kfail; test has been fix.
        * gdb.cp/nsusing.exp: Ditto.
2010-03-15 17:29:36 +00:00

47 lines
528 B
C++

namespace A
{
int x = 11;
}
int x = 22;
int y = 0;
class B
{
public:
int x;
int
func()
{
x = 33;
y++; // marker1
{
int x = 44;
y++; // marker2
{
int x = 55;
y++; // marker3
{
using namespace A;
y++; // marker4
{
using A::x;
y++; // marker5
}
}
}
}
}
};
int
main()
{
B theB;
return theB.func();
}