decay.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
1//===----------------------------------------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10// type_traits 11 12// decay 13 14#include <type_traits> 15 16template <class T, class U> 17void test_decay() 18{ 19 static_assert((std::is_same<typename std::decay<T>::type, U>::value), ""); 20} 21 22int main() 23{ 24 test_decay<void, void>(); 25 test_decay<int, int>(); 26 test_decay<const volatile int, int>(); 27 test_decay<int*, int*>(); 28 test_decay<int[3], int*>(); 29 test_decay<const int[3], const int*>(); 30 test_decay<void(), void (*)()>(); 31} 32