Bug 20088 – void[] cast unusable in betterC due to new __ArrayCast template
Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-07-27T08:41:01Z
Last change time
2019-08-06T04:08:10Z
Keywords
pull
Assigned to
No Owner
Creator
Sebastiaan Koppe
Comments
Comment #0 by mail — 2019-07-27T08:41:01Z
---
struct S {
int i;
}
extern(C) int main()
{
S[2] s = [S(1),S(2)];
void[] v = cast(void[])s;
S[] p = cast(S[])v; // cast of void[] to S[] triggers __ArrayCast template function
return 0;
}
---
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d:4847: error: undefined reference to '_D4core8internal6string17TempStringNoAlloc3getMFNaNbNiNjNfZAa'
__ArrayCast is a templated function that drags in TempStringNoAlloc.get which isn't available in betterC.
The example is silly but casts from void[] happen a lot in allocator code.
Comment #1 by dlang-bot — 2019-07-29T11:55:32Z
@skoppe updated dlang/druntime pull request #2705 "Make TempStringNoAlloc.get a template" fixing this issue:
- fix Issue 20088 - Make TempStringNoAlloc.get a template
https://github.com/dlang/druntime/pull/2705
Comment #2 by dlang-bot — 2019-08-06T04:08:10Z
dlang/druntime pull request #2705 "Make TempStringNoAlloc a template" was merged into stable:
- 12f046d6cb903ebc073e55c507f8b24950899a1e by Sebastiaan Koppe:
fix Issue 20088 - Make TempStringNoAlloc a template
https://github.com/dlang/druntime/pull/2705