================
@@ -29,6 +30,22 @@ struct LOCKABLE Mutex {};
 
 struct Foo {
   struct Mutex *mu_;
+  int  a_value GUARDED_BY(mu_);
+
+  struct Bar {
+    struct Mutex *other_mu ACQUIRED_AFTER(mu_);
----------------
pdherbemont wrote:

> I'm not entirely sure how nested structs work in C, but should we be able to 
> reference the parent from the child?

I think so, it does read nicely it feels – I see why this could cause a problem 
though: if the child structure is used outside of the parent, there is an 
ambiguity. Maybe this should be restricted to anonymous struct? Or maybe we 
need to taint the child struct so that it's not reused outside of the parent?

Anyhow, I'll add a comment as suggested!

https://github.com/llvm/llvm-project/pull/95455
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to