15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier
95a83710eSEric Fiselier // <map>
105a83710eSEric Fiselier
115a83710eSEric Fiselier // multimap(multimap&&)
125a83710eSEric Fiselier // noexcept(is_nothrow_move_constructible<allocator_type>::value &&
135a83710eSEric Fiselier // is_nothrow_move_constructible<key_compare>::value);
145a83710eSEric Fiselier
155a83710eSEric Fiselier // This tests a conforming extension
165a83710eSEric Fiselier
17*31cbe0f2SLouis Dionne // UNSUPPORTED: c++03
18f2f2a639SEric Fiselier
195a83710eSEric Fiselier #include <map>
205a83710eSEric Fiselier #include <cassert>
215a83710eSEric Fiselier
22f950b851SEric Fiselier #include "test_macros.h"
23949389c3SMarshall Clow #include "MoveOnly.h"
245a83710eSEric Fiselier #include "test_allocator.h"
255a83710eSEric Fiselier
265a83710eSEric Fiselier template <class T>
275a83710eSEric Fiselier struct some_comp
285a83710eSEric Fiselier {
295a83710eSEric Fiselier typedef T value_type;
305a83710eSEric Fiselier some_comp(const some_comp&);
operator ()some_comp3154238fd3SMarshall Clow bool operator()(const T&, const T&) const { return false; }
325a83710eSEric Fiselier };
335a83710eSEric Fiselier
main(int,char **)342df59c50SJF Bastien int main(int, char**)
355a83710eSEric Fiselier {
3603fe6e2dSStephan T. Lavavej #if defined(_LIBCPP_VERSION)
37e0312a30SMarshall Clow typedef std::pair<const MoveOnly, MoveOnly> V;
385a83710eSEric Fiselier {
395a83710eSEric Fiselier typedef std::multimap<MoveOnly, MoveOnly> C;
4003fe6e2dSStephan T. Lavavej static_assert(std::is_nothrow_move_constructible<C>::value, "");
415a83710eSEric Fiselier }
425a83710eSEric Fiselier {
43e0312a30SMarshall Clow typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
4403fe6e2dSStephan T. Lavavej static_assert(std::is_nothrow_move_constructible<C>::value, "");
455a83710eSEric Fiselier }
465a83710eSEric Fiselier {
47e0312a30SMarshall Clow typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
4803fe6e2dSStephan T. Lavavej static_assert(std::is_nothrow_move_constructible<C>::value, "");
495a83710eSEric Fiselier }
5003fe6e2dSStephan T. Lavavej #endif // _LIBCPP_VERSION
515a83710eSEric Fiselier {
525a83710eSEric Fiselier typedef std::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
535a83710eSEric Fiselier static_assert(!std::is_nothrow_move_constructible<C>::value, "");
545a83710eSEric Fiselier }
552df59c50SJF Bastien
562df59c50SJF Bastien return 0;
575a83710eSEric Fiselier }
58