mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
fix Issue 23778 - Code generator fails to handle __c_complex_real properly for Windows
This commit is contained in:
parent
5a80cd7bc9
commit
5320bf2945
2 changed files with 33 additions and 2 deletions
|
@ -1464,13 +1464,13 @@ tym_t totym(Type tx)
|
|||
else if (id == Id.__c_ulong)
|
||||
t = tb.ty == Tuns32 ? TYulong : TYullong;
|
||||
else if (id == Id.__c_long_double)
|
||||
t = TYdouble;
|
||||
t = tb.size() == 8 ? TYdouble : TYldouble;
|
||||
else if (id == Id.__c_complex_float)
|
||||
t = TYcfloat;
|
||||
else if (id == Id.__c_complex_double)
|
||||
t = TYcdouble;
|
||||
else if (id == Id.__c_complex_real)
|
||||
t = TYcldouble;
|
||||
t = tb.size() == 16 ? TYcdouble : TYcldouble;
|
||||
else
|
||||
t = totym(tb);
|
||||
break;
|
||||
|
|
31
compiler/test/runnable/complex3.d
Normal file
31
compiler/test/runnable/complex3.d
Normal file
|
@ -0,0 +1,31 @@
|
|||
// https://issues.dlang.org/show_bug.cgi?id=23778
|
||||
|
||||
|
||||
enum __c_long_double : double;
|
||||
|
||||
alias __c_long_double c_long_double;
|
||||
|
||||
struct _Complex
|
||||
{
|
||||
c_long_double re;
|
||||
c_long_double im;
|
||||
}
|
||||
|
||||
version (all) // bug to test
|
||||
{
|
||||
enum __c_complex_real : _Complex;
|
||||
alias c_complex_real = __c_complex_real;
|
||||
}
|
||||
else // works
|
||||
enum c_complex_real : _Complex;
|
||||
|
||||
c_complex_real toNative2(real re, real im)
|
||||
{
|
||||
return c_complex_real(re, im);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
c_complex_real n = toNative2(123, 456);
|
||||
assert(123 == n.re && 456 == n.im);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue