[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / member-operator-expr.cpp
blobc98ef7399709cd3b82baf2f135d7bbfdf56a6352
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 class X {
4 public:
5 int operator++();
6 operator int();
7 };
9 void test() {
10 X x;
11 int i;
13 i = x.operator++();
14 i = x.operator int();
15 x.operator--(); // expected-error{{no member named 'operator--'}}
16 x.operator float(); // expected-error{{no member named 'operator float'}}
17 x.operator; // expected-error{{expected a type}}
20 void test2() {
21 X *x;
22 int i;
24 i = x->operator++();
25 i = x->operator int();
26 x->operator--(); // expected-error{{no member named 'operator--'}}
27 x->operator float(); // expected-error{{no member named 'operator float'}}
28 x->operator; // expected-error{{expected a type}}
31 namespace pr13157 {
32 class A { public: void operator()(int x, int y = 2, ...) {} };
33 void f() { A()(1); }