summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/google
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/google')
-rw-r--r--clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp5
-rw-r--r--clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp4
-rw-r--r--clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp8
3 files changed, 3 insertions, 14 deletions
diff --git a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
index 102b5bb9966..bb015abd3d8 100644
--- a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
@@ -28,10 +28,7 @@ AvoidCStyleCastsCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {
// FIXME: Remove this once this is fixed in the AST.
unless(hasParent(substNonTypeTemplateParmExpr())),
// Avoid matches in template instantiations.
- unless(hasAncestor(decl(
- anyOf(recordDecl(ast_matchers::isTemplateInstantiation()),
- functionDecl(ast_matchers::isTemplateInstantiation()))))))
- .bind("cast"),
+ unless(isInTemplateInstantiation())).bind("cast"),
this);
}
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
index 1331c57142a..d09be299ebc 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
@@ -30,9 +30,7 @@ ExplicitMakePairCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {
// Look for std::make_pair with explicit template args. Ignore calls in
// templates.
Finder->addMatcher(
- callExpr(unless(hasAncestor(decl(anyOf(
- recordDecl(ast_matchers::isTemplateInstantiation()),
- functionDecl(ast_matchers::isTemplateInstantiation()))))),
+ callExpr(unless(isInTemplateInstantiation()),
callee(expr(ignoringParenImpCasts(
declRefExpr(hasExplicitTemplateArgs(),
to(functionDecl(hasName("::std::make_pair"))))
diff --git a/clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp b/clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp
index 4a06dc8d6bb..62f3096cab0 100644
--- a/clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp
@@ -19,13 +19,7 @@ namespace tidy {
namespace readability {
void NamedParameterCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {
- Finder->addMatcher(
- functionDecl(
- unless(hasAncestor(decl(
- anyOf(recordDecl(ast_matchers::isTemplateInstantiation()),
- functionDecl(ast_matchers::isTemplateInstantiation()))))))
- .bind("decl"),
- this);
+ Finder->addMatcher(functionDecl(unless(isInstantiated())).bind("decl"), this);
}
void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
OpenPOWER on IntegriCloud