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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
13 // Test default construction:
15 // constexpr default_accessor() noexcept = default;
20 #include <type_traits>
22 #include "test_macros.h"
24 #include "../MinimalElementType.h"
27 constexpr void test_construction() {
28 ASSERT_NOEXCEPT(std::default_accessor
<T
>{});
29 [[maybe_unused
]] std::default_accessor
<T
> acc
;
30 static_assert(std::is_trivially_default_constructible_v
<std::default_accessor
<T
>>);
33 constexpr bool test() {
34 test_construction
<int>();
35 test_construction
<const int>();
36 test_construction
<MinimalElementType
>();
37 test_construction
<const MinimalElementType
>();
41 int main(int, char**) {
43 static_assert(test());