r209672 - Objective-C. Fixes an obscuer crash caused by multiple inclusion of
Fariborz Jahanian
fjahanian at apple.com
Tue May 27 11:26:09 PDT 2014
Author: fjahanian
Date: Tue May 27 13:26:09 2014
New Revision: 209672
URL: http://llvm.org/viewvc/llvm-project?rev=209672&view=rev
Log:
Objective-C. Fixes an obscuer crash caused by multiple inclusion of
same framework after complaining about duplicate class definition.
// rdar://17024681
Modified:
cfe/trunk/lib/Sema/SemaObjCProperty.cpp
cfe/trunk/test/SemaObjC/arc-invalid.m
Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=209672&r1=209671&r2=209672&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Tue May 27 13:26:09 2014
@@ -1907,6 +1907,9 @@ void Sema::ProcessPropertyDecl(ObjCPrope
ObjCMethodDecl *GetterMethod, *SetterMethod;
+ if (CD->isInvalidDecl())
+ return;
+
GetterMethod = CD->getInstanceMethod(property->getGetterName());
SetterMethod = CD->getInstanceMethod(property->getSetterName());
DiagnosePropertyAccessorMismatch(property, GetterMethod,
Modified: cfe/trunk/test/SemaObjC/arc-invalid.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-invalid.m?rev=209672&r1=209671&r2=209672&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-invalid.m (original)
+++ cfe/trunk/test/SemaObjC/arc-invalid.m Tue May 27 13:26:09 2014
@@ -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
+ at class WebFrame;
+ at interface WebView // expected-note {{previous definition is here}}
+- (WebFrame *)mainFrame;
+ at end
+
+ at interface WebView // expected-error {{duplicate interface definition for class 'WebView'}}
+ at property (nonatomic, readonly, strong) WebFrame *mainFrame;
+ at end
+
+ at interface UIWebDocumentView
+- (WebView *)webView;
+ at end
+
+ at interface UIWebBrowserView : UIWebDocumentView
+ at end
+
+ at interface StoreBanner @end
+
+ at implementation StoreBanner
++ (void)readMetaTagContentForUIWebBrowserView:(UIWebBrowserView *)browserView
+{
+ [[browserView webView] mainFrame];
+}
+ at end
More information about the cfe-commits
mailing list