Fix PR18260 - Make std::move handling in -Wconsumed only trigger on std::move
llvm-svn: 197428
This commit is contained in:
parent
8a91f2fd85
commit
31f3a713ae
|
@ -611,7 +611,8 @@ void ConsumedStmtVisitor::VisitCallExpr(const CallExpr *Call) {
|
|||
|
||||
// Special case for the std::move function.
|
||||
// TODO: Make this more specific. (Deferred)
|
||||
if (FunDecl->getNameAsString() == "move") {
|
||||
if (FunDecl->getQualifiedNameAsString() == "std::move" &&
|
||||
Call->getNumArgs() == 1) {
|
||||
forwardInfo(Call->getArg(0), Call);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -793,3 +793,22 @@ void testTemporariesAndOperators2() {
|
|||
|
||||
} // end namespace InitializerAssertionFailTest
|
||||
|
||||
|
||||
namespace std {
|
||||
void move();
|
||||
template<class T>
|
||||
void move(T&&);
|
||||
}
|
||||
|
||||
namespace PR18260 {
|
||||
class X {
|
||||
public:
|
||||
void move();
|
||||
} x;
|
||||
|
||||
void test() {
|
||||
x.move();
|
||||
std::move();
|
||||
std::move(x);
|
||||
}
|
||||
} // end namespace PR18260
|
||||
|
|
Loading…
Reference in New Issue