[AMDGPU] Implement IR variant of isFMAFasterThanFMulAndFAdd (#121465)
[llvm-project.git] / libcxx / test / std / containers / associative / multiset / multiset.cons / move_assign_noexcept.pass.cpp
bloba94b5b1abf1e5ce23097871409c3895097e0f6da
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // <set>
11 // multiset& operator=(multiset&& c)
12 // noexcept(
13 // allocator_type::propagate_on_container_move_assignment::value &&
14 // is_nothrow_move_assignable<allocator_type>::value &&
15 // is_nothrow_move_assignable<key_compare>::value);
17 // This tests a conforming extension
19 // UNSUPPORTED: c++03
21 #include <set>
22 #include <cassert>
24 #include "test_macros.h"
25 #include "MoveOnly.h"
26 #include "test_allocator.h"
28 template <class T>
29 struct some_comp
31 typedef T value_type;
32 some_comp& operator=(const some_comp&);
33 bool operator()(const T&, const T&) const { return false; }
36 int main(int, char**)
39 typedef std::multiset<MoveOnly> C;
40 static_assert(std::is_nothrow_move_assignable<C>::value, "");
43 typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
44 static_assert(!std::is_nothrow_move_assignable<C>::value, "");
46 #if defined(_LIBCPP_VERSION)
48 typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
49 static_assert(std::is_nothrow_move_assignable<C>::value, "");
51 #endif // _LIBCPP_VERSION
53 typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
54 static_assert(!std::is_nothrow_move_assignable<C>::value, "");
57 return 0;