gcc/testsuite/g++.dg/warn/Wunused-label-2.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-options "-Wunused" } |
| 3 | |
| 4 | // If __attribute__ ((unused)) follows a label and precedes a |
| 5 | // declaration, we should get a warning for the label, not the |
| 6 | // declaration. |
| 7 | |
| 8 | void |
| 9 | f1() |
| 10 | { |
| 11 | int i1; // { dg-warning "unused variable" } |
| 12 | l1: __attribute__ ((unused)) int i2; // { dg-warning "label \[^\n\]* not used" } |
| 13 | } |