1 // { dg-do compile } 2 // { dg-options "-Wunused-label" } 3 // { dg-require-effective-target indirect_jumps } 4 5 extern void f9(); 6 7 template<int i> 8 void f1()9f1() 10 { 11 if (i) 12 return; 13 14 l1: f9(); // { dg-warning "not used" } 15 l3: ; f9(); // { dg-warning "not used" } 16 l4: __attribute__ ((unused)) ; f9(); 17 } 18 19 template 20 void f1<0>(); 21 22 template<int i> 23 void f2()24f2() 25 { 26 if (i) 27 return; 28 29 l1: f9(); // { dg-warning "not used" } 30 l3: ; f9(); // { dg-warning "not used" } 31 l4: __attribute__ ((unused)) ; f9(); 32 } 33 34 template 35 void f2<1>(); 36 37 template<int i> 38 void f3()39f3() 40 { 41 void* lab; 42 l1: f9(); 43 l2: __attribute__ ((unused)) ; f9(); 44 lab = i ? &&l1 : &&l2; 45 goto *lab; 46 } 47 48 template 49 void f3<0>(); 50 51 template 52 void f3<1>(); 53