Debian Codegraph @

gcc/testsuite/obj-c++.dg/bitfield-5.mm

raw
1
2 /* Make sure that bitfield types are printed correctly, and that ivar redeclaration
3 (@interface vs. @implementation) checks take the bitfield width into account. */
4 /* Author: Ziemowit Laski <[email protected]> */
5 /* { dg-do compile } */
6 // { dg-additional-options "-Wno-objc-root-class" }
7
8 @interface Base {
9 int i;
10 }
11 @end
12
13 @interface WithBitfields: Base {
14 void *isa; /* { dg-line WithBitfields_isa } */
15 unsigned a: 3; /* { dg-line WithBitfields_a } */
16 signed b: 4;
17 int c: 5; /* { dg-line WithBitfields_c } */
18 }
19 @end
20
21 @implementation WithBitfields {
22 char *isa; /* { dg-error "conflicting instance variable type .char \\*isa." } */
23 /* { dg-error "previous declaration of .void \\*isa." "" { target *-*-* } WithBitfields_isa } */
24 unsigned a: 5; /* { dg-error "conflicting instance variable type .unsigned( int)? a: 5." } */
25 /* { dg-error "previous declaration of .unsigned( int)? a: 3." "" { target *-*-* } WithBitfields_a } */
26 signed b: 4; /* This one is fine. */
27 int c: 3; /* { dg-error "conflicting instance variable type .int c: 3." } */
28 /* { dg-error "previous declaration of .int c: 5." "" { target *-*-* } WithBitfields_c } */
29 }
30 @end