1 // RUN: %clang_cc1 -std=c++11 -verify %s -Wno-tautological-compare
3 struct A
{ operator decltype(nullptr)(); };
4 struct B
{ operator int A::*(); };
5 void f(A a
, B b
, int A::*pi
) {
8 (void)(a
< a
); // expected-error {{invalid operands}}
9 (void)(a
> a
); // expected-error {{invalid operands}}
10 (void)(a
<= a
); // expected-error {{invalid operands}}
11 (void)(a
>= a
); // expected-error {{invalid operands}}
15 (void)(a
< b
); // expected-error {{invalid operands}}
16 (void)(a
> b
); // expected-error {{invalid operands}}
17 (void)(a
<= b
); // expected-error {{invalid operands}}
18 (void)(a
>= b
); // expected-error {{invalid operands}}
22 (void)(b
< a
); // expected-error {{invalid operands}}
23 (void)(b
> a
); // expected-error {{invalid operands}}
24 (void)(b
<= a
); // expected-error {{invalid operands}}
25 (void)(b
>= a
); // expected-error {{invalid operands}}
29 (void)(a
< pi
); // expected-error {{invalid operands}}
30 (void)(a
> pi
); // expected-error {{invalid operands}}
31 (void)(a
<= pi
); // expected-error {{invalid operands}}
32 (void)(a
>= pi
); // expected-error {{invalid operands}}
36 (void)(pi
< a
); // expected-error {{invalid operands}}
37 (void)(pi
> a
); // expected-error {{invalid operands}}
38 (void)(pi
<= a
); // expected-error {{invalid operands}}
39 (void)(pi
>= a
); // expected-error {{invalid operands}}
43 (void)(b
< pi
); // expected-error {{invalid operands}}
44 (void)(b
> pi
); // expected-error {{invalid operands}}
45 (void)(b
<= pi
); // expected-error {{invalid operands}}
46 (void)(b
>= pi
); // expected-error {{invalid operands}}
50 (void)(pi
< b
); // expected-error {{invalid operands}}
51 (void)(pi
> b
); // expected-error {{invalid operands}}
52 (void)(pi
<= b
); // expected-error {{invalid operands}}
53 (void)(pi
>= b
); // expected-error {{invalid operands}}
57 (void)(b
< b
); // expected-error {{invalid operands}}
58 (void)(b
> b
); // expected-error {{invalid operands}}
59 (void)(b
<= b
); // expected-error {{invalid operands}}
60 (void)(b
>= b
); // expected-error {{invalid operands}}
64 (void)(pi
< pi
); // expected-error {{invalid operands}}
65 (void)(pi
> pi
); // expected-error {{invalid operands}}
66 (void)(pi
<= pi
); // expected-error {{invalid operands}}
67 (void)(pi
>= pi
); // expected-error {{invalid operands}}
70 // FIXME: This is wrong: type T = 'const volatile int * const A::* const B::*'
71 // would work here, and there exists a builtin candidate for that type.
72 struct C
{ operator const int *A::*B::*(); };
73 void g(C c
, volatile int *A::*B::*p
) {
74 (void)(c
== p
); // expected-error {{invalid operands}}