blob: 3ba1a29366beb3b9f364acffa28615059094bc81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* PR c/64279 */
/* { dg-do compile } */
/* { dg-options "-Wduplicated-branches" } */
/* { dg-options "-fpermissive -Wduplicated-branches" { target c } } */
void
f (int i)
{
if (i) /* { dg-warning "this condition has identical branches" } */
return 0;
/* { dg-warning ".return. with a value" "" { target c } .-1 } */
/* { dg-error "return-statement with a value" "" { target c++ } .-2 } */
else
return 0;
/* { dg-warning ".return. with a value" "" { target c } .-1 } */
/* { dg-error "return-statement with a value" "" { target c++ } .-2 } */
}
|