Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CXX / over / over.built / p17.cpp
blob139e864475244832fddb27cfc6abdecf2a968b99
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) {
6 (void)(a == a);
7 (void)(a != a);
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}}
13 (void)(a == b);
14 (void)(a != b);
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}}
20 (void)(b == a);
21 (void)(b != a);
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}}
27 (void)(a == pi);
28 (void)(a != pi);
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}}
34 (void)(pi == a);
35 (void)(pi != a);
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}}
41 (void)(b == pi);
42 (void)(b != pi);
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}}
48 (void)(pi == b);
49 (void)(pi != b);
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}}
55 (void)(b == b);
56 (void)(b != b);
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}}
62 (void)(pi == pi);
63 (void)(pi != pi);
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}}