[PATCH] Fix fallout from r219557

Abramo Bagnara abramo.bagnara at bugseng.com
Tue Dec 30 11:07:14 PST 2014


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