27aa8d6aa0
* dwarf2read.c (process_die): Handle import statements (DW_TAG_imported_declaration, case DW_TAG_imported_module) (read_import_statement): New. (read_func_scope): Update using_directives to point to current context (read_lexical_block_scope): Ditto. * cp-support.h: Added prototype for cp_add_using. * cp-namespace.c: Removed local context_stack. (cp_initialize_namespace): Deleted. (cp_finalize_namespace): Deleted. (cp_add_using_directive): Use using_directives instead of using_list. (cp_add_using): No longer static. * buildsym.h: Created global using_direct variable. Created using_direct variable in context_stack. * buildsym.c (finish_block): Set using directives for the block under construction. (start_symtab): Removed call to cp_initialize_namespace(). (end_symtab): Removed call to cp_finalize_namespace(). (push_context): Save and reset using_directives. * block.c (block_using): Return using directives for given block instead of static block. 2009-06-23 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/namespace-using.exp: New test. * gdb.cp/namespace-using.cc: New test.
45 lines
476 B
C++
45 lines
476 B
C++
namespace A
|
|
{
|
|
int _a = 1;
|
|
int x = 2;
|
|
}
|
|
|
|
int marker4(){
|
|
using A::x;
|
|
return 0;
|
|
}
|
|
|
|
int marker3(){
|
|
return marker4();
|
|
}
|
|
|
|
int marker2()
|
|
{
|
|
namespace B = A;
|
|
B::_a;
|
|
return marker3();
|
|
}
|
|
|
|
int marker1()
|
|
{
|
|
int total = 0;
|
|
{
|
|
int b = 1;
|
|
{
|
|
using namespace A;
|
|
int c = 2;
|
|
{
|
|
int d = 3;
|
|
total = _a + b + c + d + marker2(); // marker1 stop
|
|
}
|
|
}
|
|
}
|
|
return total;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
using namespace A;
|
|
_a;
|
|
return marker1();
|
|
}
|