[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

Pierre d'Herbemont via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 10 05:17:58 PDT 2024


================
@@ -74,6 +83,15 @@ int get_value(int *p) SHARED_LOCKS_REQUIRED(foo_.mu_){
 
 void unlock_scope(struct Mutex *const *mu) __attribute__((release_capability(**mu)));
 
+// Verify late parsing:
+#ifdef LATE_PARSING
+struct LateParsing {
+  int a_value_defined_before GUARDED_BY(a_mutex_defined_late);
+  struct Mutex *a_mutex_defined_late ACQUIRED_AFTER(a_mutex_defined_very_late);
+  struct Mutex *a_mutex_defined_very_late;
----------------
pdherbemont wrote:

Done!

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


More information about the cfe-commits mailing list