2008-12-07 04:33:04 +08:00
|
|
|
// RUN: clang %s -fsyntax-only -verify
|
2009-03-11 05:58:27 +08:00
|
|
|
enum e0; // expected-note{{forward declaration of 'enum e0'}}
|
2008-12-07 04:33:04 +08:00
|
|
|
|
|
|
|
struct a {
|
|
|
|
int a : -1; // expected-error{{bit-field 'a' has negative width}}
|
2008-12-12 07:11:52 +08:00
|
|
|
|
|
|
|
// rdar://6081627
|
2008-12-07 04:33:04 +08:00
|
|
|
int b : 33; // expected-error{{size of bit-field 'b' exceeds size of its type (32 bits)}}
|
2008-12-12 07:11:52 +08:00
|
|
|
|
2008-12-07 04:33:04 +08:00
|
|
|
int c : (1 + 0.25); // expected-error{{expression is not an integer constant expression}}
|
|
|
|
int d : (int)(1 + 0.25);
|
2008-12-12 12:56:04 +08:00
|
|
|
|
|
|
|
// rdar://6138816
|
|
|
|
int e : 0; // expected-error {{bit-field 'e' has zero width}}
|
2009-03-06 06:45:59 +08:00
|
|
|
|
|
|
|
float xx : 4; // expected-error {{bit-field 'xx' has non-integral type}}
|
|
|
|
|
|
|
|
// PR3607
|
|
|
|
enum e0 f : 1; // expected-error {{field has incomplete type 'enum e0'}}
|
2008-12-07 04:33:04 +08:00
|
|
|
};
|
2009-03-06 06:45:59 +08:00
|
|
|
|