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

Christophe Lyon christophe.lyon@linaro.org
Tue Sep 5 06:30:00 GMT 2017


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

Christophe



More information about the Libstdc++ mailing list