[clang-tidy] Bugfix for readability-redundant-control-flow check
This check did not create FixItHints when the statement before the redundant
control flow was not followed by a semicolon.
Patch by Malcolm Parsons!
Reviewers: alexfh
Differential Revision: https://reviews.llvm.org/D24500
llvm-svn: 281713
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp
index 54a26e2..22f1111 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp
@@ -83,7 +83,7 @@
dyn_cast<Stmt>(*Previous)->getLocEnd(), tok::semi, SM,
Result.Context->getLangOpts(),
/*SkipTrailingWhitespaceAndNewLine=*/true);
- else
+ if (!Start.isValid())
Start = StmtRange.getBegin();
auto RemovedRange = CharSourceRange::getCharRange(
Start,