aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2020-09-25 14:44:07 +0100
committerGary Benson <gbenson@redhat.com>2020-09-25 14:44:07 +0100
commitc20c017b2cdd28aa93071151bb7e704541fde730 (patch)
tree719bb50a6c087c4e6091eca11e5b1028478f6005 /gdb/testsuite
parent68d654afdfcff840ebb3ae432ed72dca0521d670 (diff)
downloadgdb-c20c017b2cdd28aa93071151bb7e704541fde730.zip
gdb-c20c017b2cdd28aa93071151bb7e704541fde730.tar.gz
gdb-c20c017b2cdd28aa93071151bb7e704541fde730.tar.bz2
Fix gdb.base/infcall-nested-structs-c++.exp with Clang
gdb.base/infcall-nested-structs-c++.exp failed to build using Clang with many variations on the following error: gdb compile failed, /gdbtest/src/gdb/testsuite/gdb.base/infcall-nested-structs.c:207:46: warning: self-comparison always evaluates to true [-Wtautological-compare] This commit builds this testcase with -Wno-tautological-compare when using Clang, to avoid this failure. gdb/testsuite/ChangeLog: * gdb.base/infcall-nested-structs.exp.tcl: Add additional_flags=-Wno-tautological-compare for C++ tests when compiling using Clang.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl7
2 files changed, 13 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a19af88..2e35f6c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2020-09-25 Gary Benson <gbenson@redhat.com>
+ * gdb.base/infcall-nested-structs.exp.tcl: Add
+ additional_flags=-Wno-tautological-compare for C++
+ tests when compiling using Clang.
+
+2020-09-25 Gary Benson <gbenson@redhat.com>
+
* lib/gdb.exp (gdb_compile): Pass "-x c++" earlier, and only
for .c files.
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
index f740961..907abe7 100644
--- a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
@@ -33,6 +33,13 @@ if [support_complex_tests] {
lappend compile_flags "additional_flags=-Wno-psabi"
}
+if { $lang == "c++" && [test_compiler_info clang*] } {
+ # Clang rightly deduces that the static member tests are
+ # tautological comparisons, so we need to inhibit that
+ # particular warning in order to build.
+ lappend compile_flags "additional_flags=-Wno-tautological-compare"
+}
+
# Given N (0..25), return the corresponding alphabetic letter in upper
# case.