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 | d328d57c39ced4c301724db063fe0a6d7db8654b (patch) | |
tree | 1aa11af42ad3119355a5678db0f500babc5b7394 /clang/lib/Parse/ParseStmt.cpp | |
parent | 48ade83e60a63465c5bc197933d8ef514ba1719f (diff) | |
download | bcm5719-llvm-d328d57c39ced4c301724db063fe0a6d7db8654b.tar.gz bcm5719-llvm-d328d57c39ced4c301724db063fe0a6d7db8654b.zip |
Code completion for "case" statements within a switch on an expression
of enumeration type, providing the various unused enumerators as options.
llvm-svn: 82467
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index edb0018d20d..4fdcf2a077f 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/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); |