]> granicus.if.org Git - clang/commitdiff
Improve on source location of diagnostic when default
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 21 Apr 2010 18:57:20 +0000 (18:57 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 21 Apr 2010 18:57:20 +0000 (18:57 +0000)
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

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/default-synthesize.m

index d47d6c2994fb3b1a7b9545aa77848f690897941c..1d27e44dbe749889e054a411eb566687c953330a 100644 (file)
@@ -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());
index 45a3710dcf5b51b7fdeb542154d9f85f82ee721d..b892dfadf4f8636b11e0281228e93293b6827d42 100644 (file)
 }
 @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'}}