PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / init / bitfield2.C
blobe54b2e423fb6c322756ef533c7a75fa82a946aac
1 // PR c++/13371
2 // Bug: We were failing to properly protect the lhs on the line marked
3 // "here" from multiple evaluation.
5 // { dg-do run }
7 extern "C" int printf (const char *, ...);
9 enum E { E1, E2 };
11 struct A
13   E e : 8;
14   unsigned char c;
17 A ar[2];
19 int c;
21 int f()
23   ++c;
24   printf ("f()\n");
25   return 0;
28 int main()
30   ar[0].c = 0xff;
31   ar[f()].e = E1;               // here
32   return (c != 1 || ar[0].c != 0xff);
33 }