Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/nullptr14.C

raw
1 // { dg-do compile { target c++11 } }
2
3 // Test overload preference char*/int
4
5 template <typename T, typename U> struct tType_equal;
6 template <typename T> struct tType_equal<T, T> { typedef void type; };
7
8 template <typename T, typename U>
9 inline typename tType_equal<T, U>::type
10 type_equal(U) { }
11
12 char* f( char* );
13 int f( int );
14 long int f( long int );
15
16 void test_f()
17 {
18 // Overloading cases
19 //
20 type_equal<char*>(f(nullptr));
21 type_equal<int>(f(0));
22 decltype(nullptr) mynull = 0;
23 type_equal<char*>(f(mynull));
24 }