Created on 2026-08-21.00:00:00 last changed yesterday
Proposed resolution (approved by CWG 2026-09-01):
Add in C.8.3 [diff.basic] as follows:
Affected subclause: 6.4.3 [basic.scope.block]
Change: Names declared in the outermost block scope of a for loop conflict with those declared in its init-statement.
[ Example:void f() { for (int i = 0; ; ) { long i = 1; // valid C, invalid C++ // ... } }-- end example]
Rationale: C99 introduced the possibility to declare variables in a for loop, but did not add C++' rule about conflicting declarations.
Effect on original feature: Change to semantics of well-defined feature.
Difficulty of converting: Syntactic transformation.
How widely used: Seldom.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-09-03 23:06:47 | admin | set | status: open -> tentatively ready |
| 2026-08-23 07:35:31 | admin | set | messages: + msg8658 |
| 2026-08-21 00:00:00 | admin | create | |