Add code completion to produce "else" blocks after an "if"
statement. Fixes <rdar://problem/9229438>.
llvm-svn: 136564
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index b34e4f8..d57e527 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -953,6 +953,9 @@
// Pop the 'else' scope if needed.
InnerScope.Exit();
+ } else if (Tok.is(tok::code_completion)) {
+ Actions.CodeCompleteAfterIf(getCurScope());
+ ConsumeCodeCompletionToken();
}
IfScope.Exit();