Build two gdb.cp testcases with -Wno-unused-comparison
authorGary Benson <gbenson@redhat.com>
Fri, 29 May 2020 13:03:01 +0000 (14:03 +0100)
committerGary Benson <gbenson@redhat.com>
Fri, 29 May 2020 13:03:01 +0000 (14:03 +0100)
Clang fails to compile two testcases with the following error:
  warning: equality comparison result unused [-Wunused-comparison]

This prevents the following testcases from executing:
  gdb.cp/koenig.exp
  gdb.cp/operator.exp

This commit builds those testcases with -Wno-unused-comparison, to
avoid the failure.  Note that this commit reveals a new failure,
"FAIL: gdb.cp/koenig.exp: p foo (p_union)" when the testsuite is
compiled using clang.

gdb/testsuite/ChangeLog:

* gdb.cp/koenig.exp (prepare_for_testing): Add
additional_flags=-Wno-unused-comparison.
* gdb.cp/operator.exp (prepare_for_testing): Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/koenig.exp
gdb/testsuite/gdb.cp/operator.exp

index 2aa42cd75a359e24d7844a7b91d24b0a27570114..ed56c819cb094752d3d1b7387b8d8f765e002b9c 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-29  Gary Benson <gbenson@redhat.com>
+
+       * gdb.cp/koenig.exp (prepare_for_testing): Add
+       additional_flags=-Wno-unused-comparison.
+       * gdb.cp/operator.exp (prepare_for_testing): Likewise.
+
 2020-05-28  Gary Benson <gbenson@redhat.com>
 
        * gdb.base/sigaltstack.c (catcher): Add default case to switch
index b40ee43f7d006f3004cf68016a6d78b036eea109..25be2e5d6b0d858f5e91b0057ec9eacda89cddca 100644 (file)
@@ -15,7 +15,8 @@
 
 standard_testfile .cc
 
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
+      {debug c++ additional_flags=-Wno-unused-comparison}] } {
      return -1
 }
 
index c2d2bdf62822d7b7e0fcd2306aa5bb777a9b3eef..b48cd44ad49d933cbcc9d46444f691fcfb643dab 100644 (file)
@@ -15,7 +15,8 @@
 
 standard_testfile .cc
 
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
+         {debug c++ additional_flags=-Wno-unused-comparison}] } {
     return -1
 }