Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / cpp0x / nullptr16.C
blob62029b3a9070bdc51ec7f9c35ec8d1b286113e45
1 // { dg-do compile { target c++11 } }
3 // Test template deduction
5 typedef decltype(nullptr) nullptr_t;
7 template <typename T, typename U> struct tType_equal;
8 template <typename T> struct tType_equal<T, T> { typedef void type; };
10 template <typename T, typename U>
11 inline typename tType_equal<T, U>::type
12 type_equal(U) { }
14 template<typename T> T h( T t );
16 void test_h()
18   type_equal<int>(h(0));
19   type_equal<nullptr_t>(h(nullptr));
20   type_equal<float*>(h((float*)nullptr));
21   nullptr_t mynull = 0;
22   type_equal<nullptr_t>(h(mynull));
23   type_equal<float*>(h((float*)mynull));