summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/bitfield5.C
blob: 3d18e159cc0636e6488be4cce1e4880812aec26e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/30274
// { dg-do run }

struct S {
  bool x : 4;
};

S s;

int main() {
  s.x++;
  if (s.x != 1)
    return 1;
  ++s.x;
  if (s.x != 1)
    return 2;
}