[PATCH] D26350: Keep invalid Switch in the AST

Olivier Goffart via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 7 06:40:21 PST 2016


ogoffart created this revision.
ogoffart added reviewers: rsmith, cfe-commits.

- When the condition is invalid, replace it by an OpaqueValueExpr

- When parsing an invalid CaseStmt, don't drop the sub statement, just return  it instead.

- In Sema::ActOnStartOfSwitchStmt, always keep the SwitchStmt, even if it has duplicate case or defaults statement or that the condition cannot be converted to an integral type.




https://reviews.llvm.org/D26350

Files:
  lib/Parse/ParseStmt.cpp
  lib/Sema/SemaStmt.cpp
  test/Misc/ast-dump-invalid-switch.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26350.77030.patch
Type: text/x-patch
Size: 6193 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161107/2cfd0e27/attachment.bin>


More information about the cfe-commits mailing list