[cfe-commits] r148320 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaObjC/continuation-class-property.m

Fariborz Jahanian fjahanian at apple.com
Tue Jan 17 10:52:07 PST 2012


Author: fjahanian
Date: Tue Jan 17 12:52:07 2012
New Revision: 148320

URL: http://llvm.org/viewvc/llvm-project?rev=148320&view=rev
Log:
objc: fixes a bug where struct used inside an
objc class was not being exported to parent decl
context resulting in bogus mismatch warning later on.
// rdar://10655530

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/SemaObjC/continuation-class-property.m

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=148320&r1=148319&r2=148320&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Jan 17 12:52:07 2012
@@ -7872,7 +7872,8 @@
       // Find the context where we'll be declaring the tag.
       // FIXME: We would like to maintain the current DeclContext as the
       // lexical context,
-      while (SearchDC->isRecord() || SearchDC->isTransparentContext())
+      while (SearchDC->isRecord() || SearchDC->isTransparentContext() ||
+             SearchDC->isObjCContainer())
         SearchDC = SearchDC->getParent();
 
       // Find the scope where we'll be declaring the tag.

Modified: cfe/trunk/test/SemaObjC/continuation-class-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/continuation-class-property.m?rev=148320&r1=148319&r2=148320&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/continuation-class-property.m (original)
+++ cfe/trunk/test/SemaObjC/continuation-class-property.m Tue Jan 17 12:52:07 2012
@@ -41,3 +41,23 @@
 @property (readwrite) NSString *foo; // expected-error {{type of property 'NSString *' in continuation class does not match property type in primary class}}
 @property (readwrite, strong) NSRect bar; // expected-error {{type of property 'NSRect' in continuation class does not match property type in primary class}}
 @end
+
+// rdar://10655530
+struct S;
+struct S1;
+ at interface STAdKitContext
+ at property (nonatomic, readonly, assign) struct evhttp_request *httpRequest;
+ at property (nonatomic, readonly, assign) struct S *httpRequest2;
+ at property (nonatomic, readonly, assign) struct S1 *httpRequest3;
+ at property (nonatomic, readonly, assign) struct S2 *httpRequest4;
+ at end
+
+struct evhttp_request;
+struct S1;
+
+ at interface STAdKitContext()
+ at property (nonatomic, readwrite, assign) struct evhttp_request *httpRequest;
+ at property (nonatomic, readwrite, assign) struct S *httpRequest2;
+ at property (nonatomic, readwrite, assign) struct S1 *httpRequest3;
+ at property (nonatomic, readwrite, assign) struct S2 *httpRequest4;
+ at end





More information about the cfe-commits mailing list