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

2018-03-27 Thread Jonas Toth via cfe-users
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 
> # include 
>
> # define _I ((complex_t)(1i))
> typedef std::complex 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@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


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

2018-03-27 Thread Yuri via cfe-users

On 03/27/18 02:43, Jonas Toth via cfe-users wrote:

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



I compiled without arguments. Adding -std=c++11 or -std=c++98 doesn't 
change the error message.



Yuri

___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


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

2018-03-27 Thread Richard via cfe-users
[Please reply *only* to the list and do not include my email directly
in the To: or Cc: of your reply; otherwise I will not see your reply.
Thanks.]

In article ,
Yuri via cfe-users  writes:

> On 03/27/18 02:43, Jonas Toth via cfe-users wrote:
> > I believe the default standard did change to c++14. How did you compile?
> > Could you make a case in godbolt.org?
> 
> I compiled without arguments. Adding -std=c++11 or -std=c++98 doesn't 
> change the error message.

It looks like a bug in the standard library implementation. 1i is
supposed to yield a std::complex, but from the error message
it appears to be yielding a "_Complex int"?

I'm using this as a reference:

-- 
"The Direct3D Graphics Pipeline" free book 
The Terminals Wiki 
 The Computer Graphics Museum 
  Legalize Adulthood! (my blog) 
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users