Author: mboehme Date: Mon Mar 6 03:46:27 2017 New Revision: 297006 URL: http://llvm.org/viewvc/llvm-project?rev=297006&view=rev Log: Revert "[clang-tidy] misc-use-after-move: Fix failing assertion"
This reverts commit r297004; it was causing buildbots to fail. Modified: clang-tools-extra/trunk/clang-tidy/misc/UseAfterMoveCheck.cpp clang-tools-extra/trunk/test/clang-tidy/misc-use-after-move.cpp Modified: clang-tools-extra/trunk/clang-tidy/misc/UseAfterMoveCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UseAfterMoveCheck.cpp?rev=297006&r1=297005&r2=297006&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UseAfterMoveCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/misc/UseAfterMoveCheck.cpp Mon Mar 6 03:46:27 2017 @@ -398,7 +398,7 @@ void UseAfterMoveCheck::check(const Matc const auto *MovingCall = Result.Nodes.getNodeAs<Expr>("moving-call"); const auto *Arg = Result.Nodes.getNodeAs<DeclRefExpr>("arg"); - if (!MovingCall || !MovingCall->getExprLoc().isValid()) + if (!MovingCall) MovingCall = CallMove; Stmt *FunctionBody = nullptr; Modified: clang-tools-extra/trunk/test/clang-tidy/misc-use-after-move.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-use-after-move.cpp?rev=297006&r1=297005&r2=297006&view=diff ============================================================================== --- clang-tools-extra/trunk/test/clang-tidy/misc-use-after-move.cpp (original) +++ clang-tools-extra/trunk/test/clang-tidy/misc-use-after-move.cpp Mon Mar 6 03:46:27 2017 @@ -282,7 +282,7 @@ void moveInInitList() { S s{std::move(a)}; a.foo(); // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved - // CHECK-MESSAGES: [[@LINE-3]]:7: note: move occurred here + // CHECK-MESSAGES: [[@LINE-3]]:6: note: move occurred here } void lambdas() { @@ -397,21 +397,6 @@ void movedTypeIsDependentType() { } template void movedTypeIsDependentType<A>(); -// We handle the case correctly where the move consists of an implicit call -// to a conversion operator. -void implicitConversionOperator() { - struct Convertible { - operator A() && { return A(); } - }; - void takeA(A a); - - Convertible convertible; - takeA(std::move(convertible)); - convertible; - // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'convertible' used after it was moved - // CHECK-MESSAGES: [[@LINE-3]]:9: note: move occurred here -} - // Using decltype on an expression is not a use. void decltypeIsNotUse() { A a; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits