MISRAC++2023-7.0.1 (C++ only)
In this section:
Synopsis
(Required) There shall be no conversion from type bool
Enabled by default
Yes
Severity/Certainty
Medium/Low

Full description
Conversion from bool shall not be used
Coding standards
This check does not correspond to any coding standard rules.
Code examples
The following code example fails the check and will give a warning:
void example(bool b) {
if (b & 1) ;
}
The following code example passes the check and will not give a warning about this issue:
void example(bool b) {
if (b) ;
}