diff options
Diffstat (limited to 'gdb/testsuite/gdb.cp/userdef.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/userdef.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.cp/userdef.cc b/gdb/testsuite/gdb.cp/userdef.cc index 0ed81dc6af3..4f2817216fb 100644 --- a/gdb/testsuite/gdb.cp/userdef.cc +++ b/gdb/testsuite/gdb.cp/userdef.cc @@ -1,6 +1,6 @@ /* This test script is part of GDB, the GNU debugger. - Copyright 1999, 2002, 2003, 2004, 2005 + Copyright 1999, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -306,12 +306,31 @@ A2 A2::operator+() return A2 (); } +class Member +{ +public: + int z; +}; + +class Container +{ +public: + Member m; + + Member& operator* (); +}; + +Member& Container::operator* () +{ + return this->m; +} int main (void) { A1 one(2,3); A1 two(4,5); A1 three(0,0); + Container c; int val; marker1(); // marker1-returns-here @@ -379,6 +398,8 @@ int main (void) ++three; cout << "preinc " << three; + (*c).z = 1; + return 0; } |