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 //===----------------------------------------------------------------------===//
13 #include <type_traits>
15 #include "test_macros.h"
17 template <class T
, class U
>
20 ASSERT_SAME_TYPE(U
, typename
std::decay
<T
>::type
);
22 ASSERT_SAME_TYPE(U
, std::decay_t
<T
>);
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 (*)()>();
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) &&>();