A bit of AST matcher cleanup, NFC.
Removed the uses of the allOf() matcher inside node matchers that are implicit
allOf(). Replaced uses of allOf() with the explicit node matcher where it makes
matchers more readable. Replace anyOf(hasName(), hasName(), ...) with the more
efficient and readable hasAnyName().
llvm-svn: 347520
diff --git a/clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp
index b299151..890a56f 100644
--- a/clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp
+++ b/clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp
@@ -23,22 +23,21 @@
Finder->addMatcher(
cxxThrowExpr(
- allOf(
- unless(has(expr(anyOf(isTypeDependent(), isValueDependent())))),
- // The thrown value is not derived from 'std::exception'.
- has(expr(unless(hasType(
- qualType(hasCanonicalType(hasDeclaration(cxxRecordDecl(
- isSameOrDerivedFrom(hasName("::std::exception")))))))))),
- // This condition is always true, but will bind to the
- // template value if the thrown type is templated.
- anyOf(has(expr(hasType(
- substTemplateTypeParmType().bind("templ_type")))),
- anything()),
- // Bind to the declaration of the type of the value that
- // is thrown. 'anything()' is necessary to always suceed
- // in the 'eachOf' because builtin types are not
- // 'namedDecl'.
- eachOf(has(expr(hasType(namedDecl().bind("decl")))), anything())))
+ unless(has(expr(anyOf(isTypeDependent(), isValueDependent())))),
+ // The thrown value is not derived from 'std::exception'.
+ has(expr(unless(
+ hasType(qualType(hasCanonicalType(hasDeclaration(cxxRecordDecl(
+ isSameOrDerivedFrom(hasName("::std::exception")))))))))),
+ // This condition is always true, but will bind to the
+ // template value if the thrown type is templated.
+ anyOf(has(expr(
+ hasType(substTemplateTypeParmType().bind("templ_type")))),
+ anything()),
+ // Bind to the declaration of the type of the value that
+ // is thrown. 'anything()' is necessary to always suceed
+ // in the 'eachOf' because builtin types are not
+ // 'namedDecl'.
+ eachOf(has(expr(hasType(namedDecl().bind("decl")))), anything()))
.bind("bad_throw"),
this);
}