Code completion for ordinary names when we're starting a declaration, expression, or statement
llvm-svn: 82481
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 4fdcf2a..907ca80 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -90,6 +90,11 @@
return ParseObjCAtStatement(AtLoc);
}
+ case tok::code_completion:
+ Actions.CodeCompleteOrdinaryName(CurScope);
+ ConsumeToken();
+ return ParseStatementOrDeclaration(OnlyStatement);
+
case tok::identifier:
if (NextToken().is(tok::colon)) { // C99 6.8.1: labeled-statement
// identifier ':' statement
@@ -918,6 +923,11 @@
OwningStmtResult FirstPart(Actions);
OwningExprResult SecondPart(Actions), ThirdPart(Actions);
+ if (Tok.is(tok::code_completion)) {
+ Actions.CodeCompleteOrdinaryName(CurScope);
+ ConsumeToken();
+ }
+
// Parse the first part of the for specifier.
if (Tok.is(tok::semi)) { // for (;
// no first part, eat the ';'.