diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index bac681e87139..55f237736c23 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -500,7 +500,7 @@ def note_while_in_implementation : Note< def note_class_declared : Note< "class is declared here">; def note_receiver_class_declared : Note< - "receiver is object of the class that is declared here">; + "receiver is instance of class declared here">; def note_receiver_is_id : Note< "receiver is treated with 'id' type for purpose of method lookup">; def note_suppressed_class_declare : Note< diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 7c701ea04019..23116d84addd 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -1227,11 +1227,9 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType, SelectorLocs.back()); // Find the class to which we are sending this message. if (ReceiverType->isObjCObjectPointerType()) { - QualType ClassType = - ReceiverType->getAs()->getPointeeType(); - if (const ObjCObjectType *ClassTPtr = ClassType->getAs()) - if (ObjCInterfaceDecl *Class = ClassTPtr->getInterface()) - Diag(Class->getLocation(), diag::note_receiver_class_declared); + if (ObjCInterfaceDecl *Class = + ReceiverType->getAs()->getInterfaceDecl()) + Diag(Class->getLocation(), diag::note_receiver_class_declared); } } diff --git a/clang/test/Analysis/inlining/DynDispatchBifurcate.m b/clang/test/Analysis/inlining/DynDispatchBifurcate.m index d8af213a065f..0ce079654e98 100644 --- a/clang/test/Analysis/inlining/DynDispatchBifurcate.m +++ b/clang/test/Analysis/inlining/DynDispatchBifurcate.m @@ -181,7 +181,7 @@ int testPropertySynthesized(PublicClass *p) { } // Test definition not available edge case. -@interface DefNotAvailClass : NSObject // expected-note {{receiver is object of the class that is declared here}} +@interface DefNotAvailClass : NSObject // expected-note {{receiver is instance of class declared here}} @end id testDefNotAvailableInlined(DefNotAvailClass *C) { return [C mem]; // expected-warning {{instance method '-mem' not found}} diff --git a/clang/test/Analysis/rdar-6540084.m b/clang/test/Analysis/rdar-6540084.m index d93450b5c5dd..e928710b387d 100644 --- a/clang/test/Analysis/rdar-6540084.m +++ b/clang/test/Analysis/rdar-6540084.m @@ -9,13 +9,13 @@ typedef struct _NSZone NSZone; @protocol NSObject - (BOOL)isEqual:(id)object; @end @interface NSObject {} @end extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); -@class NSArray; // expected-note {{receiver is object of the class that is declared here}} +@class NSArray; // expected-note {{receiver is instance of class declared here}} @class NSMutableArray, NSIndexSet, NSView, NSPredicate, NSString, NSViewAnimation, NSTimer; // expected-note{{forward declaration of class here}} @interface FooBazController : NSObject {} @end typedef struct {} TazVersion; @class TazNode; -@interface TazGuttenberg : NSObject {} typedef NSUInteger BugsBunnyType; @end // expected-note {{receiver is object of the class that is declared here}} +@interface TazGuttenberg : NSObject {} typedef NSUInteger BugsBunnyType; @end // expected-note {{receiver is instance of class declared here}} @interface FooBaz : NSObject {} @property (nonatomic) BugsBunnyType matchType; @property (nonatomic, retain) NSArray *papyrus; @end diff --git a/clang/test/Modules/objc-categories.m b/clang/test/Modules/objc-categories.m index 07d1760980e8..f08b13a78ab2 100644 --- a/clang/test/Modules/objc-categories.m +++ b/clang/test/Modules/objc-categories.m @@ -10,7 +10,7 @@ // expected-note@Inputs/category_left.h:14 {{previous definition}} // expected-warning@Inputs/category_right.h:11 {{duplicate definition of category}} -// expected-note@Inputs/category_top.h:1 {{receiver is object of the class that is declared here}} +// expected-note@Inputs/category_top.h:1 {{receiver is instance of class declared here}} @interface Foo(Source) -(void)source; diff --git a/clang/test/PCH/chain-categories2.m b/clang/test/PCH/chain-categories2.m index 8cb06a857cde..50eea2a5606f 100644 --- a/clang/test/PCH/chain-categories2.m +++ b/clang/test/PCH/chain-categories2.m @@ -45,7 +45,7 @@ #else //===----------------------------------------------------------------------===// -// expected-note@30 {{receiver is object of the class that is declared here}} +// expected-note@30 {{receiver is instance of class declared here}} void f(I* i) { [i meth]; // expected-warning {{not found}} } diff --git a/clang/test/SemaObjC/call-super-2.m b/clang/test/SemaObjC/call-super-2.m index 18a5f09407ee..25cfbdd0879b 100644 --- a/clang/test/SemaObjC/call-super-2.m +++ b/clang/test/SemaObjC/call-super-2.m @@ -14,7 +14,7 @@ id objc_getClass(const char *s); - (int) instance_func0; @end -@interface Derived: Object // expected-note {{receiver is object of the class that is declared here}} +@interface Derived: Object // expected-note {{receiver is instance of class declared here}} + (int) class_func1; + (int) class_func2; + (int) class_func3; diff --git a/clang/test/SemaObjC/compare-qualified-id.m b/clang/test/SemaObjC/compare-qualified-id.m index 0b7e106b3518..02fa86ec8d9e 100644 --- a/clang/test/SemaObjC/compare-qualified-id.m +++ b/clang/test/SemaObjC/compare-qualified-id.m @@ -12,7 +12,7 @@ typedef struct _NSZone NSZone; typedef struct {} NSFastEnumerationState; @protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; @end @interface NSDictionary : NSObject - (NSUInteger)count; @end -@interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey; @end // expected-note {{receiver is object of the class that is declared here}} +@interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey; @end // expected-note {{receiver is instance of class declared here}} extern NSString * const NSTaskDidTerminateNotification; @interface XCPropertyExpansionContext : NSObject { // expected-note {{required for direct or indirect protocol 'NSCopying'}} diff --git a/clang/test/SemaObjC/conditional-expr.m b/clang/test/SemaObjC/conditional-expr.m index 083453810cf1..049a095ce37c 100644 --- a/clang/test/SemaObjC/conditional-expr.m +++ b/clang/test/SemaObjC/conditional-expr.m @@ -34,7 +34,7 @@ // No @interface declaration for DTFilterOutputStream3 @implementation DTFilterOutputStream3 // expected-warning {{cannot find interface declaration for 'DTFilterOutputStream3'}} \ - // expected-note {{receiver is object of the class that is declared here}} + // expected-note {{receiver is instance of class declared here}} - (id)initWithNextOutputStream:(id ) outputStream { id nextOutputStream = [self nextOutputStream]; // expected-warning {{method '-nextOutputStream' not found (return type defaults to 'id')}} self = nextOutputStream; // expected-warning {{assigning to 'DTFilterOutputStream3 *' from incompatible type 'id'}} diff --git a/clang/test/SemaObjC/error-outof-scope-property-use.m b/clang/test/SemaObjC/error-outof-scope-property-use.m index 023687bbf4d2..8ab9f5574556 100644 --- a/clang/test/SemaObjC/error-outof-scope-property-use.m +++ b/clang/test/SemaObjC/error-outof-scope-property-use.m @@ -2,7 +2,7 @@ // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s // rdar://13178483 -@class NSMutableDictionary; // expected-note {{receiver is object of the class that is declared here}} +@class NSMutableDictionary; // expected-note {{receiver is instance of class declared here}} @interface LaunchdJobs diff --git a/clang/test/SemaObjC/instancetype.m b/clang/test/SemaObjC/instancetype.m index 237489027151..7811d3eba583 100644 --- a/clang/test/SemaObjC/instancetype.m +++ b/clang/test/SemaObjC/instancetype.m @@ -25,7 +25,7 @@ - (instancetype)otherMethodInProto2; // expected-note{{overridden method returns an instance of its class type}} @end -@interface Subclass1 : Root // expected-note 4 {{receiver is object of the class that is declared here}} +@interface Subclass1 : Root // expected-note 4 {{receiver is instance of class declared here}} - (instancetype)initSubclass1; - (void)methodOnSubclass1; + (instancetype)allocSubclass1; diff --git a/clang/test/SemaObjC/message.m b/clang/test/SemaObjC/message.m index fc75cdbf6e20..2c4d8066f604 100644 --- a/clang/test/SemaObjC/message.m +++ b/clang/test/SemaObjC/message.m @@ -107,7 +107,7 @@ void foo5(id p) { // expected-warning {{instance method '-bar' not found}} } -@interface I1 // expected-note {{receiver is object of the class that is declared here}} +@interface I1 // expected-note {{receiver is instance of class declared here}} -(void)unavail_meth __attribute__((unavailable)); // expected-note {{marked unavailable here}} @end diff --git a/clang/test/SemaObjC/method-not-defined.m b/clang/test/SemaObjC/method-not-defined.m index 8f43c5daa7eb..792469b719c6 100644 --- a/clang/test/SemaObjC/method-not-defined.m +++ b/clang/test/SemaObjC/method-not-defined.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -@interface Foo // expected-note {{receiver is object of the class that is declared here}} +@interface Foo // expected-note {{receiver is instance of class declared here}} @end void test() { diff --git a/clang/test/SemaObjC/missing-atend-metadata.m b/clang/test/SemaObjC/missing-atend-metadata.m index 9d0024ac6554..f235ab94d821 100644 --- a/clang/test/SemaObjC/missing-atend-metadata.m +++ b/clang/test/SemaObjC/missing-atend-metadata.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s -@interface I0 // expected-note {{receiver is object of the class that is declared here}} +@interface I0 // expected-note {{receiver is instance of class declared here}} @end @implementation I0 // expected-note {{implementation started here}} diff --git a/clang/test/SemaObjC/property-5.m b/clang/test/SemaObjC/property-5.m index 782f77cfeaa8..cf4f87392b6a 100644 --- a/clang/test/SemaObjC/property-5.m +++ b/clang/test/SemaObjC/property-5.m @@ -8,7 +8,7 @@ @interface MutableNSData : NSData @end -@interface Base : NSData // expected-note {{receiver is object of the class that is declared here}} +@interface Base : NSData // expected-note {{receiver is instance of class declared here}} @property(readonly) id ref; @property(readonly) Base *p_base; @property(readonly) NSData *nsdata; diff --git a/clang/test/SemaObjC/protocol-id-test-1.m b/clang/test/SemaObjC/protocol-id-test-1.m index 013f291ad92b..36e23ed9f29d 100644 --- a/clang/test/SemaObjC/protocol-id-test-1.m +++ b/clang/test/SemaObjC/protocol-id-test-1.m @@ -7,7 +7,7 @@ @protocol P @end -@interface INTF

// expected-note {{receiver is object of the class that is declared here}} +@interface INTF

// expected-note {{receiver is instance of class declared here}} - (void)IMeth; @end diff --git a/clang/test/SemaObjCXX/instancetype.mm b/clang/test/SemaObjCXX/instancetype.mm index 87663b971681..89ff2b4b0326 100644 --- a/clang/test/SemaObjCXX/instancetype.mm +++ b/clang/test/SemaObjCXX/instancetype.mm @@ -25,7 +25,7 @@ - (instancetype)otherMethodInProto2; // expected-note{{overridden method returns an instance of its class type}} @end -@interface Subclass1 : Root // expected-note 4 {{receiver is object of the class that is declared here}} +@interface Subclass1 : Root // expected-note 4 {{receiver is instance of class declared here}} - (instancetype)initSubclass1; - (void)methodOnSubclass1; + (instancetype)allocSubclass1;