Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / nullptr16.C
blob0ec0b6a12b6fe02539ae80f46ecd11c7abae5089
1 // { dg-do compile }
2 // { dg-options "-std=c++0x" }
4 // Test template deduction
6 typedef decltype(nullptr) nullptr_t;
8 template <typename T, typename U> struct tType_equal;
9 template <typename T> struct tType_equal<T, T> { typedef void type; };
11 template <typename T, typename U>
12 inline typename tType_equal<T, U>::type
13 type_equal(U) { }
15 template<typename T> T h( T t );
17 void test_h()
19   type_equal<int>(h(0));
20   type_equal<nullptr_t>(h(nullptr));
21   type_equal<float*>(h((float*)nullptr));
22   nullptr_t mynull = 0;
23   type_equal<nullptr_t>(h(mynull));
24   type_equal<float*>(h((float*)mynull));