On Mon, Jan 30, 2012 at 4:29 PM, Eli Friedman <[email protected]>wrote:

> On Mon, Jan 30, 2012 at 2:27 PM, Richard Smith
> <[email protected]> wrote:
> > Author: rsmith
> > Date: Mon Jan 30 16:27:01 2012
> > New Revision: 149286
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=149286&view=rev
> > Log:
> > constexpr: disallow signed integer overflow in integral conversions in
> constant
> > expressions in C++11.
>
> Standard citation?  As far as I can tell, the result of
> (int)0x80000000u is implementation-defined, but it's still a constant
> expression given how we define it.
>

Oops, r149327. This was (incorrectly) factored out of another change which
I'm still questioning... Consider:

  enum E { n = 2 };
  E e = (E)5;

5 is not in the range of values of the enumeration (which is 0..3 by
[dcl.enum]p7), but is clearly in the underlying type. Is this value in the
range of representable values for its type (or is this undefined behavior
by [expr]p4)?

Thanks!
Richard
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to