Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.unary / meta.unary.prop / is_trivially_constructible.pass.cpp
blob42d54bd7e25a129463ac8a43d43ee0b2d7bec434
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // type_traits
11 // template <class T, class... Args>
12 // struct is_trivially_constructible;
14 #include <type_traits>
15 #include "test_macros.h"
17 template <class T>
18 void test_is_trivially_constructible()
20 static_assert(( std::is_trivially_constructible<T>::value), "");
21 #if TEST_STD_VER > 14
22 static_assert(( std::is_trivially_constructible_v<T>), "");
23 #endif
26 template <class T, class A0>
27 void test_is_trivially_constructible()
29 static_assert(( std::is_trivially_constructible<T, A0>::value), "");
30 #if TEST_STD_VER > 14
31 static_assert(( std::is_trivially_constructible_v<T, A0>), "");
32 #endif
35 template <class T>
36 void test_is_not_trivially_constructible()
38 static_assert((!std::is_trivially_constructible<T>::value), "");
39 #if TEST_STD_VER > 14
40 static_assert((!std::is_trivially_constructible_v<T>), "");
41 #endif
44 template <class T, class A0>
45 void test_is_not_trivially_constructible()
47 static_assert((!std::is_trivially_constructible<T, A0>::value), "");
48 #if TEST_STD_VER > 14
49 static_assert((!std::is_trivially_constructible_v<T, A0>), "");
50 #endif
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), "");
57 #if TEST_STD_VER > 14
58 static_assert((!std::is_trivially_constructible_v<T, A0, A1>), "");
59 #endif
62 struct A
64 explicit A(int);
65 A(int, double);
68 int main(int, char**)
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> ();
77 return 0;