Bug 17843 – -betterC struct with `double` field generates references to TypeInfo

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-09-20T09:00:50Z
Last change time
2018-02-10T10:03:15Z
Keywords
betterC
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2017-09-20T09:00:50Z
Example: struct S { double d; } TypeInfo is in druntime, and druntime is not linked in for -betterC.
Comment #1 by bugzilla — 2017-09-20T09:22:56Z
Comment #2 by bugzilla — 2017-09-20T09:29:01Z
For older compilers, a workaround is to add a toHash() dummy member function: extern (D) size_t toHash() const nothrow @safe { return 0; } for the struct with a float/double/real in it.
Comment #3 by github-bugzilla — 2017-11-30T10:27:03Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1d2da668320f4c5ff070f65f50ca694bfc31cddb fix Issue 17843 - -betterC struct with field generates references to TypeInfo https://github.com/dlang/dmd/commit/6e00baac3d3bd25a792717bacc194e39bba8fe81 Merge pull request #7151 from WalterBright/fix17843 fix Issue 17843 - -betterC struct with field generates references to…
Comment #4 by github-bugzilla — 2017-12-18T22:58:01Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1d2da668320f4c5ff070f65f50ca694bfc31cddb fix Issue 17843 - -betterC struct with field generates references to TypeInfo https://github.com/dlang/dmd/commit/6e00baac3d3bd25a792717bacc194e39bba8fe81 Merge pull request #7151 from WalterBright/fix17843
Comment #5 by bugzilla — 2018-02-10T10:03:15Z
*** Issue 17825 has been marked as a duplicate of this issue. ***