This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118f. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-12-05


3132. Unclear disambiguation rule for condition

Section: 8.1  [stmt.pre]     Status: tentatively ready     Submitter: CWG     Date: 2025-11-21

The disambiguation rule in 8.1 [stmt.pre] paragraph 7 is unclear, because "declaration" is not a (uniquely defined) grammatical category.

Proposed resolution (approved by CWG 2025-12-05):

  1. Change in 8.1 [stmt.pre] paragraph 1 as follows:

      condition :
          expression
          condition-declaration
    
      condition-declaration :
          attribute-specifier-seqopt decl-specifier-seq declarator brace-or-equal-initializer
          structured-binding-declaration initializer
      
    
  2. Change in 8.1 [stmt.pre] paragraph 7 as follows:

    If a condition can be syntactically resolved as either an expression expression or a declaration condition-declaration, it is interpreted as the latter.