[cfe-commits] r96968 - /cfe/trunk/test/SemaObjC/property-and-class-extension.m

Fariborz Jahanian fjahanian at apple.com
Tue Feb 23 10:50:01 PST 2010


Author: fjahanian
Date: Tue Feb 23 12:50:01 2010
New Revision: 96968

URL: http://llvm.org/viewvc/llvm-project?rev=96968&view=rev
Log:
A test case for property synthesis using ivar in class extensions.

Added:
    cfe/trunk/test/SemaObjC/property-and-class-extension.m

Added: cfe/trunk/test/SemaObjC/property-and-class-extension.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-and-class-extension.m?rev=96968&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/property-and-class-extension.m (added)
+++ cfe/trunk/test/SemaObjC/property-and-class-extension.m Tue Feb 23 12:50:01 2010
@@ -0,0 +1,36 @@
+// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi2 -verify %s
+
+/**
+When processing @synthesize, treat ivars in a class extension the same as ivars in the class @interface, 
+and treat ivars in a superclass extension the same as ivars in the superclass @interface.
+In particular, when searching for an ivar to back an @synthesize, do look at ivars in the class's own class 
+extension but ignore any ivars in superclass class extensions.
+*/
+
+ at interface Super {
+  	int ISA;
+}
+ at end
+
+ at interface Super() {
+  int Property;		// expected-note {{previously declared 'Property' here}}
+}
+ at end
+
+ at interface SomeClass : Super {
+        int interfaceIvar1;
+        int interfaceIvar2;
+}
+ at property int Property;
+ at property int Property1;
+ at end
+
+ at interface SomeClass () {
+  int Property1;
+}
+ at end
+
+ at implementation SomeClass 
+ at synthesize Property;	// expected-error {{property 'Property' attempting to use ivar 'Property' declared in super class 'Super'}}
+ at synthesize Property1;	// OK
+ at end





More information about the cfe-commits mailing list