Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-tidy/utils/Matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class MatchesAnyListedNameMatcher
// qualified name will be used for matching, otherwise its name will be used.
inline ::clang::ast_matchers::internal::Matcher<NamedDecl>
matchesAnyListedName(llvm::ArrayRef<StringRef> NameList) {
return ::clang::ast_matchers::internal::makeMatcher(
return ::clang::ast_matchers::internal::Matcher(
new MatchesAnyListedNameMatcher(NameList));
}

Expand Down Expand Up @@ -188,7 +188,7 @@ class MatchesAnyListedTypeNameMatcher
inline ::clang::ast_matchers::internal::Matcher<QualType>
matchesAnyListedTypeName(llvm::ArrayRef<StringRef> NameList,
bool CanonicalTypes) {
return ::clang::ast_matchers::internal::makeMatcher(
return ::clang::ast_matchers::internal::Matcher(
new MatchesAnyListedTypeNameMatcher(NameList, CanonicalTypes));
}
inline ::clang::ast_matchers::internal::Matcher<QualType>
Expand Down
10 changes: 8 additions & 2 deletions clang/include/clang/ASTMatchers/ASTMatchersInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,15 @@ class Matcher {
DynTypedMatcher Implementation;
}; // class Matcher

/// A convenient helper for creating a Matcher<T> without specifying
/// the template type argument.
// Deduction guide for Matcher.
template <typename T> Matcher(MatcherInterface<T> *) -> Matcher<T>;

// TODO: Remove in LLVM 23.
template <typename T>
[[deprecated(
"makeMatcher() is deprecated and will be removed in LLVM 23. "
"Uses of it can be replaced with direct calls to Matcher's "
"constructor; with C++17's CTAD, template arguments will be deduced.")]]
inline Matcher<T> makeMatcher(MatcherInterface<T> *Implementation) {
return Matcher<T>(Implementation);
}
Expand Down
8 changes: 4 additions & 4 deletions clang/include/clang/ASTMatchers/ASTMatchersMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
}; \
} \
inline ::clang::ast_matchers::internal::Matcher<Type> DefineMatcher() { \
return ::clang::ast_matchers::internal::makeMatcher( \
return ::clang::ast_matchers::internal::Matcher( \
new internal::matcher_##DefineMatcher##Matcher()); \
} \
inline bool internal::matcher_##DefineMatcher##Matcher::matches( \
Expand Down Expand Up @@ -150,7 +150,7 @@
} \
inline ::clang::ast_matchers::internal::Matcher<Type> DefineMatcher( \
ParamType const &Param) { \
return ::clang::ast_matchers::internal::makeMatcher( \
return ::clang::ast_matchers::internal::Matcher( \
new internal::matcher_##DefineMatcher##OverloadId##Matcher(Param)); \
} \
typedef ::clang::ast_matchers::internal::Matcher<Type> ( \
Expand Down Expand Up @@ -200,7 +200,7 @@
} \
inline ::clang::ast_matchers::internal::Matcher<Type> DefineMatcher( \
ParamType1 const &Param1, ParamType2 const &Param2) { \
return ::clang::ast_matchers::internal::makeMatcher( \
return ::clang::ast_matchers::internal::Matcher( \
new internal::matcher_##DefineMatcher##OverloadId##Matcher(Param1, \
Param2)); \
} \
Expand Down Expand Up @@ -476,7 +476,7 @@
} \
inline ::clang::ast_matchers::internal::Matcher<Type> DefineMatcher( \
llvm::StringRef Param, llvm::Regex::RegexFlags RegexFlags) { \
return ::clang::ast_matchers::internal::makeMatcher( \
return ::clang::ast_matchers::internal::Matcher( \
new internal::matcher_##DefineMatcher##OverloadId##Matcher( \
::clang::ast_matchers::internal::createAndVerifyRegex( \
Param, RegexFlags, #DefineMatcher))); \
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Tooling/Transformer/RewriteRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ template <typename T>
ast_matchers::internal::Matcher<T>
forEachDescendantDynamically(ast_matchers::BoundNodes Nodes,
DynTypedMatcher M) {
return ast_matchers::internal::makeMatcher(new BindingsMatcher<T>(
return ast_matchers::internal::Matcher(new BindingsMatcher<T>(
std::move(Nodes),
ast_matchers::internal::makeMatcher(
ast_matchers::internal::Matcher(
new DynamicForEachDescendantMatcher<T>(std::move(M)))));
}

Expand Down