diff options
author | Daniel Jacobowitz <dan@debian.org> | 2010-09-08 19:09:42 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2010-09-08 19:09:42 +0000 |
commit | b9bf903b95ab949bd703aea23f84cbd18e7bd2db (patch) | |
tree | dc4a860d932cd8d7ff06ce9934046087420adf68 /gdb/testsuite/gdb.cp | |
parent | 22c20a83d07c1603b4ee955f6c2a0f3d57bb4fcc (diff) | |
download | gdb-b9bf903b95ab949bd703aea23f84cbd18e7bd2db.tar.gz |
gdb/
* dwarf2read.c (read_structure_type): Move processing of
fields and member functions from here...
(process_structure_scope): ... to here.
gdb/testsuite/
* gdb.cp/templates.cc (Empty, FunctionArg): New classes.
(FunctionArg::method): New function.
(empty, arg): New variables.
(main): Call arg.method.
* gdb.cp/templates.exp (test_template_args): New function.
(do_tests): Call it.
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r-- | gdb/testsuite/gdb.cp/templates.cc | 32 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/templates.exp | 11 |
2 files changed, 30 insertions, 13 deletions
diff --git a/gdb/testsuite/gdb.cp/templates.cc b/gdb/testsuite/gdb.cp/templates.cc index 783bc2ccd12..b5e0643af1c 100644 --- a/gdb/testsuite/gdb.cp/templates.cc +++ b/gdb/testsuite/gdb.cp/templates.cc @@ -712,6 +712,23 @@ template<class T> T Garply<T>::garply (int i, T tt) } } +template<class C> class Empty +{ +}; + +template<class C> class FunctionArg +{ +public: + int method(Empty<void (FunctionArg<C>)> &); +}; + +template<class C> int FunctionArg<C>::method(Empty<void (FunctionArg<C>)> &arg) +{ + return 75; +} + +Empty<void(FunctionArg<int>)> empty; +FunctionArg<int> arg; int main() { @@ -785,18 +802,7 @@ int main() t5i.value(); + arg.method(empty); + return 0; } - - - - - - - - - - - - - diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 33cccc17cb5..c5313070e0e 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -196,6 +196,16 @@ proc test_template_typedef {} { "print destructor of template typedef" } +proc test_template_args {} { + + set empty_re "Empty *<void *\\(FunctionArg *<int>\\)>" + gdb_test "ptype empty" \ + "type = class $empty_re {.*<no data fields>.*}" + + gdb_test "ptype arg" \ + "type = class FunctionArg<int> {.*int method\\($empty_re \\&\\);.*}" +} + proc do_tests {} { global subdir global objdir @@ -220,6 +230,7 @@ proc do_tests {} { test_ptype_of_templates test_template_breakpoints test_template_typedef + test_template_args if [ runto_main] { test_template_calls |