diff options
Diffstat (limited to 'gdb/testsuite/gdb.cp/namespace-using.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/namespace-using.cc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/namespace-using.cc b/gdb/testsuite/gdb.cp/namespace-using.cc new file mode 100644 index 0000000..4786fd5 --- /dev/null +++ b/gdb/testsuite/gdb.cp/namespace-using.cc @@ -0,0 +1,45 @@ +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(); +} |