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

John McCall rjmccall at apple.com
Thu Feb 2 17:46:19 PST 2012


On Feb 2, 2012, at 2:41 PM, Abramo Bagnara wrote:
> 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.

If the value is merely unspecified, then it's still a constant expression
under the DR1313 wording.

John.



More information about the cfe-commits mailing list