r277261 - [c-index-test] Make sure to check that clang_Cursor_getNumTemplateArguments did not return -1.
Argyrios Kyrtzidis via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 29 19:20:22 PDT 2016
Author: akirtzidis
Date: Fri Jul 29 21:20:21 2016
New Revision: 277261
URL: http://llvm.org/viewvc/llvm-project?rev=277261&view=rev
Log:
[c-index-test] Make sure to check that clang_Cursor_getNumTemplateArguments did not return -1.
Modified:
cfe/trunk/tools/c-index-test/c-index-test.c
Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=277261&r1=277260&r2=277261&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Fri Jul 29 21:20:21 2016
@@ -838,8 +838,11 @@ static void PrintCursor(CXCursor Cursor,
if (Cursor.kind == CXCursor_FunctionDecl) {
/* Collect the template parameter kinds from the base template. */
- unsigned NumTemplateArgs = clang_Cursor_getNumTemplateArguments(Cursor);
- unsigned I;
+ int NumTemplateArgs = clang_Cursor_getNumTemplateArguments(Cursor);
+ int I;
+ if (NumTemplateArgs < 0) {
+ printf(" [no template arg info]");
+ }
for (I = 0; I < NumTemplateArgs; I++) {
enum CXTemplateArgumentKind TAK =
clang_Cursor_getTemplateArgumentKind(Cursor, I);
More information about the cfe-commits
mailing list