← Back to index
|
Original Bugzilla link
Bug 23788 – Win64 problem with constructor for __c_complex_float
Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2023-03-17T08:25:30Z
Last change time
2024-12-13T19:27:52Z
Keywords
backend, ImportC
Assigned to
No Owner
Creator
Walter Bright
Moved to GitHub: dmd#20249 →
Comments
Comment #0
by bugzilla — 2023-03-17T08:25:30Z
--- import core.stdc.stdio; enum __c_complex_float : _Complex; alias c_complex_float = __c_complex_float; struct _Complex { float re; float im; this(float re, float im) { this.re = re; this.im = im; } } c_complex_float toNative(float re, float im) { printf("re: %g, im: %g\n", re, im); assert(re == 123 && im == 456); return c_complex_float(re, im); } void main() { c_complex_float n = toNative(123, 456); printf("n.re: %g, n.im: %g\n", n.re, n.im); assert(123 == n.re); // fails here assert(456 == n.im); } ------ If the constructor is removed, it works. The problem seems to lie in the translation from the `enum __c_complex_float` to cfloat.
Comment #1
by robert.schadek — 2024-12-13T19:27:52Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/20249
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB