From f106e10e5e80265e1c43532bba4cb997a7dfa022 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Wed, 29 Nov 2017 10:45:31 +0000 Subject: [PATCH] [gdb/testsuite] Fix wrong return type in tests The following tests are marked untested with latest GCC due to a warning being emitted for a mismatch between their return type and what the lack of return statement: * gdb.cp/breakpoint.exp * gdb.cp/psymtab-parameter.exp * gdb.cp/shadow.exp This patch fix the return type to match the function definitions. 2017-11-29 Thomas Preud'homme gdb/testsuite/ * gdb.cp/breakpoint.cc (bar): Set return type to void. * gdb.cp/psymtab-parameter.cc (func): Likewise. * gdb.cp/psymtab-parameter.exp: Update comment regarding prototype of func (). * gdb.cp/shadow.cc (B.func): Return 0. --- gdb/testsuite/ChangeLog | 8 ++++++++ gdb/testsuite/gdb.cp/breakpoint.cc | 2 +- gdb/testsuite/gdb.cp/psymtab-parameter.cc | 2 +- gdb/testsuite/gdb.cp/psymtab-parameter.exp | 2 +- gdb/testsuite/gdb.cp/shadow.cc | 1 + 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 16c93dca78..23d3cc2783 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2017-11-29 Thomas Preud'homme + + * gdb.cp/breakpoint.cc (bar): Set return type to void. + * gdb.cp/psymtab-parameter.cc (func): Likewise. + * gdb.cp/psymtab-parameter.exp: Update comment regarding prototype of + func (). + * gdb.cp/shadow.cc (B.func): Return 0. + 2017-11-27 Joel Brobecker * gdb.ada/mi_catch_ex.exp (continue_to_exception): Adjust diff --git a/gdb/testsuite/gdb.cp/breakpoint.cc b/gdb/testsuite/gdb.cp/breakpoint.cc index fc9b9d9f3e..1feff44cd3 100644 --- a/gdb/testsuite/gdb.cp/breakpoint.cc +++ b/gdb/testsuite/gdb.cp/breakpoint.cc @@ -28,7 +28,7 @@ public: return 1; // conditional breakpoint in method } - int bar () + void bar () { for (int i = 0; i < 1; ++i) { diff --git a/gdb/testsuite/gdb.cp/psymtab-parameter.cc b/gdb/testsuite/gdb.cp/psymtab-parameter.cc index 0990430c12..9f63fefcae 100644 --- a/gdb/testsuite/gdb.cp/psymtab-parameter.cc +++ b/gdb/testsuite/gdb.cp/psymtab-parameter.cc @@ -16,7 +16,7 @@ along with this program. If not, see . */ template -long +void func () { } diff --git a/gdb/testsuite/gdb.cp/psymtab-parameter.exp b/gdb/testsuite/gdb.cp/psymtab-parameter.exp index 3d78de91f4..5c4b6ac719 100644 --- a/gdb/testsuite/gdb.cp/psymtab-parameter.exp +++ b/gdb/testsuite/gdb.cp/psymtab-parameter.exp @@ -31,6 +31,6 @@ gdb_test_no_output "set language c++" # XFAIL than FAIL here. For example -readnow breaks it. gdb_test_no_output "maintenance info symtabs" -# GDB has shown only the `long func()' ELF symbol before, not the DWARF +# GDB has shown only the `void func()' ELF symbol before, not the DWARF # symbol gdb_test "complete p 'func(" "p 'func\\(\\)" diff --git a/gdb/testsuite/gdb.cp/shadow.cc b/gdb/testsuite/gdb.cp/shadow.cc index 0520b2aeb8..4c9fb12a7b 100644 --- a/gdb/testsuite/gdb.cp/shadow.cc +++ b/gdb/testsuite/gdb.cp/shadow.cc @@ -36,6 +36,7 @@ public: } } } + return 0; } };