[clang] [libclang] Add accessors for template parameters and fix parameter pack handling (PR #183504)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 08:59:32 PDT 2026


================
@@ -3308,6 +3330,38 @@ CINDEX_LINKAGE long long clang_Cursor_getTemplateArgumentValue(CXCursor C,
 CINDEX_LINKAGE unsigned long long
 clang_Cursor_getTemplateArgumentUnsignedValue(CXCursor C, unsigned I);
 
+/**
+ * Retrieve the number of template parameters on a template declaration.
+ *
+ * \param C a cursor representing a class template or function template.
+ *
+ * \returns the number of template parameters, or -1 if the cursor does not
+ * represent a template.
+ */
+CINDEX_LINKAGE int clang_Cursor_getNumTemplateParameters(CXCursor C);
----------------
fscheidl wrote:

Done

https://github.com/llvm/llvm-project/pull/183504


More information about the cfe-commits mailing list