summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
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/Sema
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/Sema')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 12aec6caba9..ab2e718c851 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -3818,6 +3818,10 @@ void Sema::CodeCompleteTypeQualifiers(DeclSpec &DS) {
Results.data(), Results.size());
}
+void Sema::CodeCompleteBracketDeclarator(Scope *S) {
+ CodeCompleteExpression(S, QualType(getASTContext().getSizeType()));
+}
+
void Sema::CodeCompleteCase(Scope *S) {
if (getCurFunction()->SwitchStack.empty() || !CodeCompleter)
return;
OpenPOWER on IntegriCloud