Bug 23480 – non-empty ForStatement Increment clause should require a side effect
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2022-11-13T11:28:29Z
Last change time
2022-11-15T13:49:38Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Nick Treleaven
Comments
Comment #0 by nick — 2022-11-13T11:28:29Z
int j;
for({} j; 1*1) {}
for({j=2; int d = 3; } j+d<7; {j++; d++; }) {}
Each of the above Increment clauses should show 'has no effect' errors.
PR incoming.
Comment #1 by dlang-bot — 2022-11-13T11:32:22Z
@ntrel created dlang/dmd pull request #14638 "Fix Issue 23480 - non-empty ForStatement Increment clause should requ…" fixing this issue:
- Fix Issue 23480 - non-empty ForStatement Increment clause should require a side effect
https://github.com/dlang/dmd/pull/14638
Comment #2 by razvan.nitu1305 — 2022-11-14T11:03:06Z
*** Issue 16672 has been marked as a duplicate of this issue. ***
Comment #3 by dlang-bot — 2022-11-15T13:49:38Z
dlang/dmd pull request #14638 "Fix Issue 23480 - non-empty ForStatement Increment clause should requ…" was merged into master:
- 6f0e20f4da6c142d062551c46dfc0a0392e6804b by Nick Treleaven:
Fix Issue 23480 - non-empty ForStatement Increment clause should require a side effect
https://github.com/dlang/dmd/pull/14638