aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-04-21 18:57:20 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-04-21 18:57:20 +0000
commitd502a94461b81fd9f5d5c5df37ab3d7415bc72b1 (patch)
tree668816577840073e391687f8f8ddd66a0fd64846
parent9a68a67c6ae4982001815cc04f69b8781058263a (diff)
Improve on source location of diagnostic when default
property synthesis is using a super class ivar. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102011 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaObjCProperty.cpp2
-rw-r--r--test/SemaObjC/default-synthesize.m14
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index d47d6c2994..1d27e44dbe 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -812,7 +812,7 @@ void Sema::DiagnoseUnimplementedProperties(ObjCImplDecl* IMPDecl,
continue;
if (LangOpts.ObjCNonFragileABI2) {
ActOnPropertyImplDecl(IMPDecl->getLocation(),
- SourceLocation(),
+ IMPDecl->getLocation(),
true, DeclPtrTy::make(IMPDecl),
Prop->getIdentifier(),
Prop->getIdentifier());
diff --git a/test/SemaObjC/default-synthesize.m b/test/SemaObjC/default-synthesize.m
index 45a3710dcf..b892dfadf4 100644
--- a/test/SemaObjC/default-synthesize.m
+++ b/test/SemaObjC/default-synthesize.m
@@ -79,3 +79,17 @@
}
@end
+@protocol TopProtocol
+ @property (readonly) id myString;
+@end
+
+@interface TopClass <TopProtocol>
+{
+ id myString; // expected-note {{previously declared 'myString' here}}
+}
+@end
+
+@interface SubClass : TopClass <TopProtocol>
+@end
+
+@implementation SubClass @end // expected-error {{property 'myString' attempting to use ivar 'myString' declared in super class 'TopClass'}}