]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix build errors in with clang in gdb.compile/compile-cplus.c
authorGary Benson <gbenson@redhat.com>
Fri, 29 May 2020 16:43:17 +0000 (17:43 +0100)
committerGary Benson <gbenson@redhat.com>
Fri, 29 May 2020 16:43:17 +0000 (17:43 +0100)
commit678048e8079ace915052f3070b2df97bcaea58d2
treee4e005b57942b3c9db2ba8502a8b9b2ac896908e
parent9fcafd23fa6d919f112e9a7f73e72895c2457de1
Fix build errors in with clang in gdb.compile/compile-cplus.c

Clang fails to compile the file, with the following error:
  fatal error: 'iostream' file not found

This prevents the following testcase from executing:
  gdb.compile/compile-cplus.exp

The testcase sets additional_flags when building with GCC, which
this commit causes to also be set when building with clang.  This
makes the testcase fail to build with a different error:
  warning: treating 'c' input as 'c++' when in C++ mode, this behavior
  is deprecated [-Wdeprecated]
so this commit adds -Wno-deprecated in two places to sidestep this.
Note that, while allowing the testcase to build, this commit reveals
failures when the testsuite is built using clang.

gdb/testsuite/ChangeLog:

* gdb.compile/compile-cplus.exp (additional_flags): Also
set when building with clang.
(additional_flags, srcfilesoptions): Pass -Wno-deprecated
when building with clang.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.compile/compile-cplus.exp