False positive for use_is_even_rather_than_modulo
#4915
Labels
false-positive
P3
A lower priority bug or feature request
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Describe the issue
In a constant expression, the use of
x % 2 == 0
is a valid constant expression (assuming x is const), however.isEven
is not.To Reproduce
Example 1:
Example 2:
Expected behavior
use_is_even_rather_than_modulo
should not be thrown when the surroundings are const.This may also apply to other lints that apply similar suggestions: they should all be
const
-aware.The text was updated successfully, but these errors were encountered: