public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PUSHED] gdb/testsuite: compile gdb.linespec/cp-completion-aliases.exp as C++
@ 2023-05-02 10:54 Andrew Burgess
  2023-05-02 13:48 ` Tom de Vries
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2023-05-02 10:54 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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.
---
 gdb/testsuite/gdb.linespec/cp-completion-aliases.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
 }
 

base-commit: b2499d8a40a6de13e9bc88b973a730bdf8b9b032
-- 
2.25.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PUSHED] gdb/testsuite: compile gdb.linespec/cp-completion-aliases.exp as C++
  2023-05-02 10:54 [PUSHED] gdb/testsuite: compile gdb.linespec/cp-completion-aliases.exp as C++ Andrew Burgess
@ 2023-05-02 13:48 ` Tom de Vries
  2023-05-05 17:04   ` Andrew Burgess
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2023-05-02 13:48 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches

On 5/2/23 12:54, Andrew Burgess via Gdb-patches wrote:
> 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.

Hi,

this is an instance of 
https://sourceware.org/bugzilla/show_bug.cgi?id=30380 .

I already had this fixed in a branch, but hadn't had time to submit.

FWIW, it's the top commit of 
https://github.com/vries/gdb/commits/testsuite/old-gcc .

Thanks,
- Tom

> ---
>   gdb/testsuite/gdb.linespec/cp-completion-aliases.exp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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
>   }
>   
> 
> base-commit: b2499d8a40a6de13e9bc88b973a730bdf8b9b032


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PUSHED] gdb/testsuite: compile gdb.linespec/cp-completion-aliases.exp as C++
  2023-05-02 13:48 ` Tom de Vries
@ 2023-05-05 17:04   ` Andrew Burgess
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2023-05-05 17:04 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

Tom de Vries <tdevries@suse.de> writes:

> On 5/2/23 12:54, Andrew Burgess via Gdb-patches wrote:
>> 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.
>
> Hi,
>
> this is an instance of 
> https://sourceware.org/bugzilla/show_bug.cgi?id=30380 .
>
> I already had this fixed in a branch, but hadn't had time to submit.
>
> FWIW, it's the top commit of 
> https://github.com/vries/gdb/commits/testsuite/old-gcc .

Sorry for duplicating this work.  I ran into this case while working on
some other patch and I didn't want to have to carry around such a
trivial local patch.

Hope this didn't cause you any serious problems.

Thanks,
Andrew


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-05 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 10:54 [PUSHED] gdb/testsuite: compile gdb.linespec/cp-completion-aliases.exp as C++ Andrew Burgess
2023-05-02 13:48 ` Tom de Vries
2023-05-05 17:04   ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).