[Sema] Re-land: Diagnose tautological comparison with type's min/max values

Description

[Sema] Re-land: Diagnose tautological comparison with type's min/max values

The first attempt, rL315614 was reverted because one libcxx
test broke, and i did not know at the time how to deal with it.

Summary:
Currently, clang only diagnoses completely out-of-range comparisons (e.g. char and constant 300),
and comparisons of unsigned and 0. But gcc also does diagnose the comparisons with the
std::numeric_limits<>::max() / std::numeric_limits<>::min() so to speak

Finally Fixes https://bugs.llvm.org/show_bug.cgi?id=34147
Continuation of https://reviews.llvm.org/D37565

Reviewers: rjmccall, rsmith, aaron.ballman

Reviewed By: rsmith

Subscribers: rtrieu, jroelofs, cfe-commits

Tags: #clang

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

Details

Committed
lebedevriOct 15 2017, 1:13 PM
Reviewer
rsmith
Differential Revision
D38101: [Sema] Diagnose tautological comparison with type's min/max values
Parents
rL315874: Silence clang's -Wtautological-constant-compare in last_write_time.pass.cpp
Branches
Unknown
Tags
Unknown