Skip to content

Commit 8ef023e

Browse files
committed
Fix test failures related to 'counted_by' on 'void *'
1 parent e678f62 commit 8ef023e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/test/Sema/attr-counted-by-late-parsed-struct-ptrs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ struct on_member_pointer_const_incomplete_ty_ty_pos {
123123
};
124124

125125
struct on_member_pointer_void_ty_ty_pos {
126-
// expected-error@+1{{'counted_by' cannot be applied to a pointer with pointee of unknown size because 'void' is an incomplete type}}
126+
// expected-warning@+2{{'counted_by' on a pointer to void is a GNU extension, treated as 'sized_by'}}
127+
// expected-note@+1{{use '__sized_by' to suppress this warning}}
127128
void *__counted_by(count) buf;
128129
int count;
129130
};

clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ struct on_member_pointer_const_incomplete_ty_ty_pos {
124124
};
125125

126126
struct on_member_pointer_void_ty_ty_pos {
127-
// expected-error@+1{{'counted_by_or_null' cannot be applied to a pointer with pointee of unknown size because 'void' is an incomplete type}}
127+
// expected-warning@+2{{'counted_by_or_null' on a pointer to void is a GNU extension, treated as 'sized_by_or_null'}}
128+
// expected-note@+1{{use '__sized_by_or_null' to suppress this warning}}
128129
void *__counted_by_or_null(count) buf;
129130
int count;
130131
};

0 commit comments

Comments
 (0)