NoQ added inline comments.

================
Comment at: test/Analysis/dispatch-once.m:62
+- (void)test_ivar_struct_from_inside {
+  dispatch_once(&s.once, ^{}); // expected-warning{{Call to 'dispatch_once' 
uses the instance variable 's' for the predicate value.}}
+}
----------------
dcoughlin wrote:
> Interesting. Have you seen this pattern in the wild?
> 
> I think this diagnostic is a little bit confusing since the ivar itself isn't 
> being used for the predicate value.
> 
> Maybe "... uses a subfield of the instance variable 's' for the predicate 
> value"? 
> 
> 
> 
> 
Not yet, so this is more of a "because we can" test. That said, i'm not sure 
about the warning message: it might also be an array element, not necessarily a 
field, and not necessarily a direct subfield or direct element.

Added array tests and an attempt on a safe warning message.


https://reviews.llvm.org/D25909



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to