Skip to content

Commit 581ba68

Browse files
committed
fixup: add a test for static struct field members
Ensure static fields are ignored.
1 parent 4ec171d commit 581ba68

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clang/test/SemaCXX/attr-malloc_span.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
22

3+
struct span_with_static {
4+
void *ptr;
5+
int n;
6+
static int static_field;
7+
};
8+
9+
span_with_static returns_span_with_static (void) __attribute((malloc_span)); // no-warning
10+
311
class SomeClass {
412
public:
513
int Data;

0 commit comments

Comments
 (0)