public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: gcc@gcc.gnu.org, libstdc++@gcc.gnu.org,
	Jonathan Wakely <jwakely@redhat.com>
Subject: Re: Attempt to fix g++.dg tests failures in gnu-versioned-namespace mode
Date: Thu, 21 Sep 2023 07:01:09 +0200	[thread overview]
Message-ID: <2cc3345e-9d82-53db-8a9a-29a25c99b9b8@gmail.com> (raw)
In-Reply-To: <87v8c55mxo.fsf@euler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 3337 bytes --]

Thanks for the feedback, seems a little bit too complicated for what I'm 
trying to achieve.

I'm eventually testing this patch which is also how libstdc++ is 
managing this small problem.

I'll submit a proper patch once confirmed that tests are fixed.

François

On 20/09/2023 09:22, Thomas Schwinge wrote:
> Hi!
>
> On 2023-09-20T07:08:25+0200, François Dumont via Gcc <gcc@gcc.gnu.org> wrote:
>> I've configured libstdc++ with --enable-symvers=gnu-versioned-namespace
> I can't comment on that option...
>
>> and run make check-c++.
>>
>> A number of failures are like this one:
>>
>> /home/fdumont/dev/gcc/git/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C:
>> In function 'coro1 f()':
>> /home/fdumont/dev/gcc/git/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C:9:1:
>> error: 'operator new' is provided by
>> 'std::__8::__n4861::__coroutine_traits_impl<coro1, void>::promise_type'
>> {aka 'co
>> ro1::promise_type'} but is not usable with the function signature 'coro1
>> f()'
>> compiler exited with status 1
>> FAIL: g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C  (test for
>> errors, line 9)
>> FAIL: g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C (test for excess
>> errors)
>> Excess errors:
>> /home/fdumont/dev/gcc/git/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C:9:1:
>> error: 'operator new' is provided by
>> 'std::__n4861::__coroutine_traits_impl<coro1, void>::promise_type' {aka
>> 'coro1::promise_type'} but is not usable with the function signature
>> 'coro1 f()'
>>
>> The '__8' is messing with expected output.
>>
>> So I've added:
>>
>>       # Ignore optional version namespace from libstdc++.
>>       regsub -all "std::__8::" $text "std::" text
> ..., and whether that's conceptually the correct solution...
>
>> in testsuite/lib/prune.exp prune_gcc_output.
>>
>> But it had no impact, same failures.
>>
>> What am I missing ?
> ..., but I can answer that one: pruning happens after scanning for
> 'dg-error' etc. (..., which are captured in 'dg-messages').  See DejaGnu
> 'dg.exp:dg-test':
>
>      [...]
>          set results [${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}"]
>
>          set comp_output [lindex $results 0]
>          set output_file [lindex $results 1]
>
>          foreach i ${dg-messages} {
>              verbose "Scanning for message: $i" 4
>
>              # Remove all error messages for the line [lindex $i 0]
>              # in the source file.  If we find any, success!
>      [...]
>          }
>
>          # Remove messages from the tool that we can ignore.
>          set comp_output [prune_warnings $comp_output]
>      [...]
>              if {$comp_output ne ""} {
>                  fail "$name (test for excess errors)"
>                  send_log "Excess errors:\n$comp_output\n"
>              } else {
>                  pass "$name (test for excess errors)"
>              }
>      [...]
>
> So you'll have to have your 's%std::__8::%std::' work on 'dg-messages', I
> suppose?
>
>
> Grüße
>   Thomas
> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: gcc_testsuite.patch --]
[-- Type: text/x-patch, Size: 4808 bytes --]

diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C
index 4706deebf4e..928e0c974e1 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C
@@ -6,7 +6,7 @@
 #include "coro1-allocators.h"
 
 struct coro1
-f ()  /* { dg-error {'operator new' is provided by 'std::__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\} but is not usable with the function signature 'coro1 f\(\)'} } */
+f ()  /* { dg-error {'operator new' is provided by 'std::(__8::)?__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\} but is not usable with the function signature 'coro1 f\(\)'} } */
 {
   co_return;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-01-bad-op-del.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-01-bad-op-del.C
index 252cb5e442c..fc2afcf5e0e 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-01-bad-op-del.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-01-bad-op-del.C
@@ -6,7 +6,7 @@
 #include "coro1-allocators.h"
 
 struct coro1
-f ()  /* { dg-error {'operator delete' is provided by 'std::__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\} but is not usable with the function signature 'coro1 f\(\)'} } */
+f ()  /* { dg-error {'operator delete' is provided by 'std::(__8)?__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\} but is not usable with the function signature 'coro1 f\(\)'} } */
 {
   co_return;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C
index 89972b60945..0a545fed0e3 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C
@@ -9,7 +9,7 @@
 #include "coro1-allocators.h"
 
 struct coro1
-f () /* { dg-error {'coro1::promise_type::get_return_object_on_allocation_failure\(\)\(\)' is provided by 'std::__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\} but 'operator new' is not marked 'throw\(\)' or 'noexcept'} } */
+f () /* { dg-error {'coro1::promise_type::get_return_object_on_allocation_failure\(\)\(\)' is provided by 'std::(__8::)?__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\} but 'operator new' is not marked 'throw\(\)' or 'noexcept'} } */
 {
   co_return;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C
index 9fa3d64a9f2..b36e88f871a 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C
@@ -6,7 +6,7 @@
 int used_grooaf = 0;
 
 struct coro1
-f () noexcept // { dg-warning {'operator new' is marked 'throw\(\)' or 'noexcept' but no usable 'get_return_object_on_allocation_failure' is provided by 'std::__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\}} }
+f () noexcept // { dg-warning {'operator new' is marked 'throw\(\)' or 'noexcept' but no usable 'get_return_object_on_allocation_failure' is provided by 'std::(__8::)?__n4861::__coroutine_traits_impl<coro1, void>::promise_type' \{aka 'coro1::promise_type'\}} }
 {
   PRINT ("coro1: about to return");
   co_return;
diff --git a/gcc/testsuite/g++.dg/coroutines/pr97438.C b/gcc/testsuite/g++.dg/coroutines/pr97438.C
index 95376648ed7..ac37118eae7 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr97438.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr97438.C
@@ -25,6 +25,6 @@ public:
 }
 
 dummy_coroutine
-foo() { // { dg-error {the coroutine promise type 'std::__n4861::coroutine_traits<dummy_coroutine>::promise_type' declares both 'return_value' and 'return_void'} }
+foo() { // { dg-error {the coroutine promise type 'std::(__8::)?__n4861::coroutine_traits<dummy_coroutine>::promise_type' declares both 'return_value' and 'return_void'} }
     co_return 17;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/ramp-return-b.C b/gcc/testsuite/g++.dg/coroutines/ramp-return-b.C
index d0e5d1f3c7f..fcca1d73a02 100644
--- a/gcc/testsuite/g++.dg/coroutines/ramp-return-b.C
+++ b/gcc/testsuite/g++.dg/coroutines/ramp-return-b.C
@@ -19,4 +19,4 @@ task<std::vector<int>>
 baz ()
 {
   co_return std::vector<int>();
-} // { dg-error {use of deleted function 'task<T>::task\(const task<T>&\) \[with T = std::vector<int>\]'} }
+} // { dg-error {use of deleted function 'task<T>::task\(const task<T>&\) \[with T = std::(__8::)?vector<int>\]'} }

      reply	other threads:[~2023-09-21  5:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  5:08 François Dumont
2023-09-20  7:22 ` Thomas Schwinge
2023-09-21  5:01   ` François Dumont [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cc3345e-9d82-53db-8a9a-29a25c99b9b8@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).