aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c')
-rw-r--r--clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c b/clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c
index 2150c81..233b729 100644
--- a/clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c
+++ b/clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -Wpointer-arith -verify %s
#define __counted_by_or_null(f) __attribute__((counted_by_or_null(f)))
#define __counted_by(f) __attribute__((counted_by(f)))
@@ -30,7 +30,9 @@ struct on_member_pointer_const_incomplete_ty {
};
struct on_member_pointer_void_ty {
- void* buf __counted_by_or_null(count); // expected-error{{'counted_by_or_null' cannot be applied to a pointer with pointee of unknown size because 'void' is an incomplete type}}
+ // expected-warning@+2{{'counted_by_or_null' on a pointer to void is a GNU extension, treated as 'sized_by_or_null'}}
+ // expected-note@+1{{use '__sized_by_or_null' to suppress this warning}}
+ void* buf __counted_by_or_null(count);
int count;
};