[PATCH] Fix fallout from r219557

Abramo Bagnara abramo.bagnara at bugseng.com
Fri Jan 9 02:00:52 PST 2015


Ping.

Il 30/12/2014 20:07, Abramo Bagnara ha scritto:
> Il 11/11/2014 21:32, Richard Smith ha scritto:
> 
>> This change is incorrect. The usual arithmetic conversions do *not*
>> take `(_Complex double, double)` to `(_Complex double, _Complex
>> double)`; note C11 6.13.1.8/1 ("... without change of type domain").
> 
> I guess that this justify why after r219557 we don't have any longer a
> FloatingRealToComplex implicit cast for `c' in `b = c + b' below, right?
> 
> _Complex float b;
> 
> void foo (void)
> {
>   float c = 1.0;
>   b = c + b;
> }
> 
> The puzzling thing is that we still generates implicit
> FloatingRealToComplex implicit cast for:
> 
> _Complex float b;
> 
> void foo (void)
> {
>   int c = 1;
>   b = c + b;
> }
> 
> Is this a bug?
> 
> I'm also wondering if it is a savy choice (standard apart) to omit such
> kind of implicit conversions from AST considering that indeed they
> "happens" (taken for granted we have also other implicit casts that
> standard does not strictly requires).
> 
> Opinions?
> 


-- 
Abramo Bagnara

BUGSENG srl - http://bugseng.com
mailto:abramo.bagnara at bugseng.com



More information about the cfe-commits mailing list