aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/readability
diff options
context:
space:
mode:
authorMalcolm Parsons <malcolm.parsons@gmail.com>2017-11-28 14:57:47 +0000
committerMalcolm Parsons <malcolm.parsons@gmail.com>2017-11-28 14:57:47 +0000
commit690f486bb72ecc4f96dcc2e8f8a39c8a175c97d4 (patch)
tree7c4888acc072803689e0e7c5bf7c264f5195b697 /clang-tidy/readability
parentdc4a8734e84ea860b335752d952be77228b112dc (diff)
[clang-tidy] Ignore ExprWithCleanups when looking for else-after-throw
Summary: The readability-else-after-return check was not warning about an else after a throw of an exception that had arguments that needed to be cleaned up. Reviewers: aaron.ballman, alexfh, djasper Reviewed By: aaron.ballman Subscribers: lebedev.ri, klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D40505 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@319174 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/readability')
-rw-r--r--clang-tidy/readability/ElseAfterReturnCheck.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tidy/readability/ElseAfterReturnCheck.cpp b/clang-tidy/readability/ElseAfterReturnCheck.cpp
index 6c676636..8b5526ca 100644
--- a/clang-tidy/readability/ElseAfterReturnCheck.cpp
+++ b/clang-tidy/readability/ElseAfterReturnCheck.cpp
@@ -21,7 +21,8 @@ namespace readability {
void ElseAfterReturnCheck::registerMatchers(MatchFinder *Finder) {
const auto ControlFlowInterruptorMatcher =
stmt(anyOf(returnStmt().bind("return"), continueStmt().bind("continue"),
- breakStmt().bind("break"), cxxThrowExpr().bind("throw")));
+ breakStmt().bind("break"),
+ expr(ignoringImplicit(cxxThrowExpr().bind("throw")))));
Finder->addMatcher(
compoundStmt(forEach(
ifStmt(hasThen(stmt(