[PATCH] Add noexcept to shared_ptr owner comparisons (LWG 2873)

Jonathan Wakely jwakely@redhat.com
Tue Sep 5 10:31:00 GMT 2017


On 05/09/17 08:30 +0200, Christophe Lyon wrote:
>Hi Jonathan
>
>On 5 June 2017 at 11:34, Jonathan Wakely <jwakely@redhat.com> wrote:
>> C++17 requires these to be noexcept, and there's no reason not to do
>> it for earlier standard modes too.
>>
>>         * include/bits/shared_ptr_base.h (__shared_ptr::owner_before)
>>         (__weak_ptr::owner_before, _Sp_owner_less::operator()): Add noexcept
>>         specifiers as per LWG 2873 and LWG 2942.
>>         * testsuite/20_util/owner_less/noexcept.cc: New.
>>         * testsuite/20_util/shared_ptr/observers/owner_before.cc: Test
>>         noexcept guarantees.
>>         * testsuite/20_util/weak_ptr/observers/owner_before.cc: Likewise.
>>
>> Tested powerpc64le-linux, committed to trunk.
>>
>
>I've noticed you have backported this patch to gcc-6-branch (r251673).
>The new test testsuite/20_util/owner_less/noexcept.cc fails with:
>/libstdc++-v3/testsuite/20_util/owner_less/noexcept.cc:34: error:
>aggregate 'const std::owner_less<void> ov' has incomplete type and
>cannot be defined

Huh, I fixed that in the gcc-5-branch backport, but not gcc-6-branch.

Fixed by this patch.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1525 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170905/2ccb7470/attachment.bin>


More information about the Gcc-patches mailing list