[cfe-commits] r149286 - in /cfe/trunk: lib/AST/ExprConstant.cpp lib/Sema/SemaOverload.cpp test/CXX/expr/expr.const/p2-0x.cpp

Abramo Bagnara abramo.bagnara at gmail.com
Thu Feb 2 14:41:02 PST 2012


Il 02/02/2012 23:27, Richard Smith ha scritto:
> 
> 
> Yes, absolutely. As in my original example:
> 
>    enum E { n = 2 };
>    E e = (E)5;
> 
> Here, I think that (E)5 is not a constant expression, but (E)3 is.
> Possibly we're in violent agreement about that?

My reading of the standard confirms that: the value of (E)5 is defined
"unspecified" and there is no warranty that (int)(E)5 is equal to 5.




More information about the cfe-commits mailing list