| 1 |
// PR c++/30274 |
| 2 |
// { dg-do run { target c++14_down } } |
| 3 |
// { dg-do compile { target c++17 } } |
| 4 |
|
| 5 |
struct S { |
| 6 |
bool x : 4; |
| 7 |
}; |
| 8 |
|
| 9 |
S s; |
| 10 |
|
| 11 |
int main() { |
| 12 |
s.x++; // { dg-warning "5:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } |
| 13 |
// { dg-error "forbidden" "" { target c++17 } .-1 } |
| 14 |
if (s.x != 1) |
| 15 |
return 1; |
| 16 |
++s.x; // { dg-warning "7:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } |
| 17 |
// { dg-error "forbidden" "" { target c++17 } .-1 } |
| 18 |
if (s.x != 1) |
| 19 |
return 2; |
| 20 |
} |