diff options
author | Sergio Martins <smartins@kde.org> | 2018-01-08 18:21:59 +0000 |
---|---|---|
committer | Sergio Martins <iamsergio@gmail.com> | 2018-01-08 18:26:34 +0000 |
commit | 0e86a561361f1cafc2680d3966cd126c5cd9034e (patch) | |
tree | 50954efb36e3bfba1d089b49cc58c73af3641499 /src | |
parent | deac882e9d882bd1c95e8e3f5b848c92022eba59 (diff) |
rule-of-three: Don't warn if either copy-assign or copy-ctor is deleted
It's safe, as it won't happen that one of the user-methods will do
something different from the compiler-generated-method, as one of
them can't be called.
BUG: 388677
Diffstat (limited to 'src')
-rw-r--r-- | src/checks/level2/ruleofthree.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/checks/level2/ruleofthree.cpp b/src/checks/level2/ruleofthree.cpp index dfd2ed8b..3794d5ac 100644 --- a/src/checks/level2/ruleofthree.cpp +++ b/src/checks/level2/ruleofthree.cpp @@ -104,7 +104,7 @@ void RuleOfThree::VisitDecl(clang::Decl *decl) const bool copyCtorIsDeleted = copyCtor && copyCtor->isDeleted(); const bool copyAssignIsDeleted = copyAssign && copyAssign->isDeleted(); - if (copyCtorIsDeleted && copyAssignIsDeleted) // They were explicitely deleted, it's safe. + if (copyCtorIsDeleted || copyAssignIsDeleted) // One of them was explicitely deleted, it's safe. return; if (Utils::functionHasEmptyBody(destructor)) { |