[Issue 21515] New: extern(C) and extern(C++) returns creal in wrong order
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 29 22:18:39 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21515
Issue ID: 21515
Summary: extern(C) and extern(C++) returns creal in wrong order
Product: D
Version: D2
Hardware: All
OS: Linux
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: ibuclaw at gdcproject.org
This program fails.
---
extern "C" _Complex long double ctwol() { return 1+0Li; }
extern(C) creal ctwol(); // Because extern(C++) ICE's
void main()
{
auto a = ctwol();
assert(a.re == 2 && a.im == 0);
}
---
DMD generates:
callq d <_Dmain+0xd>
fstpt -0x10(%rbp)
fstpt -0x20(%rbp)
When it should instead do:
callq d <_Dmain+0xd>
fstpt -0x20(%rbp)
fstpt -0x10(%rbp)
--
More information about the Digitalmars-d-bugs
mailing list