<div class="gmail_quote">On Mon, Jan 30, 2012 at 4:29 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Jan 30, 2012 at 2:27 PM, Richard Smith<br>
<<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>> wrote:<br>
> Author: rsmith<br>
> Date: Mon Jan 30 16:27:01 2012<br>
> New Revision: 149286<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=149286&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=149286&view=rev</a><br>
> Log:<br>
> constexpr: disallow signed integer overflow in integral conversions in constant<br>
> expressions in C++11.<br>
<br>
</div>Standard citation?  As far as I can tell, the result of<br>
(int)0x80000000u is implementation-defined, but it's still a constant<br>
expression given how we define it.<br></blockquote><div><br></div><div>Oops, r149327. This was (incorrectly) factored out of another change which I'm still questioning... Consider:</div><div><br></div><div>  enum E { n = 2 };</div>
<div>  E e = (E)5;</div><div><br></div><div>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)?</div>
<div><br></div><div>Thanks!</div><div>Richard</div></div>