| 1 | // RUN: %check_clang_tidy %s fuchsia-overloaded-operator %t |
| 2 | |
| 3 | class A { |
| 4 | public: |
| 5 | int operator+(int); |
| 6 | // CHECK-MESSAGES: [[@LINE-1]]:3: warning: overloading 'operator+' is disallowed |
| 7 | }; |
| 8 | |
| 9 | class B { |
| 10 | public: |
| 11 | B &operator=(const B &Other); |
| 12 | // CHECK-MESSAGES-NOT: [[@LINE-1]]:3: warning: overloading 'operator=' is disallowed |
| 13 | B &operator=(B &&Other); |
| 14 | // CHECK-MESSAGES-NOT: [[@LINE-1]]:3: warning: overloading 'operator=' is disallowed |
| 15 | }; |
| 16 | |
| 17 | A operator-(const A &A1, const A &A2); |
| 18 | // CHECK-MESSAGES: [[@LINE-1]]:1: warning: overloading 'operator-' is disallowed |
| 19 | |
| 20 | void operator delete(void*, void*) throw(); |
| 21 | // CHECK-MESSAGES: [[@LINE-1]]:1: warning: overloading 'operator delete' is disallowed |
| 22 | |
| 23 | auto x = []{}; |
| 24 | |