diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc')
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp | 4 | ||||
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/UnusedRAII.cpp | 13 |
2 files changed, 6 insertions, 11 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp b/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp index 7e31e1bd9a7..143c27a98b0 100644 --- a/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp +++ b/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp @@ -60,9 +60,7 @@ void UndelegatedConstructorCheck::registerMatchers(MatchFinder *Finder) { constructExpr(hasDeclaration(constructorDecl(ofClass( recordDecl(baseOfBoundNode("parent")))))) .bind("construct"))), - unless(hasAncestor(decl( - anyOf(recordDecl(ast_matchers::isTemplateInstantiation()), - functionDecl(ast_matchers::isTemplateInstantiation())))))), + unless(isInTemplateInstantiation())), this); } 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); } |

