[cfe-users] Why does this testcase fail in clang-60?

Jonas Toth via cfe-users cfe-users at lists.llvm.org
Tue Mar 27 02:43:22 PDT 2018


I believe the default standard did change to c++14. How did you compile?
Could you make a case in godbolt.org?


Am 27.03.2018 um 04:52 schrieb Yuri via cfe-users:
> This testcase:
>
> # include <complex>
> # include <math.h>
>
> # define _I ((complex_t)(1i))
> typedef std::complex<double> complex_t;
>
> complex_t f(const double omega) {
>   complex_t p = cos (omega) +  _I * sin (omega);
>   return p;
> }
>
> works in clang40 and clang50, but fails in clang60:
>
> c.c:9:32: error: implicit conversion from '_Complex int' to 'double'
> is not permitted in C++
>   complex_t p = cos (omega) +  _I * sin (omega);
>                                ^~
> c.c:5:26: note: expanded from macro '_I'
> # define _I ((complex_t)(1i))
>              ~           ^~
> 1 error generated.
>
>
> Yuri
>
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users




More information about the cfe-users mailing list