[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 15:49:37 PDT 2024


================
@@ -1,10 +1,11 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta -fexperimental-late-parse-attributes -DLATE_PARSING %s
 
 #define LOCKABLE            __attribute__ ((lockable))
 #define SCOPED_LOCKABLE     __attribute__ ((scoped_lockable))
-#define GUARDED_BY(x)       __attribute__ ((guarded_by(x)))
+#define GUARDED_BY(...)     __attribute__ ((guarded_by(__VA_ARGS__)))
----------------
rapidsna wrote:

What's the reason to change it to take va_arg?

https://github.com/llvm/llvm-project/pull/95455


More information about the cfe-commits mailing list