2017-06-14 Paolo Carlini <paolo.carlini@oracle.com>
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wunused-label-3.C
blob7479ca20c370640903ad52d93471bb0b364d7d2d
1 // { dg-do compile }
2 // { dg-options "-Wunused-label" }
4 extern void f9();
6 template<int i>
7 void
8 f1()
10   if (i)
11     return;
13  l1: f9();                              // { dg-warning "not used" }
14  l3: ; f9();                            // { dg-warning "not used" }
15  l4: __attribute__ ((unused)) ; f9();
18 template
19 void f1<0>();
21 template<int i>
22 void
23 f2()
25   if (i)
26     return;
28  l1: f9();                              // { dg-warning "not used" }
29  l3: ; f9();                            // { dg-warning "not used" }
30  l4: __attribute__ ((unused)) ; f9();
33 template
34 void f2<1>();
36 template<int i>
37 void
38 f3()
40   void* lab;
41  l1: f9();
42  l2: __attribute__ ((unused)) ; f9();
43   lab = i ? &&l1 : &&l2;
44   goto *lab;
47 template
48 void f3<0>();
50 template
51 void f3<1>();