Allow resolving headers from a PCH even after headers+PCH were moved to another path.
[clang.git] / test / Sema / bitfield.c
blob49c1c7d443617d51d9f73c4309f67a99cb4203ee
1 // RUN: %clang_cc1 %s -fsyntax-only -verify
2 enum e0; // expected-note{{forward declaration of 'enum e0'}}
4 struct a {
5 int a : -1; // expected-error{{bit-field 'a' has negative width}}
7 // rdar://6081627
8 int b : 33; // expected-error{{size of bit-field 'b' (33 bits) exceeds size of its type (32 bits)}}
10 int c : (1 + 0.25); // expected-error{{expression is not an integer constant expression}}
11 int d : (int)(1 + 0.25);
13 // rdar://6138816
14 int e : 0; // expected-error {{bit-field 'e' has zero width}}
16 float xx : 4; // expected-error {{bit-field 'xx' has non-integral type}}
18 // PR3607
19 enum e0 f : 1; // expected-error {{field has incomplete type 'enum e0'}}
21 int g : (_Bool)1;
23 // PR4017
24 char : 10; // expected-error {{size of anonymous bit-field (10 bits) exceeds size of its type (8 bits)}}
25 unsigned : -2; // expected-error {{anonymous bit-field has negative width (-2)}}
26 float : 12; // expected-error {{anonymous bit-field has non-integral type 'float'}}
29 struct b {unsigned x : 2;} x;
30 __typeof__(x.x+1) y;
31 int y;
33 struct {unsigned x : 2;} x2;
34 __typeof__((x.x+=1)+1) y;
35 __typeof__(x.x<<1) y;
36 int y;
38 struct PR8025 {
39 double : 2; // expected-error{{anonymous bit-field has non-integral type 'double'}}