N3545 Allowing in ICE floating literals immediately converted to int -------------------------------------------------------------------- Author: Javier A. Múgica Purpose: Correct an anomaly in ICE Description ------------ The only place floating, named, or compound literal constants of arithmetic type are allowed in integer constant expressinos is as immediate operands of casts. There are other operations that immediately convert the value to bool (or behave "as if"). Thus, those at the left are not allowed as ICE, while those at the right are: ! 1.0 ! (bool)1.0 1.0 && 0 (bool)1.0 && 0 1.0 || 0 (bool)1.0 || 0 1.0 ? 1 : 0 (bool)1.0 ? 1 : 0 This may be a historical reason, the type bool having been introduced later than floating-point literals in integer constant expressions. We believe there is currently no reason not to allow those expressions at the left. Further, allowing them helps close the gap between standard ICE and possible implementation-defined ICE. Proposed wording ---------------- Replace, in 6.6 Constant expressions, floating, named, or compound literal constants of arithmetic type that are the immediate operands of casts. by floating, named, or compound literal constants of arithmetic type that are immediately converted to a value of integer type (operands of casts, of the unary ! operator, of the logical AND and OR operators and the first operand of the ternary conditional operator).