diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2014-04-08 18:57:38 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2014-04-08 18:57:38 +0000 |
commit | 04344c0f5cb494db992ce099b2e78caa66cdde11 (patch) | |
tree | 2fe83cd35c4a1192569c09993433fe8a0e464ef9 | |
parent | 687ec9c9dcee6ddb31c45c44b2ba6f95ae7e2e9f (diff) | |
download | clang-04344c0f5cb494db992ce099b2e78caa66cdde11.tar.gz clang-04344c0f5cb494db992ce099b2e78caa66cdde11.tar.bz2 clang-04344c0f5cb494db992ce099b2e78caa66cdde11.tar.xz |
Merging r197428:
------------------------------------------------------------------------
r197428 | rtrieu | 2013-12-16 16:41:30 -0500 (Mon, 16 Dec 2013) | 2 lines
Fix PR18260 - Make std::move handling in -Wconsumed only trigger on std::move
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@205783 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/Consumed.cpp | 3 | ||||
-rw-r--r-- | test/SemaCXX/warn-consumed-analysis.cpp | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/Analysis/Consumed.cpp b/lib/Analysis/Consumed.cpp index b33c8d8930..5e1448d0bf 100644 --- a/lib/Analysis/Consumed.cpp +++ b/lib/Analysis/Consumed.cpp @@ -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; } diff --git a/test/SemaCXX/warn-consumed-analysis.cpp b/test/SemaCXX/warn-consumed-analysis.cpp index 64fdc00dc5..5297981ade 100644 --- a/test/SemaCXX/warn-consumed-analysis.cpp +++ b/test/SemaCXX/warn-consumed-analysis.cpp @@ -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 |