public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <iain@sandoe.co.uk>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: GCC Development <gcc@gcc.gnu.org>,
	libstdc++ <libstdc++@gcc.gnu.org>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix coroutine tests for libstdc++ gnu-version-namespace mode
Date: Sun, 8 Oct 2023 14:59:45 +0100	[thread overview]
Message-ID: <324ED72B-E687-4B5E-AD6E-C7A3BBDEB223@sandoe.co.uk> (raw)
In-Reply-To: <4ebb6936-d652-84a5-0028-6ca0a5d2d238@gmail.com>

Hi François,

> On 23 Sep 2023, at 21:10, François Dumont <frs.dumont@gmail.com> wrote:
> 
> I'm eventually fixing those tests the same way we manage this problem in libstdc++ testsuite.
> 
>    testsuite: Add optional libstdc++ version namespace in expected diagnostic
> 
>     When libstdc++ is build with --enable-symvers=gnu-versioned-namespace diagnostics are
>     showing this namespace, currently __8.
> 
>     gcc/testsuite/ChangeLog:
> 
>             * testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C: Add optional
>             '__8' version namespace in expected diagnostic.
>             * testsuite/g++.dg/coroutines/coro-bad-alloc-01-bad-op-del.C: Likewise.
>             * testsuite/g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C: Likewise.
>             * testsuite/g++.dg/coroutines/coro-bad-grooaf-01-grooaf-expected.C: Likewise.
>             * testsuite/g++.dg/coroutines/pr97438.C: Likewise.
>             * testsuite/g++.dg/coroutines/ramp-return-b.C: Likewise.
> 
> Tested under Linux x86_64.
> 
> I'm contributing to libstdc++ so I already have write access.
> 
> Ok to commit ?

As author of the tests, this LGTM as a suitable fix for now (at least, once the main
patch to fix versioned namespaces lands).

However, IMO, this could become quite painful as more g++ tests make use of std headers
(which is not really optional for facilities like this that are tightly-coupled between the FE and
the library).

For the future, it does seem that a more complete solution might be to introduce a
testsuite-wide definition for the C++ versioned std:: introducer, so that we can update it in one
place as the version changes.

So (as a thought experiment):
 - we’d have something of the form “CXX_STD” as a tcl global
 - we’d add the presence/absence of versioning to the relevant site.exp (which
   means recognising the versioning choice also in the GCC configure)
 - we’d migrate tests to using ${CXX_STD} instead of "std::__N”  in matches

… I guess an alternative could be to cook up some alternate warning/error/etc
   match functions that cater for arbitrary inline namespaces but that seems like a much
   more tricky and invasive testsuite change.

thoughts?
Iain


  parent reply	other threads:[~2023-10-08 13:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-23 20:10 François Dumont
2023-10-02 17:07 ` François Dumont
2023-10-03  9:52   ` Jonathan Wakely
2023-10-03 20:14     ` François Dumont
2023-10-08 13:59 ` Iain Sandoe [this message]
2023-10-11  4:49   ` François Dumont
2023-10-11  7:30     ` Iain Sandoe
2023-10-11 17:22       ` François Dumont

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=324ED72B-E687-4B5E-AD6E-C7A3BBDEB223@sandoe.co.uk \
    --to=iain@sandoe.co.uk \
    --cc=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /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).