summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
diff options
context:
space:
mode:
authorMarek Kurdej <marek.kurdej@gmail.com>2016-10-14 08:10:08 +0000
committerMarek Kurdej <marek.kurdej@gmail.com>2016-10-14 08:10:08 +0000
commit505434bd28625fcfbacf32798381d75e4acbdc6c (patch)
treee3f35a3184c3964cc1180915f42cd22dab3f0509 /clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
parent174d2e784b0688d281c1eece3d6ee17be8868945 (diff)
downloadbcm5719-llvm-505434bd28625fcfbacf32798381d75e4acbdc6c.tar.gz
bcm5719-llvm-505434bd28625fcfbacf32798381d75e4acbdc6c.zip
[clang-tidy] Fix readability-braces-around-statements false positive
Summary: This fixes a false-positive e.g. when string literals are returned from if statement. This patch includes as well a small fix to includes and renames of the test suite that collided with the name of the check. Reviewers: alexfh, hokein Subscribers: hokein Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D25558 llvm-svn: 284212
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
index d65f60ba5bd..5186c0b1f61 100644
--- a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
@@ -61,7 +61,7 @@ SourceLocation findEndLocation(SourceLocation LastTokenLoc,
bool SkipEndWhitespaceAndComments = true;
tok::TokenKind TokKind = getTokenKind(Loc, SM, Context);
if (TokKind == tok::NUM_TOKENS || TokKind == tok::semi ||
- TokKind == tok::r_brace) {
+ TokKind == tok::r_brace || isStringLiteral(TokKind)) {
// If we are at ";" or "}", we found the last token. We could use as well
// `if (isa<NullStmt>(S))`, but it wouldn't work for nested statements.
SkipEndWhitespaceAndComments = false;
OpenPOWER on IntegriCloud