================
@@ -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_);
----------------
aaronpuchert wrote:

I'm not entirely sure how nested `struct`s work in C, but should we be able to 
reference the parent from the child? At least in C++, you can declare objects 
of the child independent of the parent, so this wouldn't be meaningful.

This is an existing issue with with the `ACQUIRED_{AFTER,BEFORE}` 
implementation, but if you add a test for this (which is Ok to make sure it 
doesn't crash), you should probably also add a comment that this should perhaps 
be disallowed because it's not meaningful (as I understand).

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