diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2014-02-27 16:05:05 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2014-02-27 16:05:05 +0000 |
commit | 6ede6aba287269a369486b094710bb8cc916e54f (patch) | |
tree | ff566aa158c88cb5f5095806b8acfbb8430518b6 /clang/include/clang-c | |
parent | d8c2fbd57fdd003b8960975757ab996fb2196a84 (diff) | |
download | bcm5719-llvm-6ede6aba287269a369486b094710bb8cc916e54f.tar.gz bcm5719-llvm-6ede6aba287269a369486b094710bb8cc916e54f.zip |
libclang: New functions clang_Type_getNumTemplateArguments,
clang_Type_getTemplateArgument
Note that these functions don't handle variadic templates -- see tests.
Patch by Matthieu Nottale and Philippe Daouadi.
llvm-svn: 202406
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r-- | clang/include/clang-c/Index.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 02abfcab30f..b77ddcb6c05 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -3081,6 +3081,24 @@ enum CXRefQualifierKind { }; /** + * \brief Returns the number of template arguments for given class template + * specialization, or -1 if type \c T is not a class template specialization. + * + * Variadic argument packs count as only one argument, and can not be inspected + * further. + */ +CINDEX_LINKAGE int clang_Type_getNumTemplateArguments(CXType T); + +/** + * \brief Returns the type template argument of a template class specialization + * at given index. + * + * This function only returns template type arguments and does not handle + * template template arguments or variadic packs. + */ +CINDEX_LINKAGE CXType clang_Type_getTemplateArgumentAsType(CXType T, unsigned i); + +/** * \brief Retrieve the ref-qualifier kind of a function or method. * * The ref-qualifier is returned for C++ functions or methods. For other types |