1 //===- STLForwardCompatTest.cpp - Unit tests for STLForwardCompat ---------===//
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 //===----------------------------------------------------------------------===//
9 #include "llvm/ADT/STLForwardCompat.h"
10 #include "gtest/gtest.h"
15 class STLForwardCompatRemoveCVRefTest
: public ::testing::Test
{};
17 using STLForwardCompatRemoveCVRefTestTypes
= ::testing::Types
<
20 std::pair
<int &, int>,
21 std::pair
<const int, int>,
22 std::pair
<volatile int, int>,
23 std::pair
<const volatile int &, int>,
24 std::pair
<int *, int *>,
25 std::pair
<int *const, int *>,
26 std::pair
<const int *, const int *>,
27 std::pair
<int *&, int *>
31 TYPED_TEST_SUITE(STLForwardCompatRemoveCVRefTest
,
32 STLForwardCompatRemoveCVRefTestTypes
, );
34 TYPED_TEST(STLForwardCompatRemoveCVRefTest
, RemoveCVRef
) {
35 using From
= typename
TypeParam::first_type
;
36 using To
= typename
TypeParam::second_type
;
38 (std::is_same
<typename
llvm::remove_cvref
<From
>::type
, To
>::value
));
41 TYPED_TEST(STLForwardCompatRemoveCVRefTest
, RemoveCVRefT
) {
42 using From
= typename
TypeParam::first_type
;
43 EXPECT_TRUE((std::is_same
<typename
llvm::remove_cvref
<From
>::type
,
44 llvm::remove_cvref_t
<From
>>::value
));