blob: f601e672820b13cf53687be1a61078cc8f24a0c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// RUN: %check_clang_tidy %s cert-oop54-cpp %t
// Test whether bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField option is set correctly.
class TrivialFields {
public:
TrivialFields &operator=(const TrivialFields &object) {
// CHECK-MESSAGES: [[@LINE-1]]:18: warning: operator=() does not handle self-assignment properly [cert-oop54-cpp]
return *this;
}
private:
int m;
float f;
double d;
bool b;
};
|