MForster added inline comments.

================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:5350
+
+  D->addAttr(::new (S.Context)
+                 NSErrorDomainAttr(S.Context, AL, IdentLoc->Ident));
----------------
aaron.ballman wrote:
> MForster wrote:
> > aaron.ballman wrote:
> > > Shouldn't we also be validating that what we found is an NSString that 
> > > has the correct properties? (That doesn't seem like it should be a change 
> > > which risks breaking code based on what I understood from Doug's 
> > > description.)
> > > Shouldn't we also be validating that what we found is an NSString that 
> > > has the correct properties?
> > 
> > Is your suggestion to string-compare the name of the type?
> >>Shouldn't we also be validating that what we found is an NSString that has 
> >>the correct properties?
> > Is your suggestion to string-compare the name of the type?
> 
> You should be able to compare the `QualType` of the resulting `VarDecl` 
> against `ASTContext::getObjCNSStringType()` (accounting for qualifiers, 
> pointers, etc).
Turns out that this didn't work well. `ASTContext::getObjCNSStringType()` is 
only initialized if ObjC string literals are instantiated without an `NSString` 
type being defined. In our case there is an `NSString` type, because we need to 
declare a global variable of that type.

I've resorted to a string comparison after all.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84005

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

Reply via email to