From 198d7b78ede581f481041a341a553187bcaf0dfc Mon Sep 17 00:00:00 2001 From: redi Date: Tue, 19 Nov 2013 22:03:30 +0000 Subject: * testsuite/23_containers/forward_list/allocator/noexcept.cc: Change to compile-only test. Adjust swap overload to handle rebound allocators. * testsuite/23_containers/map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/allocator/swap.cc: Add elements before swapping. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205056 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../unordered_set/allocator/noexcept.cc | 24 +++++++--------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'libstdc++-v3/testsuite/23_containers/unordered_set') diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/noexcept.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/noexcept.cc index 0f73126ccd9..5ada755fcbf 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/noexcept.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/noexcept.cc @@ -15,10 +15,10 @@ // with this library; see the file COPYING3. If not see // . +// { dg-do compile } // { dg-options "-std=c++11" } #include -#include #include struct T { int i; }; @@ -37,13 +37,11 @@ struct equal_to namespace __gnu_test { - inline void - swap(propagating_allocator& l, propagating_allocator& r) - noexcept(false) - { - typedef uneq_allocator base_alloc; - swap(static_cast(l), static_cast(r)); - } + template + inline void + swap(propagating_allocator& l, propagating_allocator& r) + noexcept(false) + { } } using __gnu_test::propagating_allocator; @@ -76,13 +74,5 @@ void test03() test_type v1(alloc_type(1)); test_type v2(alloc_type(2)); static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" ); - // static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" ); -} - -int main() -{ - test01(); - test02(); - test03(); - return 0; + static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" ); } -- cgit v1.2.1