]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/nullptr16.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / nullptr16.C
1 // { dg-do compile { target c++11 } }
2
3 // Test template deduction
4
5 typedef decltype(nullptr) nullptr_t;
6
7 template <typename T, typename U> struct tType_equal;
8 template <typename T> struct tType_equal<T, T> { typedef void type; };
9
10 template <typename T, typename U>
11 inline typename tType_equal<T, U>::type
12 type_equal(U) { }
13
14 template<typename T> T h( T t );
15
16 void test_h()
17 {
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));
24 }
This page took 0.039763 seconds and 5 git commands to generate.