[PATCH] D33424: Lexer: allow imaginary constants in GNU mode (only).

Tim Northover via cfe-commits cfe-commits at lists.llvm.org
Wed May 24 15:19:07 PDT 2017


On 24 May 2017 at 15:06, Richard Smith <richard at metafoo.co.uk> wrote:
> I think this is expected. Clang has an extension where it treats 1.0if as a
> _Complex float if no operator""if is available;

Since it's breaking some bots, I've reverted my commit while we hash
this out. r303813.

> libc++ has an extension
> where std::complex<float> can be initialized from _Complex float. For the
> same reason, that code has historically worked in C++11 and C++98 modes.

Are you sure? It looks like it does an implicit cast to float
(discarding the imaginary part) and then calls the "complex(float,
float = 0.0)" constructor to me.

Cheers.

Tim.


More information about the cfe-commits mailing list