OSDN Git Service

Some raw string changes from N3077
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / nullptr16.C
1 // { dg-do compile }
2 // { dg-options "-std=c++0x" }
3
4 // Test template deduction
5
6 typedef decltype(nullptr) nullptr_t;
7
8 template <typename T, typename U> struct tType_equal;
9 template <typename T> struct tType_equal<T, T> { typedef void type; };
10
11 template <typename T, typename U>
12 inline typename tType_equal<T, U>::type
13 type_equal(U) { }
14
15 template<typename T> T h( T t );
16
17 void test_h()
18 {
19   type_equal<int>(h(0));
20   type_equal<nullptr_t>(h(nullptr));
21   type_equal<float*>(h((float*)nullptr));
22 }