summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-25 06:20:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-25 06:20:02 +0000
commit3ff3af4ff9b4ad40d5f945cbc68ac4c56393f8c8 (patch)
tree8c48afbfd1ae9f048165d5293842f52c80c6ea0a /clang/lib/Parse/ParseStmt.cpp
parent7baad7365a979a64456b180d66a754f7cf4ef22e (diff)
downloadbcm5719-llvm-3ff3af4ff9b4ad40d5f945cbc68ac4c56393f8c8.tar.gz
bcm5719-llvm-3ff3af4ff9b4ad40d5f945cbc68ac4c56393f8c8.zip
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. llvm-svn: 89847
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 2022fa51cfd..c87010e356a 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud