rsmith added inline comments.

================
Comment at: clang/docs/APINotes.rst:233-235
+  Note that the type is *not* parsed in the context where it will be used,
+  which means that macros are not available and nullability must be applied
+  explicitly (even in an ``NS_ASSUME_NONNULL_BEGIN`` section).
----------------
compnerd wrote:
> rsmith wrote:
> > So what context is it parsed in? Below you have an `NSArray *` example; how 
> > do we do the lookup for `NSArray`?
> A separate buffer is constructed where the annotations are processed.  During 
> semantic analysis, the requested APINotes are processed and the attributes 
> specified are applied to the declaration.
I've not been able to work out what the rule is, based on this documentation. 
The name `NSArray` isn't predeclared, so how is it found? How can a user ensure 
their types are visible to this parsing process? Are these things parsed as if 
they appear at the global scope in a translation unit in which the 
corresponding framework has been imported? (And if so, why wouldn't macros be 
available there too?) Whatever the rule is, I'd like to see it documented.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88446/new/

https://reviews.llvm.org/D88446

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

Reply via email to