Fix 48631_neg test in _GLIBCXX_VERSION_NAMESPACE mode

Message ID 5e13b454-0722-01ef-8e62-e88654fe9021@gmail.com
State New
Headers
Series Fix 48631_neg test in _GLIBCXX_VERSION_NAMESPACE mode |

Commit Message

François Dumont Sept. 27, 2021, 8:25 p.m. UTC
  Here is a small patch to fix a test which fails in 
_GLIBCXX_VERSION_NAMESPACE mode.

IMHO it would be better to avoid putting <type_traits> content in 
versioned namespace, no ?

There is of course more work to do, so for now here is the simpler approach.

Ok to commit ?

François
  

Comments

Jonathan Wakely Sept. 27, 2021, 9:06 p.m. UTC | #1
On Mon, 27 Sept 2021 at 21:26, François Dumont via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Here is a small patch to fix a test which fails in
> _GLIBCXX_VERSION_NAMESPACE mode.
>
> IMHO it would be better to avoid putting <type_traits> content in
> versioned namespace, no ?
>
> There is of course more work to do, so for now here is the simpler approach.
>
> Ok to commit ?

Leaving the pattern ending with just "struct" isn't very useful.
Wouldn't it be better to do:

// { dg-prune-output "no type named 'type' in" }

or just:

// { dg-prune-output "enable_if" }

?

Either of those is OK to commit.
  
François Dumont Sept. 28, 2021, 8:20 p.m. UTC | #2
On 27/09/21 11:06 pm, Jonathan Wakely wrote:
> On Mon, 27 Sept 2021 at 21:26, François Dumont via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
>> Here is a small patch to fix a test which fails in
>> _GLIBCXX_VERSION_NAMESPACE mode.
>>
>> IMHO it would be better to avoid putting <type_traits> content in
>> versioned namespace, no ?

No opinion on this, you prefer to use consistently the versioned namespace ?


>>
>> There is of course more work to do, so for now here is the simpler approach.
>>
>> Ok to commit ?
> Leaving the pattern ending with just "struct" isn't very useful.
> Wouldn't it be better to do:
>
> // { dg-prune-output "no type named 'type' in" }
>
> or just:
>
> // { dg-prune-output "enable_if" }
>
> ?
>
> Either of those is OK to commit.

Done with "enable_if"
  
Jonathan Wakely Sept. 28, 2021, 8:26 p.m. UTC | #3
On Tue, 28 Sept 2021 at 21:21, François Dumont via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> On 27/09/21 11:06 pm, Jonathan Wakely wrote:
> > On Mon, 27 Sept 2021 at 21:26, François Dumont via Libstdc++
> > <libstdc++@gcc.gnu.org> wrote:
> >> Here is a small patch to fix a test which fails in
> >> _GLIBCXX_VERSION_NAMESPACE mode.
> >>
> >> IMHO it would be better to avoid putting <type_traits> content in
> >> versioned namespace, no ?
>
> No opinion on this, you prefer to use consistently the versioned namespace ?

I haven't though about it in much detail, but I think it's safer to
keep them in the versioned namespace.

Can we be sure that we'd never need to make any incompatible changes
to anything in that header? It seems likely, but I'm not entirely
confident.


> >> There is of course more work to do, so for now here is the simpler approach.
> >>
> >> Ok to commit ?
> > Leaving the pattern ending with just "struct" isn't very useful.
> > Wouldn't it be better to do:
> >
> > // { dg-prune-output "no type named 'type' in" }
> >
> > or just:
> >
> > // { dg-prune-output "enable_if" }
> >
> > ?
> >
> > Either of those is OK to commit.
>
> Done with "enable_if"

Thanks.
  

Patch

diff --git a/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc b/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
index 3e80b73603e..f710806ef42 100644
--- a/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
@@ -26,4 +26,4 @@  struct D : B { };
 D d;
 std::default_delete<B[]> db;
 typedef decltype(db(&d)) type; // { dg-error "no match" }
-// { dg-prune-output "no type named 'type' in 'struct std::enable_if" }
+// { dg-prune-output "no type named 'type' in 'struct" }