Merge pull request #11660 from nkcsgexi/code-expand-trailing

This commit is contained in:
swift-ci
2017-08-28 14:24:35 -07:00
committed by GitHub
2 changed files with 14 additions and 2 deletions

View File

@@ -1481,8 +1481,13 @@ private:
bool walkToStmtPre(Stmt *S) override {
auto SR = S->getSourceRange();
if (SR.isValid() && SM.rangeContainsTokenLoc(SR, TargetLoc)) {
if (!EnclosingCall && !isa<BraceStmt>(S))
OuterStmt = S;
if (!EnclosingCall) {
if (isa<BraceStmt>(S))
// In case OuterStmt is already set, we should clear it to nullptr.
OuterStmt = nullptr;
else
OuterStmt = S;
}
}
return true;
}