Objective-C. Fixes an obscuer crash caused by multiple inclusion of

same framework after complaining about duplicate class definition.
// rdar://17024681


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209672 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Fariborz Jahanian 2014-05-27 18:26:09 +00:00
parent 08d469b693
commit 0aba93f193
2 changed files with 30 additions and 1 deletions

View File

@ -1907,6 +1907,9 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property,
ObjCMethodDecl *GetterMethod, *SetterMethod;
if (CD->isInvalidDecl())
return;
GetterMethod = CD->getInstanceMethod(property->getGetterName());
SetterMethod = CD->getInstanceMethod(property->getSetterName());
DiagnosePropertyAccessorMismatch(property, GetterMethod,

View File

@ -1,4 +1,4 @@
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fblocks -verify %s
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fblocks -Wno-objc-root-class -verify %s
// rdar://problem/10982793
// [p foo] in ARC creates a cleanup.
@ -16,3 +16,29 @@ void test1(void) {
__autoreleasing id p; // expected-note {{'p' declared here}}
takeBlock(^{ (void) p; }); // expected-error {{cannot capture __autoreleasing variable in a block}}
}
// rdar://17024681
@class WebFrame;
@interface WebView // expected-note {{previous definition is here}}
- (WebFrame *)mainFrame;
@end
@interface WebView // expected-error {{duplicate interface definition for class 'WebView'}}
@property (nonatomic, readonly, strong) WebFrame *mainFrame;
@end
@interface UIWebDocumentView
- (WebView *)webView;
@end
@interface UIWebBrowserView : UIWebDocumentView
@end
@interface StoreBanner @end
@implementation StoreBanner
+ (void)readMetaTagContentForUIWebBrowserView:(UIWebBrowserView *)browserView
{
[[browserView webView] mainFrame];
}
@end