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

llvm-svn: 219535
This commit is contained in:
Fariborz Jahanian 2014-10-10 22:08:23 +00:00
parent 8a584bb3d7
commit c985a7f6df
6 changed files with 10 additions and 8 deletions

View File

@ -1584,6 +1584,7 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl,
else { else {
Diag(Prop->getLocation(), diag::warn_autosynthesis_property_in_superclass) Diag(Prop->getLocation(), diag::warn_autosynthesis_property_in_superclass)
<< Prop->getIdentifier(); << Prop->getIdentifier();
Diag(PropInSuperClass->getLocation(), diag::note_property_declare);
Diag(IMPDecl->getLocation(), diag::note_while_in_implementation); Diag(IMPDecl->getLocation(), diag::note_while_in_implementation);
} }
continue; continue;

View File

@ -197,7 +197,8 @@ __attribute__((deprecated))
@interface TestBase @interface TestBase
@property (nonatomic, strong) id object __attribute__((deprecated("deprecated"))); // expected-note {{'object' has been explicitly marked deprecated here}} \ @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 {{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 @end
@interface TestDerived : TestBase @interface TestDerived : TestBase

View File

@ -127,7 +127,7 @@
// rdar://17774815 // rdar://17774815
@interface ZXParsedResult @interface ZXParsedResult
@property (nonatomic, copy, readonly) NSString *description; @property (nonatomic, copy, readonly) NSString *description; // expected-note {{property declared here}}
@end @end
@interface ZXCalendarParsedResult : ZXParsedResult @interface ZXCalendarParsedResult : ZXParsedResult

View File

@ -44,7 +44,7 @@ __attribute ((objc_requires_property_definitions)) // expected-error {{'objc_req
@interface NSObject @end @interface NSObject @end
@protocol Foo @protocol Foo
@property (readonly) char isFoo; // expected-note {{property declared here}} @property (readonly) char isFoo; // expected-note {{property declared here}}
@property (readonly) char isNotFree; @property (readonly) char isNotFree; // expected-note {{property declared here}}
@end @end
@interface Bar : NSObject <Foo> @interface Bar : NSObject <Foo>
@ -90,9 +90,9 @@ __attribute ((objc_requires_property_definitions)) // expected-error {{'objc_req
@end @end
@interface B @interface B
@property (readonly) id prop; @property (readonly) id prop; // expected-note {{property declared here}}
@property (readonly) id prop1; @property (readonly) id prop1; // expected-note {{property declared here}}
@property (readonly) id prop2; @property (readonly) id prop2; // expected-note {{property declared here}}
@end @end
@interface B() @interface B()

View File

@ -13,7 +13,7 @@ __attribute__((objc_protocol_requires_explicit_implementation))
// be adopted later by a subclass. // be adopted later by a subclass.
@interface ClassA <Protocol> @interface ClassA <Protocol>
- (void) theBestOfTimes; - (void) theBestOfTimes;
@property (readonly) id theWorstOfTimes; @property (readonly) id theWorstOfTimes; // expected-note {{property declared here}}
@end @end
// This class subclasses ClassA (which also adopts 'Protocol'). // This class subclasses ClassA (which also adopts 'Protocol').

View File

@ -30,7 +30,7 @@ void f0() {
// rdar://13349296 // rdar://13349296
__attribute__((objc_root_class)) @interface ClassBase __attribute__((objc_root_class)) @interface ClassBase
@property (nonatomic, retain) ClassBase * foo; @property (nonatomic, retain) ClassBase * foo; // expected-note {{property declared here}}
@end @end
@implementation ClassBase @implementation ClassBase