Bug 21167 – Please clarify the specification

Status
NEW
Severity
enhancement
Priority
P4
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-08-16T07:36:08Z
Last change time
2024-12-15T15:26:30Z
Assigned to
No Owner
Creator
Victor Porton
Moved to GitHub: dlang.org#3985 →

Comments

Comment #0 by porton — 2020-08-16T07:36:08Z
https://dlang.org/spec/arrays.html 12.9.4 "The slice on the left and any slices on the right must not overlap." Please clarify what this means and give an example of an error. The following compiles and runs without errors despite left and right overlap (in fact they are the same): void main() { auto a = [3.0, 2.7, 3.4]; auto b = [2.3, 1.4, 2.5]; a[] = a[] + a[]; } Is the above an undefined behavior? In this case, the spec should explicitly mention undefined behavior and the compiler should give an error/warning.
Comment #1 by robert.schadek — 2024-12-15T15:26:30Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/3985 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB