clang/test/Sema/attr-counted-by-vla-sizeless-types.c
raw| 1 | // __SVInt8_t is specific to ARM64 so specify that in the target triple |
| 2 | // RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s |
| 3 | |
| 4 | #define __counted_by(f) __attribute__((counted_by(f))) |
| 5 | |
| 6 | struct on_sizeless_elt_ty { |
| 7 | int count; |
| 8 | // expected-error@+2{{'counted_by' only applies to pointers or C99 flexible array members}} |
| 9 | // expected-error@+1{{array has sizeless element type '__SVInt8_t'}} |
| 10 | __SVInt8_t arr[] __counted_by(count); |
| 11 | }; |