[PATCH] Allow pointer decay and qual stripping for _Generic

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 14:46:51 PST 2015


On Wed, Nov 4, 2015 at 2:45 PM, Richard Smith <richard at metafoo.co.uk> wrote:

> It'd be simpler and would more directly match the C specification (and
> would handle a few other cases better, such as placeholder types and atomic
> types) if you instead passed the operand through DefaultLvalueConversion
>

or rather, DefaultFunctionArrayLvalueConversion =)


> rather than matching against the decayed form of the type.
>
> On Wed, Nov 4, 2015 at 11:23 AM, Aaron Ballman <aaron at aaronballman.com>
> wrote:
>
>> The control expression for a _Generic selection expression should have
>> its type decayed and qualifiers stripped when determining which
>> selection it matches. e.g., the following should compile:
>>
>>   _Generic("test", char *: 1);
>>   const int i = 12;
>>   _Generic(i, int: 1);
>>
>> This patch fixes PR16340.
>>
>> ~Aaron
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151104/eb715bb5/attachment.html>


More information about the cfe-commits mailing list