June 21 [Issue 24622] New: Modify const data with void[] concatenation/append | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24622 Issue ID: 24622 Summary: Modify const data with void[] concatenation/append Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: nick@geany.org Related to issue 17148. void g(int*[] a, const(int*)[] b) @system { void[] va = a; va[] = va.init ~ b; // a now contains b's data *a[0] = 0; // modify const data } Appending a const array to void[] also needs to be disallowed. typeof(void[] ~ const(void)[]) should be const(void)[], not void[]. -- |
Copyright © 1999-2021 by the D Language Foundation