aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/m-static.cc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-03-13 00:27:12 +0000
committerTom Tromey <tromey@redhat.com>2010-03-13 00:27:12 +0000
commit1c809c688364f87ba62a4c590b53d1efe0cff64e (patch)
tree6be478308b2c32a2c2bba5ca5b28dbd14b16f6fc /gdb/testsuite/gdb.cp/m-static.cc
parente0ce539c578586fd2f9c54b703335fa064e42a22 (diff)
downloadgdb-1c809c688364f87ba62a4c590b53d1efe0cff64e.zip
gdb-1c809c688364f87ba62a4c590b53d1efe0cff64e.tar.gz
gdb-1c809c688364f87ba62a4c590b53d1efe0cff64e.tar.bz2
gdb
PR c++/9708: * dwarf2read.c (die_needs_namespace) <DW_TAG_variable>: A variable in a lexical block does not need a namespace. (new_symbol) <DW_TAG_variable>: Put extern variables on list_in_scope in all cases. gdb/testsuite PR c++/9708: * gdb.cp/m-static.exp: Add regression test. * gdb.cp/m-static.cc (method): New method. (main): Call it.
Diffstat (limited to 'gdb/testsuite/gdb.cp/m-static.cc')
-rw-r--r--gdb/testsuite/gdb.cp/m-static.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.cp/m-static.cc b/gdb/testsuite/gdb.cp/m-static.cc
index 2a0b61c..7f997ef 100644
--- a/gdb/testsuite/gdb.cp/m-static.cc
+++ b/gdb/testsuite/gdb.cp/m-static.cc
@@ -15,6 +15,12 @@ protected:
public:
gnu_obj_1(antiquities a, long l) {}
+
+ long method ()
+ {
+ static bool svar = true;
+ return key2;
+ }
};
const bool gnu_obj_1::test;
@@ -70,5 +76,8 @@ int main()
test4.dummy = test4.elsewhere;
test4.dummy = 0;
- return test4.dummy; // breakpoint: constructs-done
+
+ test1.method (); // breakpoint: constructs-done
+
+ return test4.dummy;
}