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

David Majnemer david.majnemer at gmail.com
Sun Jun 2 01:42:00 PDT 2013


Committed in r183085.

-- 
David Majnemer


On Fri, May 31, 2013 at 4:43 PM, Richard Smith <richard at metafoo.co.uk>wrote:

> 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/20130602/7a9c207d/attachment.html>


More information about the cfe-commits mailing list