void test2() { int n = 2; static_assert_arg_is_bool(n && 4); // expected-warning {{use of logical '&&' with constant operand}} \ // expected-note {{use '&' for a bitwise operation}} \ // expected-note {{remove constant to silence this warning}} static_assert_arg_is_bool(n || 5); // expected-warning {{use of logical '||' with constant operand}} \ // expected-note {{use '|' for a bitwise operation}} }
void test2() { int n = 2; static_assert_arg_is_bool(n && 4); static_assert_arg_is_bool(n || 5); }