[Sema] -Wtautological-compare: handle comparison of unsigned with 0S.

Description

[Sema] -Wtautological-compare: handle comparison of unsigned with 0S.

Summary:
This is a first half(?) of a fix for the following bug:
https://bugs.llvm.org/show_bug.cgi?id=34147 (gcc -Wtype-limits)

GCC's -Wtype-limits does warn on comparison of unsigned value
with signed zero (as in, with 0), but clang only warns if the
zero is unsigned (i.e. 0U).

Also, be careful not to double-warn, or falsely warn on
comparison of signed/fp variable and signed 0.

Yes, all these testcases are needed.

Testing: $ ninja check-clang-sema check-clang-semacxx
Also, no new warnings for clang stage-2 build.

Reviewers: rjmccall, rsmith, aaron.ballman

Reviewed By: rjmccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D37565

Details

Committed
lebedevriSep 7 2017, 3:14 PM
Reviewer
rjmccall
Differential Revision
D37565: [Sema] -Wtautological-compare: handle comparison of unsigned with 0S.
Parents
rC312749: Add target triple to improve the happiness of MSVC buildbots.
Branches
Unknown
Tags
Unknown