Howard Hinnant | 7686add | 2011-06-04 14:31:57 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <map> |
| 11 | |
| 12 | // ~multimap() // implied noexcept; |
| 13 | |
| 14 | #include <map> |
| 15 | #include <cassert> |
| 16 | |
Marshall Clow | df00d5e | 2015-01-28 21:22:53 +0000 | [diff] [blame] | 17 | #include "MoveOnly.h" |
Marshall Clow | 1b92188 | 2013-12-03 00:18:10 +0000 | [diff] [blame] | 18 | #include "test_allocator.h" |
Howard Hinnant | 7686add | 2011-06-04 14:31:57 +0000 | [diff] [blame] | 19 | |
| 20 | #if __has_feature(cxx_noexcept) |
| 21 | |
| 22 | template <class T> |
| 23 | struct some_comp |
| 24 | { |
| 25 | typedef T value_type; |
| 26 | ~some_comp() noexcept(false); |
| 27 | }; |
| 28 | |
| 29 | #endif |
| 30 | |
| 31 | int main() |
| 32 | { |
| 33 | #if __has_feature(cxx_noexcept) |
| 34 | { |
| 35 | typedef std::multimap<MoveOnly, MoveOnly> C; |
| 36 | static_assert(std::is_nothrow_destructible<C>::value, ""); |
| 37 | } |
| 38 | { |
Dan Albert | 1d4a1ed | 2016-05-25 22:36:09 -0700 | [diff] [blame^] | 39 | typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C; |
Howard Hinnant | 7686add | 2011-06-04 14:31:57 +0000 | [diff] [blame] | 40 | static_assert(std::is_nothrow_destructible<C>::value, ""); |
| 41 | } |
| 42 | { |
Dan Albert | 1d4a1ed | 2016-05-25 22:36:09 -0700 | [diff] [blame^] | 43 | typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C; |
Howard Hinnant | 7686add | 2011-06-04 14:31:57 +0000 | [diff] [blame] | 44 | static_assert(std::is_nothrow_destructible<C>::value, ""); |
| 45 | } |
| 46 | { |
| 47 | typedef std::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C; |
| 48 | static_assert(!std::is_nothrow_destructible<C>::value, ""); |
| 49 | } |
| 50 | #endif |
| 51 | } |