[cfe-commits] r126342 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaExpr.cpp test/Analysis/retain-release-basic-store.m test/Analysis/retain-release-gc-only.m test/Analysis/retain-release-regio
Chandler Carruth
chandlerc at gmail.com
Wed Feb 23 18:36:34 PST 2011
On Wed, Feb 23, 2011 at 5:58 PM, Chris Lattner <clattner at apple.com> wrote:
> 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:
>
> "shift result (%0) requires %1 bits to represent, but %2 only has %3 bits"
>
> What do you think?
>
I agree the 'promoted' part may not add much to some folks. It's a bit
standards-ish. Happy to drop that part.
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:
int64_t i = 10 << 30;
^^^^^^
"But it says int64_t right there!!"
Basically, I'm hoping we can educate the user on where the type came from to
understand why this code is wrong.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110223/7ae160c8/attachment.html>
More information about the cfe-commits
mailing list