diff options
Diffstat (limited to 'gdb/testsuite/gdb.cp/pr-1553.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/pr-1553.cc | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/pr-1553.cc b/gdb/testsuite/gdb.cp/pr-1553.cc new file mode 100644 index 00000000000..58441fdb80f --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr-1553.cc @@ -0,0 +1,53 @@ +class A { +public: + class B; + class C; +}; + +class A::B { + int a_b; + +public: + C* get_c(int i); +}; + +class A::C +{ + int a_c; +}; + +class E { +public: + class F; +}; + +class E::F { +public: + int e_f; + + F& operator=(const F &other); +}; + +void refer_to (E::F *f) { + // Do nothing. +} + +void refer_to (A::C **ref) { + // Do nothing. But, while we're at it, force out debug info for + // A::B and E::F. + + A::B b; + E::F f; + + refer_to (&f); +} + +int main () { + A::C* c_var; + A::B* b_var; + E *e_var; + + // Keep around a reference so that GCC 3.4 doesn't optimize the variable + // away. + refer_to (&c_var); +} |