Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/c-c++-common/attributes-enum-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 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 } |