"Expressions that are effectively Boolean should not be used as operands to operators other than ..."
The list of the allowed operators has been corrected in TC1 to include &&, ||, !, =, ==, != and ?:
What about the function call operator () ?
If a Boolean value (by enforcement or by construction) is used as an argument to a function having a parameter whose type is Boolean (by enforcement), are we violating Rule 12.6? For instance:
Code: Select all
typedef /* Boolean-by-enforcement type */ bool_t;
void foo(bool_t b);
void bar(int32_t a, int32_t b) {
bool_t b = (a == b);
foo(b); /* Non-compliant? */
}
Code: Select all
int32_t bar(int32_t a, int32_t b) {
bool_t b = (a == b);
return b; /* Compliant? */
}