From: Fariborz Jahanian Date: Wed, 21 Apr 2010 18:57:20 +0000 (+0000) Subject: Improve on source location of diagnostic when default X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d502a94461b81fd9f5d5c5df37ab3d7415bc72b1;p=clang 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 --- 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 +{ + id myString; // expected-note {{previously declared 'myString' here}} +} +@end + +@interface SubClass : TopClass +@end + +@implementation SubClass @end // expected-error {{property 'myString' attempting to use ivar 'myString' declared in super class 'TopClass'}}