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 //===----------------------------------------------------------------------===//
11 // template <class T, class... Args>
12 // struct is_trivially_constructible;
14 #include <type_traits>
15 #include "test_macros.h"
18 void test_is_trivially_constructible()
20 static_assert(( std::is_trivially_constructible
<T
>::value
), "");
22 static_assert(( std::is_trivially_constructible_v
<T
>), "");
26 template <class T
, class A0
>
27 void test_is_trivially_constructible()
29 static_assert(( std::is_trivially_constructible
<T
, A0
>::value
), "");
31 static_assert(( std::is_trivially_constructible_v
<T
, A0
>), "");
36 void test_is_not_trivially_constructible()
38 static_assert((!std::is_trivially_constructible
<T
>::value
), "");
40 static_assert((!std::is_trivially_constructible_v
<T
>), "");
44 template <class T
, class A0
>
45 void test_is_not_trivially_constructible()
47 static_assert((!std::is_trivially_constructible
<T
, A0
>::value
), "");
49 static_assert((!std::is_trivially_constructible_v
<T
, A0
>), "");
53 template <class T
, class A0
, class A1
>
54 void test_is_not_trivially_constructible()
56 static_assert((!std::is_trivially_constructible
<T
, A0
, A1
>::value
), "");
58 static_assert((!std::is_trivially_constructible_v
<T
, A0
, A1
>), "");
70 test_is_trivially_constructible
<int> ();
71 test_is_trivially_constructible
<int, const int&> ();
73 test_is_not_trivially_constructible
<A
, int> ();
74 test_is_not_trivially_constructible
<A
, int, double> ();
75 test_is_not_trivially_constructible
<A
> ();