]> granicus.if.org Git - clang/commitdiff
C doesn't allow mixing declarations and statements, silly
authorDouglas Gregor <dgregor@apple.com>
Mon, 9 Nov 2009 17:05:28 +0000 (17:05 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 9 Nov 2009 17:05:28 +0000 (17:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86556 91177308-0d34-0410-b5e6-96231b3b80d8

tools/c-index-test/c-index-test.c

index 0df590d8499133e9016d09e15de438237a570aac..fa6fc56fba5ce95081e5a65928040e9da1019564 100644 (file)
@@ -163,6 +163,7 @@ void print_completion_string(CXCompletionString completion_string, FILE *file) {
   
   N = clang_getNumCompletionChunks(completion_string);
   for (I = 0; I != N; ++I) {
+    const char *text = 0;
     enum CXCompletionChunkKind Kind
       = clang_getCompletionChunkKind(completion_string, I);
     
@@ -175,8 +176,7 @@ void print_completion_string(CXCompletionString completion_string, FILE *file) {
       continue;
     }
     
-    const char *text 
-      = clang_getCompletionChunkText(completion_string, I);
+    text = clang_getCompletionChunkText(completion_string, I);
     fprintf(file, "{%s %s}", 
             clang_getCompletionChunkKindSpelling(Kind),
             text? text : "");