[clang-tools-extra] 17785cc - [clang-tidy] Fix "expression is redundant [misc-redundant-expression]" warning. NFCI. (PR44768)
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 4 13:38:57 PST 2020
Author: Simon Pilgrim
Date: 2020-02-04T21:36:50Z
New Revision: 17785cc7a105a56900ed827979336944ccfa8c9d
URL: https://github.com/llvm/llvm-project/commit/17785cc7a105a56900ed827979336944ccfa8c9d
DIFF: https://github.com/llvm/llvm-project/commit/17785cc7a105a56900ed827979336944ccfa8c9d.diff
LOG: [clang-tidy] Fix "expression is redundant [misc-redundant-expression]" warning. NFCI. (PR44768)
We only accept tok::TokenKind::comment enum values so no need to add other cases. Seems to be a cut+paste typo.
Added:
Modified:
clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
index da0bef32c091..64e182bbbbc8 100644
--- a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
@@ -42,7 +42,7 @@ SourceLocation forwardSkipWhitespaceAndComments(SourceLocation Loc,
Loc = Loc.getLocWithOffset(1);
tok::TokenKind TokKind = getTokenKind(Loc, SM, Context);
- if (TokKind == tok::NUM_TOKENS || TokKind != tok::comment)
+ if (TokKind != tok::comment)
return Loc;
// Fast-forward current token.
More information about the cfe-commits
mailing list