1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // ~unordered_map() // implied noexcept;
14 // UNSUPPORTED: c++98, c++03
16 #include <unordered_map>
19 #include "test_macros.h"
21 #include "test_allocator.h"
27 ~some_comp() noexcept(false);
28 bool operator()(const T&, const T&) const { return false; }
36 some_hash(const some_hash&);
37 ~some_hash() noexcept(false);
43 typedef std::unordered_map<MoveOnly, MoveOnly> C;
44 static_assert(std::is_nothrow_destructible<C>::value, "");
47 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
48 std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
49 static_assert(std::is_nothrow_destructible<C>::value, "");
52 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
53 std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
54 static_assert(std::is_nothrow_destructible<C>::value, "");
57 typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
58 LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
61 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
62 some_comp<MoveOnly>> C;
63 LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");