From: Andrew Burgess Date: Tue, 2 May 2023 10:48:46 +0000 (+0100) Subject: gdb/testsuite: compile gdb.linespec/cp-completion-aliases.exp as C++ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e545e3f3d600e62ed6522e0ed6ef609a6fe8354;p=binutils-gdb.git gdb/testsuite: compile gdb.linespec/cp-completion-aliases.exp as C++ Noticed in passing that the prepare_for_testing call in gdb.linespec/cp-completion-aliases.exp does not pass the 'c++' flag, despite this being a C++ test. I guess, as the source file has the '.cc' extension, all the compilers are doing the right thing anyway -- the source file uses templates, so is definitely being compiled as C++. I noticed this when I tried to set CXX_FOR_TARGET (but not CC_FOR_TARGET) and spotted that this script was still using the C compiler. Fixed in this commit by adding the 'c++' flag for prepare_for_testing. --- diff --git a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp index 33ad72e6f05..4c3ab7362e9 100644 --- a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp +++ b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp @@ -20,7 +20,7 @@ load_lib completion-support.exp standard_testfile .cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 }