llvm-project
6d34cfac - [Sema] Diagnose tautological bounds checks (#120222)

Commit
286 days ago
[Sema] Diagnose tautological bounds checks (#120222) This diagnoses comparisons like `ptr + unsigned_index < ptr` and `ptr + unsigned_index >= ptr`, which are always false/true because addition of a pointer and an unsigned index cannot wrap (or the behavior is undefined). This warning is intended to help find broken bounds checks (which must be implemented in terms of uintptr_t instead). Fixes https://github.com/llvm/llvm-project/issues/120214.
Author
Parents
Loading