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 // <deque>
105a83710eSEric Fiselier 
115a83710eSEric Fiselier // deque()
125a83710eSEric Fiselier //        noexcept(is_nothrow_default_constructible<allocator_type>::value);
135a83710eSEric Fiselier 
145a83710eSEric Fiselier // This tests a conforming extension
155a83710eSEric Fiselier 
1631cbe0f2SLouis Dionne // UNSUPPORTED: c++03
17f2f2a639SEric Fiselier 
185a83710eSEric Fiselier #include <deque>
195a83710eSEric Fiselier #include <cassert>
205a83710eSEric Fiselier 
21a9fb19d3SEric Fiselier #include "test_macros.h"
22949389c3SMarshall Clow #include "MoveOnly.h"
235a83710eSEric Fiselier #include "test_allocator.h"
245a83710eSEric Fiselier 
255a83710eSEric Fiselier template <class T>
265a83710eSEric Fiselier struct some_alloc
275a83710eSEric Fiselier {
285a83710eSEric Fiselier     typedef T value_type;
295a83710eSEric Fiselier     some_alloc(const some_alloc&);
30*7da4ee6fSKonstantin Varlamov     void allocate(size_t);
315a83710eSEric Fiselier };
325a83710eSEric Fiselier 
main(int,char **)332df59c50SJF Bastien int main(int, char**)
345a83710eSEric Fiselier {
3503fe6e2dSStephan T. Lavavej #if defined(_LIBCPP_VERSION)
365a83710eSEric Fiselier     {
375a83710eSEric Fiselier         typedef std::deque<MoveOnly> C;
3803fe6e2dSStephan T. Lavavej         static_assert(std::is_nothrow_default_constructible<C>::value, "");
395a83710eSEric Fiselier     }
405a83710eSEric Fiselier     {
415a83710eSEric Fiselier         typedef std::deque<MoveOnly, test_allocator<MoveOnly>> C;
4203fe6e2dSStephan T. Lavavej         static_assert(std::is_nothrow_default_constructible<C>::value, "");
435a83710eSEric Fiselier     }
4403fe6e2dSStephan T. Lavavej #endif // _LIBCPP_VERSION
455a83710eSEric Fiselier     {
465a83710eSEric Fiselier         typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
475a83710eSEric Fiselier         static_assert(!std::is_nothrow_default_constructible<C>::value, "");
485a83710eSEric Fiselier     }
495a83710eSEric Fiselier     {
505a83710eSEric Fiselier         typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
515a83710eSEric Fiselier         static_assert(!std::is_nothrow_default_constructible<C>::value, "");
525a83710eSEric Fiselier     }
532df59c50SJF Bastien 
542df59c50SJF Bastien   return 0;
555a83710eSEric Fiselier }
56