| 1 |
/* Test enumerators with attributes. */ |
| 2 |
/* PR c/47043 */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
|
| 5 |
enum E { |
| 6 |
A __attribute__((deprecated)), |
| 7 |
B __attribute__((deprecated ("foo"))), |
| 8 |
C __attribute__((deprecated)) = 10, |
| 9 |
D __attribute__((deprecated ("foo"))) = 15, |
| 10 |
E |
| 11 |
}; |
| 12 |
|
| 13 |
int |
| 14 |
f (int i) |
| 15 |
{ |
| 16 |
i += A; /* { dg-warning ".A. is deprecated" } */ |
| 17 |
i += B; /* { dg-warning ".B. is deprecated" } */ |
| 18 |
i += C; /* { dg-warning ".C. is deprecated" } */ |
| 19 |
i += D; /* { dg-warning ".D. is deprecated" } */ |
| 20 |
i += E; |
| 21 |
return i; |
| 22 |
} |