[PATCH] D39462: [Sema] Implement -Wmaybe-tautological-constant-compare for when the tautologicalness is data model dependent

Brian Cain via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 12:51:03 PST 2017


bcain added a comment.

I'd like to understand/resurrect this change, so I'll try to summarize.  Please correct this as appropriate:

1. We got here because libc++ has code that triggers a warning for some targets (those whose `int` and `long` have the same size).
2. This change would "move" the existing logic for `-Wtautological-constant-compare` to `-Wmaybe-tautological-constant-compare` and replace `-Wtautological-constant-compare` logic with one less likely to report that the code in libc++ is wrong.
3. A superior checker could be defined that would thread the needle between these cases: warning only when it should and not when it shouldn't.  This would be preferred because it avoids the creation of similar but slightly distinct warnings.

If this summary is really the case, what's the best way to break this stalemate?  Could we implement this change for now and improve the warnings later?  If the answer is 'no', then let's please restore https://reviews.llvm.org/D39149.

AFAICT Marshall and John have strong feelings on each of these proposed libc++ and clang changes -- it would be valuable if each of you could weigh in.


Repository:
  rL LLVM

https://reviews.llvm.org/D39462





More information about the cfe-commits mailing list