hanchenye-llvm-project/clang/test/Sema/bitfield.c

9 lines
335 B
C
Raw Normal View History

// RUN: clang %s -fsyntax-only -verify
struct a {
int a : -1; // expected-error{{bit-field 'a' has negative width}}
int b : 33; // expected-error{{size of bit-field 'b' exceeds size of its type (32 bits)}}
int c : (1 + 0.25); // expected-error{{expression is not an integer constant expression}}
int d : (int)(1 + 0.25);
};