On 31 January 2011 12:16, Hagen Paul Pfeifer wrote: > > On Mon, 31 Jan 2011 09:19:07 +0000, Jonathan Wakely wrote: > >> The code is wrong. sizeof expects either an expression, or a >> parenthesized type-id. (long) is not a type-id so ((long)) is not a >> parenthesized type-id, therefore it must be interpreted as an >> expression, but it's not a valid expression either. > > In sense of 6.5.3.4 - the sizeof operator where nearly every value is > allowed? Why not a parenthesized parenthesized type-id?
I incorrectly assumed Ralf's example code was C++, because he mentioned the libstdc++'s config.log, so that's the standard I referred to. The C standard has similar wording. In any case, EDG and Clang give the same error as GCC, for C or C++, so the question is moot: the standards say it's invalid and conforming compilers agree.