diff options
Diffstat (limited to 'clang/test/SemaCXX/offsetof.cpp')
-rw-r--r-- | clang/test/SemaCXX/offsetof.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/offsetof.cpp b/clang/test/SemaCXX/offsetof.cpp index a1d907ab360..4be97a948f6 100644 --- a/clang/test/SemaCXX/offsetof.cpp +++ b/clang/test/SemaCXX/offsetof.cpp @@ -28,3 +28,11 @@ void test_ice(int i) { int array0[__builtin_offsetof(HasArray, array[5])]; int array1[__builtin_offsetof(HasArray, array[i])]; // expected-error{{variable length arrays are not permitted in C++}} } + +// Bitfields +struct has_bitfields { + int i : 7; + int j : 12; // expected-note{{bit-field is declared here}} +}; + +int test3 = __builtin_offsetof(struct has_bitfields, j); // expected-error{{cannot compute offset of bit-field 'j'}} |