aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wunused-var-6.c
blob: f48a4554d73da99f889adc1f7c99daaa300f2c64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* PR c/99588 */
/* { dg-do compile } */
/* { dg-options "-std=c11 -Wunused-but-set-variable" } */

void bar (int, ...);
struct S { int a, b, c; };
typedef _Atomic struct S T;

void
foo (void)
{
  static T x = (struct S) { 0, 0, 0 };	/* { dg-bogus "set but not used" } */
  bar (0, x = (struct S) { 1, 1, 1 });
}