diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-25 06:20:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-25 06:20:02 +0000 |
commit | be724bab2ba7ad47aebced25e7c8ec551eb72d28 (patch) | |
tree | a6fdd9c24809e81d63ace183169b008fdac4839b /lib/Parse/ParseStmt.cpp | |
parent | d78f598e020c12bf5a8fddc8d08a3be4cff8dc78 (diff) |
When the condition of a switch() statement is semantically invalid,
still parse the body of the switch to try to avoid spurious
diagnostics. Fixes PR5606.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 2022fa51cf..c87010e356 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -715,9 +715,7 @@ Parser::OwningStmtResult Parser::ParseSwitchStatement(AttributeList *Attr) { FullExprArg FullCond(Actions.FullExpr(Cond)); - OwningStmtResult Switch(Actions); - if (!Cond.isInvalid() || CondVar.get()) - Switch = Actions.ActOnStartOfSwitchStmt(FullCond, CondVar); + OwningStmtResult Switch = Actions.ActOnStartOfSwitchStmt(FullCond, CondVar); // C99 6.8.4p3 - In C99, the body of the switch statement is a scope, even if // there is no compound stmt. C90 does not have this clause. We only do this |