aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Parse/ParseExpr.cpp5
-rw-r--r--test/Index/complete-blocks.m6
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 2785f1b14d..c4d09f2816 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -1743,6 +1743,11 @@ bool Parser::ParseExpressionList(llvm::SmallVectorImpl<Expr*> &Exprs,
/// [clang] specifier-qualifier-list block-declarator
///
void Parser::ParseBlockId() {
+ if (Tok.is(tok::code_completion)) {
+ Actions.CodeCompleteOrdinaryName(getCurScope(), Sema::PCC_Type);
+ ConsumeCodeCompletionToken();
+ }
+
// Parse the specifier-qualifier-list piece.
DeclSpec DS;
ParseSpecifierQualifierList(DS);
diff --git a/test/Index/complete-blocks.m b/test/Index/complete-blocks.m
index 61e363e375..18369d2c5a 100644
--- a/test/Index/complete-blocks.m
+++ b/test/Index/complete-blocks.m
@@ -43,3 +43,9 @@ void test_C(C *c) {
// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText method3:}{Placeholder ^int(void)b} (20)
// RUN: c-index-test -code-completion-at=%s:33:6 %s | FileCheck -check-prefix=CHECK-CC4 %s
// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType id}{TypedText method4:}{Placeholder ^(void)arg} (20)
+// RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// CHECK-CC5: TypedefDecl:{TypedText block_t} (50)
+// CHECK-CC5: TypedefDecl:{TypedText Class} (50)
+// CHECK-CC5-NOT: test_A
+// CHECK-CC5: {TypedText union} (50)
+