www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20088] New: void[] cast unusable in betterC due to new


          Issue ID: 20088
           Summary: void[] cast unusable in betterC due to new __ArrayCast
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: mail skoppe.eu


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
    return 0;


/dlang/dmd/linux/bin64/../../src/druntime/import/object.d:4847: error:
undefined reference to

__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.

Jul 27 2019