diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-03 13:30:28 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-03 13:30:28 +0000 |
| commit | 6bcbe6e04d0ff61e3eec9eb01d3c535fd2f78a38 (patch) | |
| tree | 09812252794454f36e99d0d56827f2bef1d6bcb2 /clang-tools-extra/clang-tidy/misc/UnusedRAII.cpp | |
| parent | b7f59d6bbd6c97b6d35467fcce635fc4884d230b (diff) | |
| download | bcm5719-llvm-6bcbe6e04d0ff61e3eec9eb01d3c535fd2f78a38.tar.gz bcm5719-llvm-6bcbe6e04d0ff61e3eec9eb01d3c535fd2f78a38.zip | |
[clang-tidy] Eliminate inline copies of InTemplateInstantiation matcher.
llvm-svn: 217036
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/UnusedRAII.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/UnusedRAII.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedRAII.cpp b/clang-tools-extra/clang-tidy/misc/UnusedRAII.cpp index 1aabf6a10ba..41327b65bb5 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedRAII.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedRAII.cpp @@ -29,14 +29,11 @@ void UnusedRAIICheck::registerMatchers(MatchFinder *Finder) { // those returned from a call. auto BindTemp = bindTemporaryExpr(unless(has(callExpr()))).bind("temp"); Finder->addMatcher( - exprWithCleanups( - unless(hasAncestor(decl( - anyOf(recordDecl(ast_matchers::isTemplateInstantiation()), - functionDecl(ast_matchers::isTemplateInstantiation()))))), - hasParent(compoundStmt().bind("compound")), - hasType(recordDecl(hasUserDeclaredDestructor())), - anyOf(has(BindTemp), has(functionalCastExpr(has(BindTemp))))) - .bind("expr"), + exprWithCleanups(unless(isInTemplateInstantiation()), + hasParent(compoundStmt().bind("compound")), + hasType(recordDecl(hasUserDeclaredDestructor())), + anyOf(has(BindTemp), has(functionalCastExpr( + has(BindTemp))))).bind("expr"), this); } |

