Example #1
0
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}}
}
Example #2
0
File: bool.cpp Project: aaasz/SHP
void test2() {
  int n = 2;
  static_assert_arg_is_bool(n && 4);
  static_assert_arg_is_bool(n || 5);
}