]> granicus.if.org Git - clang/commitdiff
objc: fixes a bug where struct used inside an
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 17 Jan 2012 18:52:07 +0000 (18:52 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 17 Jan 2012 18:52:07 +0000 (18:52 +0000)
objc class was not being exported to parent decl
context resulting in bogus mismatch warning later on.
// rdar://10655530

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148320 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/SemaObjC/continuation-class-property.m

index 6196ea3f6cb46698d43a77dec0c605708866d8df..0e99f7047686e49748c734177e50b34af13cb77b 100644 (file)
@@ -7872,7 +7872,8 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
       // 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.
index d017ac23dced2f29f8ada347ac056fe26ef67c68..7d95424a06c840ea029a523d3b097f29aaaa1f22 100644 (file)
@@ -41,3 +41,23 @@ typedef struct {
 @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;
+@interface STAdKitContext
+@property (nonatomic, readonly, assign) struct evhttp_request *httpRequest;
+@property (nonatomic, readonly, assign) struct S *httpRequest2;
+@property (nonatomic, readonly, assign) struct S1 *httpRequest3;
+@property (nonatomic, readonly, assign) struct S2 *httpRequest4;
+@end
+
+struct evhttp_request;
+struct S1;
+
+@interface STAdKitContext()
+@property (nonatomic, readwrite, assign) struct evhttp_request *httpRequest;
+@property (nonatomic, readwrite, assign) struct S *httpRequest2;
+@property (nonatomic, readwrite, assign) struct S1 *httpRequest3;
+@property (nonatomic, readwrite, assign) struct S2 *httpRequest4;
+@end