Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/overload/builtin4.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 // DR 1512 | |
2 // PR c++/87699 | |
3 // { dg-do compile { target c++11 } } | |
4 | |
5 using nullptr_t = decltype(nullptr); | |
6 | |
7 template<typename T> | |
8 struct S { operator T(); }; | |
9 | |
10 void | |
11 fn () | |
12 { | |
13 S<nullptr_t> s; | |
14 // Make sure we create a builtin operator overload candidate for == and !=. | |
15 if (s == s) { } | |
16 if (s != s) { } | |
17 | |
18 // But not for these. | |
19 if (s > s) { } // { dg-error "no match for" } | |
20 if (s < s) { } // { dg-error "no match for" } | |
21 if (s <= s) { } // { dg-error "no match for" } | |
22 if (s >= s) { } // { dg-error "no match for" } | |
23 | |
24 S<int *> r; | |
25 if (s == r) { } // { dg-error "no match for" } | |
26 if (s != r) { } // { dg-error "no match for" } | |
27 if (s > r) { } // { dg-error "no match for" } | |
28 if (s < r) { } // { dg-error "no match for" } | |
29 if (s >= r) { } // { dg-error "no match for" } | |
30 if (s <= r) { } // { dg-error "no match for" } | |
31 } |