[LoongArch] Supports FP_TO_SINT operation for fp16 (#118303)
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.trans / meta.trans.other / decay.pass.cpp
blobd07a136a59475ca5c4318e7e32744088c62fea9f
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 // decay
13 #include <type_traits>
15 #include "test_macros.h"
17 template <class T, class U>
18 void test_decay()
20 ASSERT_SAME_TYPE(U, typename std::decay<T>::type);
21 #if TEST_STD_VER > 11
22 ASSERT_SAME_TYPE(U, std::decay_t<T>);
23 #endif
26 int main(int, char**)
28 test_decay<void, void>();
29 test_decay<int, int>();
30 test_decay<const volatile int, int>();
31 test_decay<int*, int*>();
32 test_decay<int&, int>();
33 test_decay<const volatile int&, int>();
34 test_decay<int[3], int*>();
35 test_decay<const int[3], const int*>();
36 test_decay<void(), void (*)()>();
37 #if TEST_STD_VER > 11
38 test_decay<int&&, int>();
39 test_decay<const volatile int&&, int>();
40 test_decay<int(int) const, int(int) const>();
41 test_decay<int(int) volatile, int(int) volatile>();
42 test_decay<int(int) &, int(int) &>();
43 test_decay<int(int) &&, int(int) &&>();
44 #endif
46 return 0;