Debian Codegraph @

clang/test/Sema/attr-sized-by-struct-ptrs-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 __sized_by(f) __attribute__((sized_by(f)))
5
6 struct on_sizeless_pointee_ty {
7 int count;
8 // expected-error@+1{{'sized_by' cannot be applied to a pointer with pointee of unknown size because '__SVInt8_t' is a sizeless type}}
9 __SVInt8_t* member __sized_by(count);
10 };
11
12 struct on_sizeless_ty {
13 int count;
14 // expected-error-re@+2{{'sized_by' only applies to pointers{{$}}}}
15 // expected-error@+1{{field has sizeless type '__SVInt8_t'}}
16 __SVInt8_t member __sized_by(count);
17 };