Created on 2002-07-29.00:00:00 last changed 161 months ago
[Voted into WP at October 2003 meeting.]
Proposed resolution (October 2002):
Change the beginning of the second sentence of 7.7 [expr.const] paragraph 1 which currently reads
An integral constant-expression can involve only literals (5.13 [lex.literal]), ...to say
An integral constant-expression can involve only literals of arithmetic types (5.13 [lex.literal], 6.8.2 [basic.fundamental]), ...
According to 15.2 [cpp.cond] paragraph 1, the if-group
#if "Hello, world"
is well-formed, since it is an integral constant expression. Since that may not be obvious, here is why:
7.7 [expr.const] paragraph 1 says that an integral constant expression may involve literals (5.13 [lex.literal]); "Hello, world" is a literal. It restricts operators to not use certain type conversions; this expression does not use type conversions. It further disallows functions, class objects, pointers, ... - this expression is none of those, since it is an array.
However, 15.2 [cpp.cond] paragraph 6 does not explain what to do with this if-group, since the expression evaluates neither to false(zero) nor true(non-zero).
|2008-10-05 00:00:00||admin||set||status: wp -> cd1|
|2004-04-09 00:00:00||admin||set||messages: + msg1008|
|2003-11-15 00:00:00||admin||set||status: ready -> wp|
|2003-04-25 00:00:00||admin||set||status: review -> ready|
|2002-11-08 00:00:00||admin||set||messages: + msg734|
|2002-11-08 00:00:00||admin||set||status: open -> review|