Re: [Patch, libstdc++/68877] Reimplement __is_[nothrow_]swappable

2016-01-12 Thread Jonathan Wakely

On 23/12/15 22:15 +0100, Daniel Krügler wrote:


   PR libstdc++/68877
   * include/std/type_traits: Following N4511, reimplement __is_swappable and
   __is_nothrow_swappable. Move __is_swappable to namespace std, adjust
   callers. Use __is_nothrow_swappable in swap.
   * include/bits/move.h: Use __is_nothrow_swappable in swap.
   * testsuite/20_util/is_nothrow_swappable/value.cc: Extend; remove
   __is_swappable related tests.
   * testsuite/20_util/is_swappable/value.cc: New.
   * testsuite/20_util/is_swappable/requirements/explicit_instantiation.cc:
   New.
   * testsuite/20_util/is_swappable/requirements/typedefs.cc: New.
   * testsuite/25_algorithms/swap/68877.cc: New.


Committed to trunk now, thanks!


Re: [Patch, libstdc++/68877] Reimplement __is_[nothrow_]swappable

2016-01-12 Thread Jonathan Wakely
On 12 January 2016 at 20:38, Daniel Krügler wrote:
> Ping - this is a tentative reminder for this patch proposal.

I was just about to commit it an hour ago and my machine crashed. It's done now.


Re: [Patch, libstdc++/68877] Reimplement __is_[nothrow_]swappable

2016-01-12 Thread Daniel Krügler
Ping - this is a tentative reminder for this patch proposal.

2015-12-23 22:15 GMT+01:00 Daniel Krügler :
> This is a second try for a patch for libstdc++ bug 68877. See below
> for responses.
>
> 2015-12-22 22:42 GMT+01:00 Jonathan Wakely :
>> On 21/12/15 12:45 +0100, Daniel Krügler wrote:
>>>
>>> 2015-12-14 21:48 GMT+01:00 Daniel Krügler :

 This is a reimplementation of __is_swappable and
 __is_nothrow_swappable according to

 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4511.html

 and also adds a missing usage of __is_nothrow_swappable in the swap
 overload for arrays. Strictly speaking the latter change differs from
 the Standard specification which requires the expression
 noexcept(swap(*a, *b)) to be used. On the other hand the Standard is
 broken in this regard, as pointed out by

 http://cplusplus.github.io/LWG/lwg-active.html#2554
>>
>> The patch doesn't apply cleanly because it repeats some of the new
>> files either twice or three times (and also has some trailing
>> whitespace that shouldn't be there).
>
> I can confirm this, albeit I don't understand why this happens. I'm
> using TortoiseSVN and when trying to create a patch file it creates
> double entries for new directories. I have now explicitly removed the
> added directories from the patch, I hope that your patch experience is
> now better.
>
>> After fixing the patch to only
>> create new files once it applies, but then I get some FAILs:
>>
>> FAIL: 20_util/is_nothrow_swappable/value.cc (test for excess errors)
>> FAIL: 20_util/is_swappable/value.cc (test for excess errors)
>>
>> I don't have time to analyse these today, so I'll wait until you're
>> able to do so.
>
> I'm sorry for these errors. I could now find a way to reproduce the
> tests and found that they were partially due to an incomplete commit
> and partially because of sleepiness on my side. I hopefully fixed
> these blatant errors and took the chance to increase the test cases
> even further.
>
> Thanks again,
>
> - Daniel



-- 


SavedURI :Show URLShow URLSavedURI :
SavedURI :Hide URLHide URLSavedURI :
https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.de.LEt2fN4ilLE.O/m=m_i,t,it/am=OCMOBiHj9kJxhnelj6j997_NLil29vVAOBGeBBRgJwD-m_0_8B_AD-qOEw/rt=h/d=1/rs=AItRSTODy9wv1JKZMABIG3Ak8ViC4kuOWA?random=1395770800154https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.de.LEt2fN4ilLE.O/m=m_i,t,it/am=OCMOBiHj9kJxhnelj6j997_NLil29vVAOBGeBBRgJwD-m_0_8B_AD-qOEw/rt=h/d=1/rs=AItRSTODy9wv1JKZMABIG3Ak8ViC4kuOWA?random=1395770800154



Re: [Patch, libstdc++/68877] Reimplement __is_[nothrow_]swappable

2015-12-23 Thread Daniel Krügler
This is a second try for a patch for libstdc++ bug 68877. See below
for responses.

2015-12-22 22:42 GMT+01:00 Jonathan Wakely :
> On 21/12/15 12:45 +0100, Daniel Krügler wrote:
>>
>> 2015-12-14 21:48 GMT+01:00 Daniel Krügler :
>>>
>>> This is a reimplementation of __is_swappable and
>>> __is_nothrow_swappable according to
>>>
>>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4511.html
>>>
>>> and also adds a missing usage of __is_nothrow_swappable in the swap
>>> overload for arrays. Strictly speaking the latter change differs from
>>> the Standard specification which requires the expression
>>> noexcept(swap(*a, *b)) to be used. On the other hand the Standard is
>>> broken in this regard, as pointed out by
>>>
>>> http://cplusplus.github.io/LWG/lwg-active.html#2554
>
> The patch doesn't apply cleanly because it repeats some of the new
> files either twice or three times (and also has some trailing
> whitespace that shouldn't be there).

I can confirm this, albeit I don't understand why this happens. I'm
using TortoiseSVN and when trying to create a patch file it creates
double entries for new directories. I have now explicitly removed the
added directories from the patch, I hope that your patch experience is
now better.

> After fixing the patch to only
> create new files once it applies, but then I get some FAILs:
>
> FAIL: 20_util/is_nothrow_swappable/value.cc (test for excess errors)
> FAIL: 20_util/is_swappable/value.cc (test for excess errors)
>
> I don't have time to analyse these today, so I'll wait until you're
> able to do so.

I'm sorry for these errors. I could now find a way to reproduce the
tests and found that they were partially due to an incomplete commit
and partially because of sleepiness on my side. I hopefully fixed
these blatant errors and took the chance to increase the test cases
even further.

Thanks again,

- Daniel
2015-12-23  Daniel Kruegler  

PR libstdc++/68877
* include/std/type_traits: Following N4511, reimplement __is_swappable and
__is_nothrow_swappable. Move __is_swappable to namespace std, adjust
callers. Use __is_nothrow_swappable in swap.
* include/bits/move.h: Use __is_nothrow_swappable in swap.
* testsuite/20_util/is_nothrow_swappable/value.cc: Extend; remove 
__is_swappable related tests.
* testsuite/20_util/is_swappable/value.cc: New.
* testsuite/20_util/is_swappable/requirements/explicit_instantiation.cc: 
New.
* testsuite/20_util/is_swappable/requirements/typedefs.cc: New.
* testsuite/25_algorithms/swap/68877.cc: New.


68877.patch
Description: Binary data


Re: [Patch, libstdc++/68877] Reimplement __is_[nothrow_]swappable

2015-12-22 Thread Jonathan Wakely

On 21/12/15 12:45 +0100, Daniel Krügler wrote:

2015-12-14 21:48 GMT+01:00 Daniel Krügler :

This is a reimplementation of __is_swappable and
__is_nothrow_swappable according to

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4511.html

and also adds a missing usage of __is_nothrow_swappable in the swap
overload for arrays. Strictly speaking the latter change differs from
the Standard specification which requires the expression
noexcept(swap(*a, *b)) to be used. On the other hand the Standard is
broken in this regard, as pointed out by

http://cplusplus.github.io/LWG/lwg-active.html#2554


The patch doesn't apply cleanly because it repeats some of the new
files either twice or three times (and also has some trailing
whitespace that shouldn't be there). After fixing the patch to only
create new files once it applies, but then I get some FAILs:

FAIL: 20_util/is_nothrow_swappable/value.cc (test for excess errors)
FAIL: 20_util/is_swappable/value.cc (test for excess errors)

I don't have time to analyse these today, so I'll wait until you're
able to do so. There's no great rush to fix this, as long as it's in
stage 3.



Re: [Patch, libstdc++/68877] Reimplement __is_[nothrow_]swappable

2015-12-22 Thread Daniel Krügler
2015-12-22 22:42 GMT+01:00 Jonathan Wakely :
> On 21/12/15 12:45 +0100, Daniel Krügler wrote:
>>
>> 2015-12-14 21:48 GMT+01:00 Daniel Krügler :
>>>
>>> This is a reimplementation of __is_swappable and
>>> __is_nothrow_swappable according to
>>>
>>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4511.html
>>>
>>> and also adds a missing usage of __is_nothrow_swappable in the swap
>>> overload for arrays. Strictly speaking the latter change differs from
>>> the Standard specification which requires the expression
>>> noexcept(swap(*a, *b)) to be used. On the other hand the Standard is
>>> broken in this regard, as pointed out by
>>>
>>> http://cplusplus.github.io/LWG/lwg-active.html#2554
>
>
> The patch doesn't apply cleanly because it repeats some of the new
> files either twice or three times (and also has some trailing
> whitespace that shouldn't be there). After fixing the patch to only
> create new files once it applies, but then I get some FAILs:
>
> FAIL: 20_util/is_nothrow_swappable/value.cc (test for excess errors)
> FAIL: 20_util/is_swappable/value.cc (test for excess errors)
>
> I don't have time to analyse these today, so I'll wait until you're
> able to do so. There's no great rush to fix this, as long as it's in
> stage 3.

Thanks for looking at this. When will stage 3 end?

Thanks,

- Daniel


Re: [Patch, libstdc++/68877] Reimplement __is_[nothrow_]swappable

2015-12-22 Thread Jonathan Wakely

On 22/12/15 22:58 +0100, Daniel Krügler wrote:

2015-12-22 22:42 GMT+01:00 Jonathan Wakely :

On 21/12/15 12:45 +0100, Daniel Krügler wrote:


2015-12-14 21:48 GMT+01:00 Daniel Krügler :


This is a reimplementation of __is_swappable and
__is_nothrow_swappable according to

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4511.html

and also adds a missing usage of __is_nothrow_swappable in the swap
overload for arrays. Strictly speaking the latter change differs from
the Standard specification which requires the expression
noexcept(swap(*a, *b)) to be used. On the other hand the Standard is
broken in this regard, as pointed out by

http://cplusplus.github.io/LWG/lwg-active.html#2554



The patch doesn't apply cleanly because it repeats some of the new
files either twice or three times (and also has some trailing
whitespace that shouldn't be there). After fixing the patch to only
create new files once it applies, but then I get some FAILs:

FAIL: 20_util/is_nothrow_swappable/value.cc (test for excess errors)
FAIL: 20_util/is_swappable/value.cc (test for excess errors)

I don't have time to analyse these today, so I'll wait until you're
able to do so. There's no great rush to fix this, as long as it's in
stage 3.


Thanks for looking at this. When will stage 3 end?


Probably in two or three months time.



Re: [Patch, libstdc++/68877] Reimplement __is_[nothrow_]swappable

2015-12-21 Thread Daniel Krügler
2015-12-14 21:48 GMT+01:00 Daniel Krügler :
> This is a reimplementation of __is_swappable and
> __is_nothrow_swappable according to
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4511.html
>
> and also adds a missing usage of __is_nothrow_swappable in the swap
> overload for arrays. Strictly speaking the latter change differs from
> the Standard specification which requires the expression
> noexcept(swap(*a, *b)) to be used. On the other hand the Standard is
> broken in this regard, as pointed out by
>
> http://cplusplus.github.io/LWG/lwg-active.html#2554

Jonathan explained to me that changelog entries should not be send as
diff, but just as plain text with the recommended addition, therefore
resending with that change applied.

Thanks,

- Daniel
2015-12-14  Daniel Kruegler  

PR libstdc++/68877
* include/std/type_traits: Following N4511, reimplement __is_swappable and
__is_nothrow_swappable. Move __is_swappable to namespace std, adjust
callers. Use __is_nothrow_swappable in swap.
* include/bits/move.h: Use __is_nothrow_swappable in swap.
* testsuite/20_util/is_nothrow_swappable/value.cc: Extend; remove 
__is_swappable related tests.
* testsuite/20_util/is_swappable/value.cc: New.
* testsuite/20_util/is_swappable/requirements/explicit_instantiation.cc: 
New.
* testsuite/20_util/is_swappable/requirements/typedefs.cc: New.
* testsuite/25_algorithms/swap/68877.cc: New.


68877.patch
Description: Binary data