[PATCH] Fix coroutine tests for libstdc++ gnu-version-namespace mode
Iain Sandoe
iain@sandoe.co.uk
Sun Oct 8 13:59:45 GMT 2023
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
More information about the Gcc
mailing list