[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / refwrap / unwrap_reference.pass.cpp
blob82bf213012a7eda0afc8dd239ff1183459a0d996
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_reference;
14 // template <class T>
15 // using unwrap_reference_t = typename unwrap_reference<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 Expected>
26 void check_equal() {
27 static_assert(std::is_same_v<typename std::unwrap_reference<T>::type, Expected>);
28 static_assert(std::is_same_v<typename std::unwrap_reference<T>::type, std::unwrap_reference_t<T>>);
31 template <typename T>
32 void check() {
33 check_equal<T, T>();
34 check_equal<T&, T&>();
35 check_equal<T const, T const>();
36 check_equal<T const&, T const&>();
38 check_equal<std::reference_wrapper<T>, T&>();
39 check_equal<std::reference_wrapper<T const>, T const&>();
42 struct T { };
44 int main(int, char**) {
45 check<T>();
46 check<int>();
47 check<float>();
49 check<T*>();
50 check<int*>();
51 check<float*>();
53 return 0;