46 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// type_traits10 11// remove_pointer12 13#include <type_traits>14#include "test_macros.h"15 16template <class T, class U>17void test_remove_pointer()18{19 ASSERT_SAME_TYPE(U, typename std::remove_pointer<T>::type);20#if TEST_STD_VER > 1121 ASSERT_SAME_TYPE(U, std::remove_pointer_t<T>);22#endif23}24 25int main(int, char**)26{27 test_remove_pointer<void, void>();28 test_remove_pointer<int, int>();29 test_remove_pointer<int[3], int[3]>();30 test_remove_pointer<int*, int>();31 test_remove_pointer<const int*, const int>();32 test_remove_pointer<int**, int*>();33 test_remove_pointer<int** const, int*>();34 test_remove_pointer<int*const * , int* const>();35 test_remove_pointer<const int** , const int*>();36 37 test_remove_pointer<int&, int&>();38 test_remove_pointer<const int&, const int&>();39 test_remove_pointer<int(&)[3], int(&)[3]>();40 test_remove_pointer<int(*)[3], int[3]>();41 test_remove_pointer<int*&, int*&>();42 test_remove_pointer<const int*&, const int*&>();43 44 return 0;45}46