ObjC literals (NSDictionary, NSArray, Boxed Expressions) use the same
code to instantiate ObjCInterfaceDecl of corresponding classes.

The patch extracts duplicated code into one method and unifies
validation of the ObjCInterfaceDecl’s.

Also, diagnostic for NSDictionary/NSArray was changed a bit.
Before:

@class NSDictionary;
// …
id dictionary = @{}; // expected-error {{declaration of 
'dictionaryWithObjects:forKeys:count:' is missing in NSDictionary class}}

After:

@class NSDictionary; // expected-note {{forward declaration of class here}}
// …
id dictionary = @{}; // expected-error {{NSDictionary must be available to use 
Objective-C dictionary literals}}

Implementation ‘before’ is correct, but it’s not that precise and might be 
confusing.
--
AlexDenisov
Software Engineer,
http://lowlevelbits.org

Attachment: lookup_objc_literal_interface_decl.patch
Description: Binary data

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to