Skip to content

Commit

Permalink
Revert "[clang-tidy] misc-use-after-move: Fix failing assertion"
Browse files Browse the repository at this point in the history
This reverts commit r297004; it was causing buildbots to fail.

llvm-svn: 297006
  • Loading branch information
martinboehme committed Mar 6, 2017
1 parent 3bf6fc2 commit 2e5f130
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ void UseAfterMoveCheck::check(const MatchFinder::MatchResult &Result) {
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;
Expand Down
17 changes: 1 addition & 16 deletions clang-tools-extra/test/clang-tidy/misc-use-after-move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2e5f130

Please sign in to comment.