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
fn()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 }
32