diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-21 18:10:23 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-21 18:10:23 +0000 |
commit | 3e1005f085006dfb3545f0c54ac5e22483137c7d (patch) | |
tree | 5283db3a9e3b8fdbc5449a436b48d22b8f5b69bf /lib/Parse/ParseStmt.cpp | |
parent | 86d9a52c24d390631a888d4ff812e1b15445e0a0 (diff) |
Code completion for "case" statements within a switch on an expression
of enumeration type, providing the various unused enumerators as options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index edb0018d20..4fdcf2a077 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -261,6 +261,11 @@ Parser::OwningStmtResult Parser::ParseCaseStatement() { do { SourceLocation CaseLoc = ConsumeToken(); // eat the 'case'. + if (Tok.is(tok::code_completion)) { + Actions.CodeCompleteCase(CurScope); + ConsumeToken(); + } + OwningExprResult LHS(ParseConstantExpression()); if (LHS.isInvalid()) { SkipUntil(tok::colon); |