<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 04.02.2012, at 19:06, Howard Hinnant wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Feb 4, 2012, at 12:52 PM, Howard Hinnant wrote:<br><br><blockquote type="cite">On Feb 4, 2012, at 12:04 PM, Eli Friedman wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" color="#006312"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">[expr.shift]p2: [...] if E1 has a signed type and non-negative value,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">and E1×2E2 is representable in the result type, then that is the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">resulting value; otherwise, the behavior is undefined.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-Eli<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I see, you're point is that I've walked into undefined territory because I set the sign bit on the long long?  Does changing 1LL to 1ULL make the compiler happy?<br></blockquote><br>Another question:  Is there a motivation for giving the compile time behavior of these operations a different behavior than they would have at run time?<br></div></blockquote></div><br><div>The runtime behavior is undefined. Do you really want the compile time behavior to be the same?</div><div><br></div><div>As a side note, I think the diagnostics here could still be improved.</div><div><br></div><div>Sebastian</div></body></html>