From: Douglas Gregor Date: Mon, 9 Nov 2009 17:05:28 +0000 (+0000) Subject: C doesn't allow mixing declarations and statements, silly X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5a2089663d81faee0de031deabc418fa53ecf3b;p=clang C doesn't allow mixing declarations and statements, silly git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86556 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index 0df590d849..fa6fc56fba 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -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 : "");