aboutsummaryrefslogtreecommitdiff
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorAnders Langlands <anderslangands@gmail.com>2022-09-23 11:05:31 -0400
committerAaron Ballman <aaron@aaronballman.com>2022-09-23 11:06:14 -0400
commite8c78d8528a6b7a96c93ea42749a3c0a03cd9b08 (patch)
tree2a1a3aaa143f6c8efae7d762033be3f5c8316899 /clang/tools/c-index-test/c-index-test.c
parentf7907bc536892e7ab1d5656a49ec708750d790f9 (diff)
downloadllvm-e8c78d8528a6b7a96c93ea42749a3c0a03cd9b08.zip
llvm-e8c78d8528a6b7a96c93ea42749a3c0a03cd9b08.tar.gz
llvm-e8c78d8528a6b7a96c93ea42749a3c0a03cd9b08.tar.bz2
Allow getting template args for ClassTemplateSpecializations
Modifies clang_Cursor_getNumTemplateArguments() and friends to work on Struct, Class and ClassTemplatePartialSpecialization decls as well as functions. Differential Revision: https://reviews.llvm.org/D134416
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r--clang/tools/c-index-test/c-index-test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index 901ab82..805f790 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -1002,7 +1002,10 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
clang_getCString(Name), line, column);
clang_disposeString(Name);
- if (Cursor.kind == CXCursor_FunctionDecl) {
+ if (Cursor.kind == CXCursor_FunctionDecl
+ || Cursor.kind == CXCursor_StructDecl
+ || Cursor.kind == CXCursor_ClassDecl
+ || Cursor.kind == CXCursor_ClassTemplatePartialSpecialization) {
/* Collect the template parameter kinds from the base template. */
int NumTemplateArgs = clang_Cursor_getNumTemplateArguments(Cursor);
int I;