summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-02-18 15:30:24 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-02-18 15:30:24 +0000
commit72dae62b8ad99c2cde043f0a220c37d104c82950 (patch)
treee4f337570098fa646bc6444f68700082d5722fdc /clang/lib/Parse/ParseDecl.cpp
parenta7bdd29c9c714846769c449770a4b215c88ec3e3 (diff)
downloadbcm5719-llvm-72dae62b8ad99c2cde043f0a220c37d104c82950.tar.gz
bcm5719-llvm-72dae62b8ad99c2cde043f0a220c37d104c82950.zip
[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
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index c766ef30e62..64f00bfcfa5 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -6030,6 +6030,9 @@ void Parser::ParseBracketDeclarator(Declarator &D) {
T.getCloseLocation()),
attrs, T.getCloseLocation());
return;
+ } else if (Tok.getKind() == tok::code_completion) {
+ Actions.CodeCompleteBracketDeclarator(getCurScope());
+ return cutOffParsing();
}
// If valid, this location is the position where we read the 'static' keyword.
OpenPOWER on IntegriCloud