annotate gcc/testsuite/g++.dg/cpp0x/nullptr15.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 // Test template deduction
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 template <typename T, typename U> struct tType_equal;
kono
parents:
diff changeset
7 template <typename T> struct tType_equal<T, T> { typedef void type; };
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 template <typename T, typename U>
kono
parents:
diff changeset
10 inline typename tType_equal<T, U>::type
kono
parents:
diff changeset
11 type_equal(U) { }
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 template<typename T> T* g( T* t ); // { dg-message "note" }
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 void test_g()
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 // Deduction to nullptr_t, no deduction to pointer type
kono
parents:
diff changeset
18 //
kono
parents:
diff changeset
19 g(nullptr); // { dg-error "no matching function for call to " }
kono
parents:
diff changeset
20 // { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } .-1 }
kono
parents:
diff changeset
21 type_equal<float*>(g((float*)nullptr));
kono
parents:
diff changeset
22 decltype(nullptr) mynull = 0;
kono
parents:
diff changeset
23 g(mynull); // { dg-error "no matching function for call to " }
kono
parents:
diff changeset
24 // { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } .-1 }
kono
parents:
diff changeset
25 type_equal<float*>(g((float*)mynull));
kono
parents:
diff changeset
26 }