1 // PR c/64279
2 // { dg-do compile }
3 // { dg-options "-Wduplicated-branches" }
4 
5 template <typename T>
6 void
f(signed char i,int * p)7 f (signed char i, int *p)
8 {
9   if (i)
10     *p = (signed short) i;
11   else
12     *p = (unsigned short) i;
13 
14   if (i) // { dg-warning "this condition has identical branches" }
15     *p = (T) i;
16   else
17     *p = (unsigned short) i;
18 }
19 
20 template void f<unsigned short>(signed char, int *); // { dg-message "required from here" }
21 template void f<signed short>(signed char, int *);
22