[llvm-branch-commits] [cfe-branch] r205783 - Merging r197428:

Tom Stellard thomas.stellard at amd.com
Tue Apr 8 11:57:38 PDT 2014


Author: tstellar
Date: Tue Apr  8 13:57:38 2014
New Revision: 205783

URL: http://llvm.org/viewvc/llvm-project?rev=205783&view=rev
Log:
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

------------------------------------------------------------------------

Modified:
    cfe/branches/release_34/lib/Analysis/Consumed.cpp
    cfe/branches/release_34/test/SemaCXX/warn-consumed-analysis.cpp

Modified: cfe/branches/release_34/lib/Analysis/Consumed.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/Analysis/Consumed.cpp?rev=205783&r1=205782&r2=205783&view=diff
==============================================================================
--- cfe/branches/release_34/lib/Analysis/Consumed.cpp (original)
+++ cfe/branches/release_34/lib/Analysis/Consumed.cpp Tue Apr  8 13:57:38 2014
@@ -611,7 +611,8 @@ void ConsumedStmtVisitor::VisitCallExpr(
     
     // 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;
     }

Modified: cfe/branches/release_34/test/SemaCXX/warn-consumed-analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/test/SemaCXX/warn-consumed-analysis.cpp?rev=205783&r1=205782&r2=205783&view=diff
==============================================================================
--- cfe/branches/release_34/test/SemaCXX/warn-consumed-analysis.cpp (original)
+++ cfe/branches/release_34/test/SemaCXX/warn-consumed-analysis.cpp Tue Apr  8 13:57:38 2014
@@ -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





More information about the llvm-branch-commits mailing list