2008-12-07 04:33:04 +08:00
|
|
|
// RUN: clang %s -fsyntax-only -verify
|
|
|
|
|
|
|
|
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}}
|
2008-12-07 04:33:04 +08:00
|
|
|
};
|