+2020-05-29 Gary Benson <gbenson@redhat.com>
+
+ * gdb.compile/compile-cplus.exp (additional_flags): Also
+ set when building with clang.
+ (additional_flags, srcfilesoptions): Pass -Wno-deprecated
+ when building with clang.
+
2020-05-29 Gary Benson <gbenson@redhat.com>
* gdb.arch/i386-avx.exp (additional_flags): Also set when
get_compiler_info
set options {}
-if [test_compiler_info gcc*] {
+if { [test_compiler_info gcc*] || [test_compiler_info clang*] } {
lappend options additional_flags=-g3
lappend options additional_flags=-std=gnu++11
lappend options c++
}
+if [test_compiler_info clang*] {
+ # Treating C input as C++ is deprecated in Clang, so
+ # the build will fail without disabling -Wdeprecated.
+ lappend options additional_flags=-Wno-deprecated
+}
if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
verbose "Skipping x86_64 LOC_CONST test."
if { $srcfile3 != "" } {
lappend srcfilesoptions $srcfile3 ${options}
}
-lappend srcfilesoptions $srcfile4 "nodebug c++"
+set srcfile4options "nodebug c++"
+if [test_compiler_info clang*] {
+ # Treating C input as C++ is deprecated in Clang, so
+ # the build will fail without disabling -Wdeprecated.
+ set srcfile4options "$srcfile4options additional_flags=-Wno-deprecated"
+}
+lappend srcfilesoptions $srcfile4 $srcfile4options
if { [eval build_executable_from_specs ${testfile}.exp $testfile {$options} ${srcfilesoptions}] } {
return -1
}