This is especially crucial for reports related to use-after-move of
standard library objects.
rdar://problem/
47338505
Differential Revision: https://reviews.llvm.org/D56824
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351500
91177308-0d34-0410-b5e6-
96231b3b80d8
std::string MethodName = MethodDec->getName().lower();
// TODO: Some of these methods (eg., resize) are not always resetting
// the state, so we should consider looking at the arguments.
- if (MethodName == "reset" || MethodName == "clear" ||
- MethodName == "destroy" || MethodName == "resize" ||
- MethodName == "shrink")
+ if (MethodName == "assign" || MethodName == "clear" ||
+ MethodName == "destroy" || MethodName == "reset" ||
+ MethodName == "resize" || MethodName == "shrink")
return true;
}
return false;
void destroy();
void clear();
void resize(std::size_t);
+ void assign(const A &);
bool empty() const;
bool isEmpty() const;
operator bool() const;
a.foo(); // no-warning
a.b.foo(); // no-warning
}
+ {
+ A a;
+ A b = std::move(a);
+ a.assign(A()); // no-warning
+ a.foo(); // no-warning
+ a.b.foo(); // no-warning
+ }
}
// Moves or uses that occur as part of template arguments.