| 1 |
// PR c++/99565 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-Wduplicated-branches" } |
| 4 |
|
| 5 |
struct A { |
| 6 |
union { int a; int b; }; |
| 7 |
int& foo (bool x) { return x ? a : b; } // { dg-bogus "this condition has identical branches" } |
| 8 |
void bar (bool x, int y) { if (x) a = y; else b = y; } |
| 9 |
}; |