On 24 May 2017 3:19 pm, "Tim Northover" <t.p.northo...@gmail.com> wrote:
On 24 May 2017 at 15:06, Richard Smith <rich...@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. Sounds good. > 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. Yikes :-( Maybe libc++ *should* have that extension then. It sounds like we'll silently get the wrong value for any attempt at std::complex / _Complex interop right now: _Complex float a; std::complex<float> b = a; // discards imaginary component That seems pretty scary. Cheers. Tim.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits