================ @@ -12,20 +12,44 @@ #include "../utils/OptionsUtils.h" #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatchFinder.h" +#include <array> using namespace clang::ast_matchers; +using clang::ast_matchers::internal::Matcher; namespace clang::tidy::bugprone { namespace { -AST_MATCHER_P(QualType, hasCleanType, ast_matchers::internal::Matcher<QualType>, - InnerMatcher) { +AST_MATCHER_P(QualType, hasCleanType, Matcher<QualType>, InnerMatcher) { return InnerMatcher.matches( Node.getNonReferenceType().getUnqualifiedType().getCanonicalType(), Finder, Builder); } +AST_MATCHER_P2(Expr, constructFrom, Matcher<QualType>, TypeMatcher, + Matcher<Expr>, ArgumentMatcher) { + std::array<StringRef, 2> NameList{ + "::std::make_unique", + "::std::make_shared", + }; + return expr(anyOf( ---------------- PiotrZSL wrote:
that's not efficient, new matchers will be created constantly. replace this with simple function that returns this matcher. https://github.com/llvm/llvm-project/pull/119371 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits