Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / nullptr14.C
blob4c4627b541b0a0ddc660ddba42ba72d2ae043ae5
1 // { dg-do compile }
2 // { dg-options "-std=c++0x" }
4 // Test overload preference char*/int
6 template <typename T, typename U> struct tType_equal;
7 template <typename T> struct tType_equal<T, T> { typedef void type; };
9 template <typename T, typename U>
10 inline typename tType_equal<T, U>::type
11 type_equal(U) { }
13 char* f( char* );
14 int f( int );
15 long int f( long int );
17 void test_f()
19   // Overloading cases
20   //
21   type_equal<char*>(f(nullptr));
22   type_equal<int>(f(0));
23   decltype(nullptr) mynull = 0;
24   type_equal<char*>(f(mynull));