From f11309e1943782d323f195c06824a486982e3340 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 31 Aug 2010 22:12:17 +0000 Subject: Add a new libclang function clang_getTemplateCursorKind(), which determines the kind of declaration that would be generated if the given template were instantiated. This allows a client to distinguish among class/struct/union templates and function/member function/static member function templates. Also, teach clang_CXXMethod_isStatic() about function templates. llvm-svn: 112655 --- clang/include/clang-c/Index.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'clang/include/clang-c') diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index be02bcf8c39..404d7aa5140 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -1716,10 +1716,30 @@ CINDEX_LINKAGE unsigned clang_isCursorDefinition(CXCursor); */ /** - * \brief Determine if a C++ member function is declared 'static'. + * \brief Determine if a C++ member function or member function template is + * declared 'static'. */ CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C); +/** + * \brief Given a cursor that represents a template, determine + * the cursor kind of the specializations would be generated by instantiating + * the template. + * + * This routine can be used to determine what flavor of function template, + * class template, or class template partial specialization is stored in the + * cursor. For example, it can describe whether a class template cursor is + * declared with "struct", "class" or "union". + * + * \param C The cursor to query. This cursor should represent a template + * declaration. + * + * \returns The cursor kind of the specializations that would be generated + * by instantiating the template \p C. If \p C is not a template, returns + * \c CXCursor_NoDeclFound. + */ +CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C); + /** * @} */ -- cgit v1.2.3