mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
15 lines
475 B
Text
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.
|