[PATCH] Allow paren casted throw statements inside of ternary expressions
Richard Smith
richard at metafoo.co.uk
Fri May 31 16:43:11 PDT 2013
Please also add a test that IRGen copes with this when it appears as a
condition (for instance, on the LHS of another ?: operator) -- we have
special handling for that which has had problems with throw-expressions in
the past. Otherwise, LGTM, thanks!
On Thu, May 30, 2013 at 10:48 PM, David Majnemer
<david.majnemer at gmail.com>wrote:
> 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
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130531/7787ca7d/attachment.html>
More information about the cfe-commits
mailing list