The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
29.02k
stars
11.96k
forks
source link
misc-incorrect-roundings does not catch incorrect rounding within the Conditional Operator #40399
Open
llvmbot opened 5 years ago
Extended Description
I run the checker misc-incorrect-roundings on this piece of code:
return (int) (x < 0 ? x - 0.5 : x + 0.5);
In this case Clang tidy does not pick up on the “x + 0.5” as being an incorrect rounding, which it is.