[OpenMP] Adjust 'printf' handling in the OpenMP runtime (#123670)
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.unary.prop.query / void_t.pass.cpp
blob4303901caaf2a7a99c9dfa115499ca2d0086b2cd
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 // void_t
13 // UNSUPPORTED: c++03, c++11, c++14
15 #include <type_traits>
17 #include "test_macros.h"
19 template <class T>
20 void test1()
22 ASSERT_SAME_TYPE(void, std::void_t<T>);
23 ASSERT_SAME_TYPE(void, std::void_t<const T>);
24 ASSERT_SAME_TYPE(void, std::void_t<volatile T>);
25 ASSERT_SAME_TYPE(void, std::void_t<const volatile T>);
28 template <class T, class U>
29 void test2()
31 ASSERT_SAME_TYPE(void, std::void_t<T, U>);
32 ASSERT_SAME_TYPE(void, std::void_t<const T, U>);
33 ASSERT_SAME_TYPE(void, std::void_t<volatile T, U>);
34 ASSERT_SAME_TYPE(void, std::void_t<const volatile T, U>);
36 ASSERT_SAME_TYPE(void, std::void_t<U, T>);
37 ASSERT_SAME_TYPE(void, std::void_t<U, const T>);
38 ASSERT_SAME_TYPE(void, std::void_t<U, volatile T>);
39 ASSERT_SAME_TYPE(void, std::void_t<U, const volatile T>);
41 ASSERT_SAME_TYPE(void, std::void_t<T, const U>);
42 ASSERT_SAME_TYPE(void, std::void_t<const T, const U>);
43 ASSERT_SAME_TYPE(void, std::void_t<volatile T, const U>);
44 ASSERT_SAME_TYPE(void, std::void_t<const volatile T, const U>);
47 class Class
49 public:
50 ~Class();
53 int main(int, char**)
55 ASSERT_SAME_TYPE(void, std::void_t<>);
57 test1<void>();
58 test1<int>();
59 test1<double>();
60 test1<int&>();
61 test1<Class>();
62 test1<Class[]>();
63 test1<Class[5]>();
65 test2<void, int>();
66 test2<double, int>();
67 test2<int&, int>();
68 test2<Class&, bool>();
69 test2<void *, int&>();
71 ASSERT_SAME_TYPE(void, std::void_t<int, double const &, Class, volatile int[], void>);
73 return 0;