Date
2010-06-15.00:00:00
Message id
2531

Content

Proposed resolution (June, 2010):

  1. Change 8.6 [stmt.iter] paragraph 1 as follows:

  2. Iteration statements specify looping.

      iteration-statement:
        while ( condition ) statement
        do statement while ( expression ) ;
        for ( for-init-statement conditionopt ; expressionopt ) statement
        for ( for-range-declaration : expression for-range-initializer ) statement

      for-init-statement:
        expression-statement
        simple-declaration

      for-range-declaration:
        type-specifier-seq attribute-specifieropt declarator

      for-range-initializer:
        expression
        braced-init-list

    [Note: a for-init-statement ends with a semicolon. —end note]

  3. Change 8.6.5 [stmt.ranged] paragraph 1 as follows:

  4. The For a range-based for statement of the form

      for ( for-range-declaration : expression ) statement

    let range-init be equivalent to the expression surrounded by parentheses:

      ( expression )

    [Footnote: this ensures that a top-level comma operator cannot be reinterpreted as a delimiter between init-declarators in the declaration of __range. —end footnote] and for a range-based for statement of the form

      for ( for-range-declaration : braced-init-list ) statement

    let range-init be equivalent to the braced-init-list. In each case, a range-based for statement is equivalent to

      {
        auto && __range = ( expression ) range-init;
        for ( auto __begin = begin-expr,
        ...