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.
@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
*** Issue 16672 has been marked as a duplicate of this issue. ***
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