1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 #include <type_traits>
16 #include "test_macros.h"
18 template <class T, class U>
19 void test_remove_volatile_imp()
21 static_assert((std::is_same<typename std::remove_volatile<T>::type, U>::value), "");
23 static_assert((std::is_same<std::remove_volatile_t<T>, U>::value), "");
28 void test_remove_volatile()
30 test_remove_volatile_imp<T, T>();
31 test_remove_volatile_imp<const T, const T>();
32 test_remove_volatile_imp<volatile T, T>();
33 test_remove_volatile_imp<const volatile T, const T>();
38 test_remove_volatile<void>();
39 test_remove_volatile<int>();
40 test_remove_volatile<int[3]>();
41 test_remove_volatile<int&>();
42 test_remove_volatile<const int&>();
43 test_remove_volatile<int*>();
44 test_remove_volatile<volatile int*>();