Debian Codegraph @

gcc/testsuite/g++.dg/expr/bitfield4.C

raw
1 // PR c++/30274
2 // { dg-do link }
3
4 struct S {
5 bool x : 4;
6 };
7
8 S s;
9
10 template <typename T>
11 void f(T);
12
13 template <>
14 void f(bool) {}
15
16 int main() {
17 f(s.x++); // { dg-warning "7:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } }
18 // { dg-error "forbidden" "" { target c++17 } .-1 }
19 f(++s.x); // { dg-warning "9:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } }
20 // { dg-error "forbidden" "" { target c++17 } .-1 }
21 }