1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 // noexcept(is_nothrow_default_constructible<allocator_type>::value);
15 // This *was* a conforming extension, but it was adopted in N4258.
21 #include "test_macros.h"
23 #include "test_allocator.h"
29 some_alloc(const some_alloc
&);
30 void allocate(std::size_t);
33 TEST_CONSTEXPR_CXX20
bool tests() {
35 typedef std::vector
<MoveOnly
> C
;
36 static_assert(std::is_nothrow_default_constructible
<C
>::value
, "");
39 typedef std::vector
<MoveOnly
, test_allocator
<MoveOnly
>> C
;
40 static_assert(std::is_nothrow_default_constructible
<C
>::value
, "");
43 typedef std::vector
<MoveOnly
, other_allocator
<MoveOnly
>> C
;
44 static_assert(!std::is_nothrow_default_constructible
<C
>::value
, "");
47 typedef std::vector
<MoveOnly
, some_alloc
<MoveOnly
>> C
;
48 static_assert(!std::is_nothrow_default_constructible
<C
>::value
, "");
58 static_assert(tests());