Add support for C++0x nullptr.
[official-gcc/constexpr.git] / gcc / testsuite / g++.dg / cpp0x / nullptr16.C
blob7561b21cfe3628c412b90ca4b700ea28fb33767a
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));