Created on 2025-03-24.00:00:00 last changed 1 week ago
Additional notes (March, 2025)
Forwarded to SG22 via paper issue #2294, by decision of the CWG chair.
Consider:
#if 1 ? 1, 0: 3 #error #endif
Is this a well-formed translation unit?
According to 15.2 [cpp.cond] paragraph 10, C23 6.10.2 paragraph 3 and C23 6.6, the controlling expression is required to be a syntactic constant-expression (7.7 [expr.const]). (Concerns about C++ expressions vs. C expressions are handled via issue 1436.)
However, implementations uniformly reject the example (gcc and clang only in pedantic mode), because a comma operator appears in the controlling expression. There is no apparent normative basis for the rejection.
Do all implementations have the same bug, or do both C and C++ share the same specification hole?
History | |||
---|---|---|---|
Date | User | Action | Args |
2025-03-25 13:43:17 | admin | set | messages: + msg8005 |
2025-03-24 00:00:00 | admin | create |