blob: 3ef713595f19b04d694676de7ae6ade99e7f654c [file] [log] [blame]
// { dg-do compile { target c++17 } }
int
fn (bool b)
{
int r = 0;
r += b++; // { dg-error "8:use of an operand of type .bool. in .operator\\+\\+. is forbidden in" }
r += ++b; // { dg-error "10:use of an operand of type .bool. in .operator\\+\\+. is forbidden in" }
r += b--; // { dg-error "8:use of an operand of type .bool. in .operator--. is forbidden" }
r += --b; // { dg-error "10:use of an operand of type .bool. in .operator--. is forbidden" }
return r;
}