Pass -Wno-deprecated-register for gdb.cp that use "register"

Clang fails to compile three testcases with the following error:
  warning: 'register' storage class specifier is deprecated and
    incompatible with C++17 [-Wdeprecated-register]

This prevents the following testcases from executing:
  gdb.cp/classes.exp
  gdb.cp/inherit.exp
  gdb.cp/misc.exp

This commit builds those testcases with -Wno-deprecated-register, to
avoid the failure.  Note that this commit reveals five "wrong access
specifier for typedef" failures in gdb.cp/classes.exp when compiling
the testsuite with clang.

gdb/testsuite/ChangeLog:

	* gdb.cp/classes.exp (prepare_for_testing): Add
	additional_flags=-Wno-deprecated-register.
	* gdb.cp/inherit.exp (prepare_for_testing): Likewise.
	* gdb.cp/misc.exp: Likewise.
This commit is contained in:
Gary Benson 2020-05-28 16:29:48 +01:00
parent f030440daa
commit 09fe663ed8
4 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2020-05-28 Gary Benson <gbenson@redhat.com>
* gdb.cp/classes.exp (prepare_for_testing): Add
additional_flags=-Wno-deprecated-register.
* gdb.cp/inherit.exp (prepare_for_testing): Likewise.
* gdb.cp/misc.exp: Likewise.
2020-05-28 Gary Benson <gbenson@redhat.com>
* gdb.linespec/cpls-ops.cc (dummy): New static global.

View File

@ -24,7 +24,8 @@ load_lib "cp-support.exp"
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-deprecated-register}]} {
return -1
}

View File

@ -26,7 +26,8 @@ load_lib "cp-support.exp"
standard_testfile misc.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-deprecated-register}]} {
return -1
}

View File

@ -19,7 +19,8 @@ if { [skip_cplus_tests] } { continue }
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-deprecated-register}]} {
return -1
}