dmd/changelog/dmd.copying-to-void-arrays.dd

15 lines
475 B
Text

Copying from `const(void)[]` to `void[]` is disallowed with `-preview=fixImmutableConv`
If `const(void)[]` data contains tail `const` pointers, copying to `void[]`
can subsequently violate `const` data:
---
void f(int*[] a, const int*[] b)
{
void[] va = a;
const void[] vb = b;
va[] = vb[]; // fills `a` with pointers to const
*a[0] = 0; // const data mutated
}
---
Copying `vb` data to `va` is no longer allowed with the
`-preview=fixImmutableConv` switch.