[PATCH] Allow paren casted throw statements inside of ternary expressions

David Majnemer david.majnemer at gmail.com
Thu May 30 22:48:20 PDT 2013


ToT clang incorrectly does not allow the following:

int x = true ? (throw 1) : 2;

The problem is exists because we don't see beyond the parens.
This, in turn, causes us to believe that we are choosing between void and
int which we diagnose as an error.

The attached patch will allow clang to see the 'throw' inside the parens.

-- 
David Majnemer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130530/2d9ce483/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ternary-paren-throw.diff
Type: application/octet-stream
Size: 1385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130530/2d9ce483/attachment.obj>


More information about the cfe-commits mailing list