← Back to index
|
Original Bugzilla link
Bug 24457 – ImportC: Assignment to double complex fails when using ternary operator
Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-03-27T14:26:05Z
Last change time
2024-12-13T19:34:08Z
Assigned to
No Owner
Creator
Lance Bachmeier
Moved to GitHub: dmd#20425 →
Comments
Comment #0
by lance — 2024-03-27T14:26:05Z
This compiles with gcc but not dmd: #include <complex.h> void foo() { double * a; double complex * b; double complex zden; double c, d; zden = c > d? b[0]: a[0]; } Error: incompatible types for `(*(b + cast(long)0 * 16L)) : (*(a + cast(long)0 * 8L))`: `_Complex!double` and `double` This compiles with both gcc and dmd, so it's a problem of the ternary operator: #include <complex.h> void foo() { double * a; double complex * b; double complex zden; double c, d; zden = a[0]; zden = b[0]; if (c > d) { zden = b[0]; } else { zden = a[0]; } }
Comment #1
by robert.schadek — 2024-12-13T19:34:08Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/20425
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB