[cfe-commits] r102011 - in /cfe/trunk: lib/Sema/SemaObjCProperty.cpp test/SemaObjC/default-synthesize.m

Fariborz Jahanian fjahanian at apple.com
Wed Apr 21 11:57:20 PDT 2010


Author: fjahanian
Date: Wed Apr 21 13:57:20 2010
New Revision: 102011

URL: http://llvm.org/viewvc/llvm-project?rev=102011&view=rev
Log:
Improve on source location of diagnostic when default
property synthesis is using a super class ivar.


Modified:
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/test/SemaObjC/default-synthesize.m

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=102011&r1=102010&r2=102011&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Wed Apr 21 13:57:20 2010
@@ -812,7 +812,7 @@
       continue;
     if (LangOpts.ObjCNonFragileABI2) {
       ActOnPropertyImplDecl(IMPDecl->getLocation(),
-                            SourceLocation(),
+                            IMPDecl->getLocation(),
                             true, DeclPtrTy::make(IMPDecl),
                             Prop->getIdentifier(),
                             Prop->getIdentifier());

Modified: cfe/trunk/test/SemaObjC/default-synthesize.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/default-synthesize.m?rev=102011&r1=102010&r2=102011&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/default-synthesize.m (original)
+++ cfe/trunk/test/SemaObjC/default-synthesize.m Wed Apr 21 13:57:20 2010
@@ -79,3 +79,17 @@
 }
 @end
 
+ at protocol TopProtocol
+  @property (readonly) id myString;
+ at end
+
+ at interface TopClass <TopProtocol> 
+{
+  id myString; // expected-note {{previously declared 'myString' here}}
+}
+ at end
+
+ at interface SubClass : TopClass <TopProtocol> 
+ at end
+
+ at implementation SubClass @end // expected-error {{property 'myString' attempting to use ivar 'myString' declared in super class 'TopClass'}}





More information about the cfe-commits mailing list