Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / nullptr15.C
blob67d9d4a23117fa1e159deca4c673d00c9374820a
1 // { dg-do compile }
2 // { dg-options "-std=c++0x" }
4 // Test template deduction
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 template<typename T> T* g( T* t ); // { dg-message "candidate" }
15 void test_g()
17   // Deduction to nullptr_t, no deduction to pointer type
18   //
19   g(nullptr);               // { dg-error "no matching function for call to " }
20   type_equal<float*>(g((float*)nullptr));
21   decltype(nullptr) mynull = 0;
22   g(mynull);                // { dg-error "no matching function for call to " }
23   type_equal<float*>(g((float*)mynull));