[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 8 10:54:02 PDT 2025
================
@@ -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.")]]
----------------
vbvictor wrote:
Could we make message smaller, no need to tell how CTAD works IMO.
We could just with `[[deprecated("Use CTAD constructor instead, 'makeMatcher' will be removed in LLVM 23")]]`
https://github.com/llvm/llvm-project/pull/147197
More information about the cfe-commits
mailing list