<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 23, 2011, at 6:36 PM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Wed, Feb 23, 2011 at 5:58 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":3fu">Mentioning the "promoted type" doesn't make sense in a lot of cases (when there is no promotion happening).  It seems completely fine to simplify it to:<br>
<br>
"shift result (%0) requires %1 bits to represent, but %2 only has %3 bits"<br>
<br>
What do you think?</div></blockquote></div><br><div>I agree the 'promoted' part may not add much to some folks. It's a bit standards-ish. Happy to drop that part.</div><div><br></div><div>However, I think highlighting that the 'int' is the type of the shift expression really helps. When we found this in our code, one of the primary responses we had was:</div>
<div><br></div><div>int64_t i = 10 << 30;</div><div>^^^^^^</div><div>"But it says int64_t right there!!"</div><div><br></div><div>Basically, I'm hoping we can educate the user on where the type came from to understand why this code is wrong.</div>
</blockquote></div><br><div>Saying "but 'int' only has 32 bits" seems to do the trick, no?  This is a great example of a case with no promotion involved!</div><div><br></div><div>-Chris</div></body></html>