re PR c++/70808 (Spurious -Wzero-as-null-pointer-constant for nullptr_t)
[official-gcc.git] / gcc / testsuite / c-c++-common / Wduplicated-branches-7.c
blob03721dc4cb632292fcf2576f761b44f5e548f9f8
1 /* PR c/64279 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wduplicated-branches" } */
5 struct S
7 int x;
8 } s;
9 int a[10];
11 #define XMEM(R) ((R).x)
12 #define XSTR(R) ((R).x)
14 void
15 f (int i)
17 if (i)
18 XMEM(s) = 1;
19 else
20 XSTR(s) = 1;
22 if (i) /* { dg-warning "this condition has identical branches" } */
23 s.x = 1;
24 else
25 s.x = 1;
27 if (i)
28 XMEM(s) = 1;
29 else
30 s.x = 1;
32 if (i)
33 s.x = 1;
34 else
35 XMEM(s) = 1;