Bug 24703 – Assigning from comma expression is allowed

Status
RESOLVED
Resolution
INVALID
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-08-14T20:40:24Z
Last change time
2024-08-16T10:17:54Z
Assigned to
No Owner
Creator
Nick Treleaven

Comments

Comment #0 by nick — 2024-08-14T20:40:24Z
The last line below should error. void main() { int x = 1, y; //y = (x++,x++); // Error: using the result of a comma expression is not allowed y = x++,x++; // no error }
Comment #1 by nick — 2024-08-16T10:17:54Z
Sorry, that parses as `(y = x++), x++;`