[clang-tools-extra] r263900 - [clang-tidy] Update check for API change in r263895.
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 20 07:24:49 PDT 2016
Author: d0k
Date: Sun Mar 20 09:24:49 2016
New Revision: 263900
URL: http://llvm.org/viewvc/llvm-project?rev=263900&view=rev
Log:
[clang-tidy] Update check for API change in r263895.
for range stmts now have split begin and ends, just apply OR to the
condition. Should unbreak the build.
Modified:
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp?rev=263900&r1=263899&r2=263900&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp Sun Mar 20 09:24:49 2016
@@ -18,8 +18,10 @@ namespace tidy {
AST_MATCHER_P(CXXForRangeStmt, hasRangeBeginEndStmt,
ast_matchers::internal::Matcher<DeclStmt>, InnerMatcher) {
- const DeclStmt *const Stmt = Node.getBeginEndStmt();
- return (Stmt != nullptr && InnerMatcher.matches(*Stmt, Finder, Builder));
+ for (const DeclStmt *Stmt : {Node.getBeginStmt(), Node.getEndStmt()})
+ if (Stmt != nullptr && InnerMatcher.matches(*Stmt, Finder, Builder))
+ return true;
+ return false;
}
AST_MATCHER(Stmt, isInsideOfRangeBeginEndStmt) {
More information about the cfe-commits
mailing list