Fix PR18260 - Make std::move handling in -Wconsumed only trigger on std::move

llvm-svn: 197428
This commit is contained in:
Richard Trieu 2013-12-16 21:41:30 +00:00
parent 8a91f2fd85
commit 31f3a713ae
2 changed files with 21 additions and 1 deletions

View File

@ -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;
}

View File

@ -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