r219535 - Objective-C [qoi]. When reporting that a property is not

Fariborz Jahanian fjahanian at apple.com
Fri Oct 10 15:08:24 PDT 2014


Author: fjahanian
Date: Fri Oct 10 17:08:23 2014
New Revision: 219535

URL: http://llvm.org/viewvc/llvm-project?rev=219535&view=rev
Log:
Objective-C [qoi]. When reporting that a property is not
auto synthesized because it is synthesized in its super
class. locate property declaration in super class
which will default synthesize the property. rdar://18488727

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

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=219535&r1=219534&r2=219535&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Fri Oct 10 17:08:23 2014
@@ -1584,6 +1584,7 @@ void Sema::DefaultSynthesizeProperties(S
       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;

Modified: cfe/trunk/test/SemaObjC/attr-deprecated.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/attr-deprecated.m?rev=219535&r1=219534&r2=219535&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/attr-deprecated.m (original)
+++ cfe/trunk/test/SemaObjC/attr-deprecated.m Fri Oct 10 17:08:23 2014
@@ -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

Modified: cfe/trunk/test/SemaObjC/default-synthesize-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/default-synthesize-1.m?rev=219535&r1=219534&r2=219535&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/default-synthesize-1.m (original)
+++ cfe/trunk/test/SemaObjC/default-synthesize-1.m Fri Oct 10 17:08:23 2014
@@ -127,7 +127,7 @@
 
 // rdar://17774815
 @interface ZXParsedResult
- at property (nonatomic, copy, readonly) NSString *description;
+ at property (nonatomic, copy, readonly) NSString *description; // expected-note {{property declared here}}
 @end
 
 @interface ZXCalendarParsedResult : ZXParsedResult

Modified: cfe/trunk/test/SemaObjC/default-synthesize-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/default-synthesize-3.m?rev=219535&r1=219534&r2=219535&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/default-synthesize-3.m (original)
+++ cfe/trunk/test/SemaObjC/default-synthesize-3.m Fri Oct 10 17:08:23 2014
@@ -44,7 +44,7 @@ __attribute ((objc_requires_property_def
 @interface NSObject @end
 @protocol Foo
 @property (readonly) char isFoo; // expected-note {{property declared here}}
- at property (readonly) char isNotFree;
+ at property (readonly) char isNotFree;  // expected-note {{property declared here}}
 @end
 
 @interface Bar : NSObject <Foo>
@@ -90,9 +90,9 @@ __attribute ((objc_requires_property_def
 @end
 
 @interface B
- at property (readonly) id prop;
- at property (readonly) id prop1;
- at property (readonly) id prop2;
+ at property (readonly) id prop;  // expected-note {{property declared here}}
+ at property (readonly) id prop1;  // expected-note {{property declared here}}
+ at property (readonly) id prop2;  // expected-note {{property declared here}}
 @end
 
 @interface B()

Modified: cfe/trunk/test/SemaObjC/protocols-suppress-conformance.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocols-suppress-conformance.m?rev=219535&r1=219534&r2=219535&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/protocols-suppress-conformance.m (original)
+++ cfe/trunk/test/SemaObjC/protocols-suppress-conformance.m Fri Oct 10 17:08:23 2014
@@ -13,7 +13,7 @@ __attribute__((objc_protocol_requires_ex
 // be adopted later by a subclass.
 @interface ClassA <Protocol>
 - (void) theBestOfTimes;
- at property (readonly) id theWorstOfTimes;
+ at property (readonly) id theWorstOfTimes; // expected-note {{property declared here}}
 @end
 
 // This class subclasses ClassA (which also adopts 'Protocol').

Modified: cfe/trunk/test/SemaObjC/super-property-notation.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/super-property-notation.m?rev=219535&r1=219534&r2=219535&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/super-property-notation.m (original)
+++ cfe/trunk/test/SemaObjC/super-property-notation.m Fri Oct 10 17:08:23 2014
@@ -30,7 +30,7 @@ void f0() {
 
 // rdar://13349296
 __attribute__((objc_root_class)) @interface ClassBase 
- at property (nonatomic, retain) ClassBase * foo;
+ at property (nonatomic, retain) ClassBase * foo; // expected-note {{property declared here}}
 @end
 
 @implementation ClassBase 





More information about the cfe-commits mailing list