Topic: conditions


Author: ti953017@rzcipa03.rz.tu-bs.de (Andreas Rossberg)
Date: 1995/05/31
Raw View
In stmt.select the draft reads

    [...]

 selection-statement:
  if ( condition ) statement
  if ( condition ) statement else statement
  switch ( condition ) statement

 condition:
  expression
  type-specifier-seq declarator = assignment-expression

    [...]

4   The value of a condition that is an initialized declaration is the value
    of a temporary object of type bool initialized with the value of the
    declared variable. The value of a condition that is an expression is the
    value of the expression. The value of the condition will be referred to
    as simply 'the condition' where the usage is unambiguous.


Shouldn't that paragraph simply say

4   The value of a condition that is an initialized declaration is the value
    of the
    declared variable. The value of a condition that is an expression is the
    value of the expression. The value of the condition will be referred to
    as simply 'the condition' where the usage is unambiguous.

Otherwise, declarations in switch statements wouldn't be of much use. The
conversion to bool is stated again in the text later on, anyway.

Is this an oversight?


 - Andreas Rossberg