From 72dae62b8ad99c2cde043f0a220c37d104c82950 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 18 Feb 2016 15:30:24 +0000 Subject: [Parse] Code complete expressions in bracket declarators. Currently we return no results when completing inside of the brackets in a 'char foo[]' declaration. Let the generic expression completion code handle it instead. We could get fancier here (e.g. filter non-constant expressions in contexts where VLAs are not allowed), but it's a strict improvement over the existing version. llvm-svn: 261217 --- clang/test/CodeCompletion/bracket-decl.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 clang/test/CodeCompletion/bracket-decl.c (limited to 'clang/test/CodeCompletion/bracket-decl.c') diff --git a/clang/test/CodeCompletion/bracket-decl.c b/clang/test/CodeCompletion/bracket-decl.c new file mode 100644 index 00000000000..cf80b424d13 --- /dev/null +++ b/clang/test/CodeCompletion/bracket-decl.c @@ -0,0 +1,9 @@ +#define PATHSIZE 256 + +static const int len = 1234; + +void foo() { + char arr[ +// RUN: %clang_cc1 -fsyntax-only -code-completion-macros -code-completion-at=%s:6:12 %s -o - | FileCheck %s +// CHECK: COMPLETION: len +// CHECK: COMPLETION: PATHSIZE -- cgit v1.2.3