On 05/09/17 08:30 +0200, Christophe Lyon wrote:
Hi Jonathan
On 5 June 2017 at 11:34, Jonathan Wakely <jwak...@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.
commit 3c6ae9c30e86263cf764cef946b8783810583079
Author: Jonathan Wakely <jwak...@redhat.com>
Date: Tue Sep 5 10:31:05 2017 +0100
Remove owner_less<void> test that fails on gcc-6-branch
* testsuite/20_util/owner_less/noexcept.cc: Remove owner_less<void>
tests.
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 8a87b7b155a..d88a08f2452 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-05 Jonathan Wakely <jwak...@redhat.com>
+
+ * testsuite/20_util/owner_less/noexcept.cc: Remove owner_less<void>
+ tests.
+
2017-09-04 Jonathan Wakely <jwak...@redhat.com>
Backport from mainline
diff --git a/libstdc++-v3/testsuite/20_util/owner_less/noexcept.cc b/libstdc++-v3/testsuite/20_util/owner_less/noexcept.cc
index 25c9afde8e1..fcf5d4f2679 100644
--- a/libstdc++-v3/testsuite/20_util/owner_less/noexcept.cc
+++ b/libstdc++-v3/testsuite/20_util/owner_less/noexcept.cc
@@ -29,12 +29,3 @@ const std::owner_less<std::weak_ptr<int>> owi;
static_assert( noexcept(owi(wi, wi)), "" );
static_assert( noexcept(owi(si, wi)), "" );
static_assert( noexcept(owi(wi, si)), "" );
-const std::shared_ptr<long> sl;
-const std::weak_ptr<char> wc;
-const std::owner_less<void> ov;
-static_assert( noexcept(ov(si, si)), "" );
-static_assert( noexcept(ov(si, sl)), "" );
-static_assert( noexcept(ov(sl, si)), "" );
-static_assert( noexcept(ov(si, wc)), "" );
-static_assert( noexcept(ov(wc, si)), "" );
-static_assert( noexcept(ov(wc, wi)), "" );