[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / refwrap / unwrap_ref_decay.pass.cpp
blob7062b2069084fbfaab6ee25d1e0f72dc15d0f405
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 // <functional>
11 // template <class T>
12 // struct unwrap_ref_decay;
14 // template <class T>
15 // using unwrap_ref_decay_t = typename unwrap_ref_decay<T>::type;
17 // UNSUPPORTED: c++03, c++11, c++14, c++17
19 #include <functional>
20 #include <type_traits>
22 #include "test_macros.h"
25 template <typename T, typename Result>
26 void check() {
27 static_assert(std::is_same_v<typename std::unwrap_ref_decay<T>::type, Result>);
28 static_assert(std::is_same_v<typename std::unwrap_ref_decay<T>::type, std::unwrap_ref_decay_t<T>>);
31 struct T { };
33 int main(int, char**) {
34 check<T, T>();
35 check<T&, T>();
36 check<T const, T>();
37 check<T const&, T>();
38 check<T*, T*>();
39 check<T const*, T const*>();
40 check<T[3], T*>();
41 check<T const [3], T const*>();
42 check<T (), T (*)()>();
43 check<T (int) const, T (int) const>();
44 check<T (int) &, T (int) &>();
45 check<T (int) &&, T (int) &&>();
47 check<std::reference_wrapper<T>, T&>();
48 check<std::reference_wrapper<T>&, T&>();
49 check<std::reference_wrapper<T const>, T const&>();
50 check<std::reference_wrapper<T const>&, T const&>();
51 check<std::reference_wrapper<T*>, T*&>();
52 check<std::reference_wrapper<T*>&, T*&>();
53 check<std::reference_wrapper<T const*>, T const*&>();
54 check<std::reference_wrapper<T const*>&, T const*&>();
55 check<std::reference_wrapper<T[3]>, T (&)[3]>();
56 check<std::reference_wrapper<T[3]>&, T (&)[3]>();
57 check<std::reference_wrapper<T ()>, T (&)()>();
58 check<std::reference_wrapper<T ()>&, T (&)()>();
60 return 0;