[clang] [clang-tools-extra] [AstMatcher]`templateArgumentCountIs` support `FunctionDecl` (PR #130416)
Carlos Galvez via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 11 02:09:36 PDT 2025
================
@@ -6219,6 +6230,17 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
Usable as: Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
</pre></td></tr>
+
+<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1VarTemplateSpecializationDecl.html">VarTemplateSpecializationDecl</a>></td><td class="name" onclick="toggle('templateArgumentCountIs1')"><a name="templateArgumentCountIs1Anchor">templateArgumentCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="templateArgumentCountIs1"><pre>Matches if the number of template arguments equals N.
+
+Given
+ template<typename T> struct C {};
+ C<int> c;
+classTemplateSpecializationDecl(templateArgumentCountIs(1))
----------------
carlosgalvezp wrote:
Same
https://github.com/llvm/llvm-project/pull/130416
More information about the cfe-commits
mailing list