]> granicus.if.org Git - clang/commitdiff
Objective-C [qoi]. When reporting that a property is not
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 10 Oct 2014 22:08:23 +0000 (22:08 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 10 Oct 2014 22:08:23 +0000 (22:08 +0000)
auto synthesized because it is synthesized in its super
class. locate property declaration in super class
which will default synthesize the property. rdar://18488727

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219535 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/attr-deprecated.m
test/SemaObjC/default-synthesize-1.m
test/SemaObjC/default-synthesize-3.m
test/SemaObjC/protocols-suppress-conformance.m
test/SemaObjC/super-property-notation.m

index cf9010f7fe0b13bf4d52e4d9f3fdc6d4fa357eba..48aa18cd3070b79553b7856b20371a4fb7ea70b8 100644 (file)
@@ -1584,6 +1584,7 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl,
       else {
         Diag(Prop->getLocation(), diag::warn_autosynthesis_property_in_superclass)
         << Prop->getIdentifier();
+        Diag(PropInSuperClass->getLocation(), diag::note_property_declare);
         Diag(IMPDecl->getLocation(), diag::note_while_in_implementation);
       }
       continue;
index 3e9157d0961fa3717610601f6818e61019cabe57..4eb56ee7d746d7ee1dd322386e12a2f9d0bee8ba 100644 (file)
@@ -197,7 +197,8 @@ __attribute__((deprecated))
 @interface TestBase
 @property (nonatomic, strong) id object __attribute__((deprecated("deprecated"))); // expected-note {{'object' has been explicitly marked deprecated here}} \
 expected-note {{property 'object' is declared deprecated here}} \
-expected-note {{'setObject:' has been explicitly marked deprecated here}}
+expected-note {{'setObject:' has been explicitly marked deprecated here}} \
+expected-note {{property declared here}}
 @end
 
 @interface TestDerived : TestBase
index 2a34a65a957e86292adfde7948d9e8fcdb877513..731aa863e103a9b0a7e83734f076f19b05b35c34 100644 (file)
 
 // rdar://17774815
 @interface ZXParsedResult
-@property (nonatomic, copy, readonly) NSString *description;
+@property (nonatomic, copy, readonly) NSString *description; // expected-note {{property declared here}}
 @end
 
 @interface ZXCalendarParsedResult : ZXParsedResult
index 879335e26beb49e19d9b1b1f2b7b73d7975356e3..dce9edabb90d3709db10be4770f9c22df1122b68 100644 (file)
@@ -44,7 +44,7 @@ __attribute ((objc_requires_property_definitions)) // expected-error {{'objc_req
 @interface NSObject @end
 @protocol Foo
 @property (readonly) char isFoo; // expected-note {{property declared here}}
-@property (readonly) char isNotFree;
+@property (readonly) char isNotFree;  // expected-note {{property declared here}}
 @end
 
 @interface Bar : NSObject <Foo>
@@ -90,9 +90,9 @@ __attribute ((objc_requires_property_definitions)) // expected-error {{'objc_req
 @end
 
 @interface B
-@property (readonly) id prop;
-@property (readonly) id prop1;
-@property (readonly) id prop2;
+@property (readonly) id prop;  // expected-note {{property declared here}}
+@property (readonly) id prop1;  // expected-note {{property declared here}}
+@property (readonly) id prop2;  // expected-note {{property declared here}}
 @end
 
 @interface B()
index 8415154ab1d894c15141372ea45f0c95e7d1ac89..a6604b7ff9582f12e08619e9b26a80fa5fe506b1 100644 (file)
@@ -13,7 +13,7 @@ __attribute__((objc_protocol_requires_explicit_implementation))
 // be adopted later by a subclass.
 @interface ClassA <Protocol>
 - (void) theBestOfTimes;
-@property (readonly) id theWorstOfTimes;
+@property (readonly) id theWorstOfTimes; // expected-note {{property declared here}}
 @end
 
 // This class subclasses ClassA (which also adopts 'Protocol').
index 62ff93cb2b052287c3198f7b097e275b4e20737e..2b13a5c0f87c248a437a4e123e5ae8ab73c344aa 100644 (file)
@@ -30,7 +30,7 @@ void f0() {
 
 // rdar://13349296
 __attribute__((objc_root_class)) @interface ClassBase 
-@property (nonatomic, retain) ClassBase * foo;
+@property (nonatomic, retain) ClassBase * foo; // expected-note {{property declared here}}
 @end
 
 @implementation ClassBase