-
Notifications
You must be signed in to change notification settings - Fork 13.6k
clang/lib/Sema/SemaOverload.cpp: 2 * boolean in compare ? #102912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-frontend Author: None (dcb314)
Static analyser cppcheck says:
clang/lib/Sema/SemaOverload.cpp:512:26: style: Comparison of a variable having boolean value using relational (<, >, <= or >=) operator. [comparisonOfBoolWithBoolError] Source code is
I am pretty sure comparison operators don't apply to booleans. clang/lib/Sema/SemaOverload.cpp:545:44: style: Comparison of a variable having boolean value using relational (<, >, <= or >=) operator. [comparisonOfBoolWithBoolError] Duplicate. |
This was previously effectively I make sense of it as: If This is personal opinion, Clang maintainers might disagree. It's a very easy NFC fix. |
FWIW, when I was reviewing those changes, I definitely had to spend a while to convince myself that code was correct, so it probably would be reasonable to rewrite it. |
Static analyser tool cppcheck flags ordered comparison with `bool`s. Replace with equivalent logical operators to prevent this. Closes #102912
Static analyser tool cppcheck flags ordered comparison with `bool`s. Replace with equivalent logical operators to prevent this. Closes llvm#102912
Static analyser cppcheck says:
clang/lib/Sema/SemaOverload.cpp:512:26: style: Comparison of a variable having boolean value using relational (<, >, <= or >=) operator. [comparisonOfBoolWithBoolError]
Source code is
I am pretty sure comparison operators don't apply to booleans.
clang/lib/Sema/SemaOverload.cpp:545:44: style: Comparison of a variable having boolean value using relational (<, >, <= or >=) operator. [comparisonOfBoolWithBoolError]
Duplicate.
The text was updated successfully, but these errors were encountered: