PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wduplicated-branches1.C
blob1553613f9ec9b90af4e48e7aa5177cca40bba6eb
1 // PR c/64279
2 // { dg-do compile }
3 // { dg-options "-Wduplicated-branches" }
5 template <typename T>
6 void
7 f (signed char i, int *p)
9   if (i)
10     *p = (signed short) i;
11   else
12     *p = (unsigned short) i;
14   if (i) // { dg-warning "this condition has identical branches" }
15     *p = (T) i;
16   else
17     *p = (unsigned short) i;
20 template void f<unsigned short>(signed char, int *); // { dg-message "required from here" }
21 template void f<signed short>(signed char, int *);