| 1 |
// PR c++/117880 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-Wduplicated-branches" } |
| 4 |
|
| 5 |
struct X {}; |
| 6 |
|
| 7 |
template<typename> |
| 8 |
struct S { |
| 9 |
void g1 () { false ? void() : void(); } // { dg-warning "this condition has identical branches" } |
| 10 |
void g2 () { false ? int() : int(); } // { dg-warning "this condition has identical branches" } |
| 11 |
void g3 () { int() ? : int(); } // { dg-warning "this condition has identical branches" } |
| 12 |
void g4 () { false ? int() : double(); } |
| 13 |
void g5 () { false ? unsigned() : int(); } |
| 14 |
void g6 () { false ? signed() : int(); } // { dg-warning "this condition has identical branches" } |
| 15 |
// Two different TARGET_EXPRs. |
| 16 |
void g7 () { false ? X() : X(); } |
| 17 |
}; |