aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/nsrecurs.cc
diff options
context:
space:
mode:
authorSami Wagiaalla <swagiaal@redhat.com>2010-01-26 16:47:35 +0000
committerSami Wagiaalla <swagiaal@redhat.com>2010-01-26 16:47:35 +0000
commitb14e635ec430d1a84fa9061bcd404ef76cf5bf11 (patch)
tree25a1e65300e85c1c2cd240f393c248117c083de4 /gdb/testsuite/gdb.cp/nsrecurs.cc
parent8540c487c665cd07366b3d1fa199af33fa5b3691 (diff)
downloadgdb-b14e635ec430d1a84fa9061bcd404ef76cf5bf11.zip
gdb-b14e635ec430d1a84fa9061bcd404ef76cf5bf11.tar.gz
gdb-b14e635ec430d1a84fa9061bcd404ef76cf5bf11.tar.bz2
2010-01-14 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/nsrecurs.exp: New test. * gdb.cp/nsrecurs.cc: New test program. * gdb.cp/nsstress.exp: New test. * gdb.cp/nsstress.cc: New test program. * gdb.cp/nsdecl.exp: New test. * gdb.cp/nsdecl.cc: New test program. 2010-01-26 Sami Wagiaalla <swagiaal@redhat.com> * cp-namespace.c (cp_lookup_symbol_namespace): Added search_parent argument. (cp_add_using): Initialize 'searched' field. (reset_directive_searched): New function. * cp-support.h: Add 'searched' field to using_direct struct. (cp_lookup_symbol_imports): Ditto. * cp-namespace.c (cp_lookup_symbol_imports): Ditto. Perform recursive search. Implement non parent search. * valops.c (value_maybe_namespace_elt): Updated.
Diffstat (limited to 'gdb/testsuite/gdb.cp/nsrecurs.cc')
-rw-r--r--gdb/testsuite/gdb.cp/nsrecurs.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/nsrecurs.cc b/gdb/testsuite/gdb.cp/nsrecurs.cc
new file mode 100644
index 0000000..84605a6
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/nsrecurs.cc
@@ -0,0 +1,30 @@
+namespace A{
+ int ax = 9;
+}
+
+namespace B{
+ using namespace A;
+}
+
+namespace C{
+ using namespace B;
+}
+
+//---------------
+namespace D{
+ using namespace D;
+ int dx = 99;
+}
+using namespace C;
+
+//---------------
+namespace{
+ namespace{
+ int xx = 999;
+ }
+}
+
+int main(){
+ using namespace D;
+ return ax + dx + xx;
+}