mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 13:06:09 +00:00

The Objective-C common-type computation had a few problems that required a significant rework, including: - Quadradic behavior when finding the common base type; now it's linear. - Keeping around type arguments when computing the common type between a specialized and an unspecialized type - Introducing redundant protocol qualifiers. Part of rdar://problem/6294649. Also fixes rdar://problem/19572837 by addressing a longstanding bug in ASTContext::CollectInheritedProtocols(). llvm-svn: 241544
56 lines
929 B
Objective-C
56 lines
929 B
Objective-C
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
// radar 7638810
|
|
|
|
@protocol NSObject @end
|
|
|
|
@interface NSObject <NSObject> @end
|
|
|
|
@interface UIResponder : NSObject
|
|
@end
|
|
|
|
@implementation UIResponder
|
|
@end
|
|
|
|
@interface UIView : UIResponder
|
|
@end
|
|
|
|
@implementation UIView
|
|
@end
|
|
|
|
@interface UIWebTiledView : UIView
|
|
@end
|
|
|
|
@implementation UIWebTiledView
|
|
@end
|
|
|
|
@interface UIWebDocumentView : UIWebTiledView
|
|
@end
|
|
|
|
@implementation UIWebDocumentView
|
|
@end
|
|
|
|
@interface UIWebBrowserView : UIWebDocumentView
|
|
@end
|
|
|
|
@implementation UIWebBrowserView
|
|
@end
|
|
|
|
@interface UIPDFView : UIView
|
|
@end
|
|
|
|
@implementation UIPDFView
|
|
@end
|
|
|
|
@interface UIWebPDFView : UIPDFView
|
|
@end
|
|
|
|
@implementation UIWebPDFView
|
|
@end
|
|
|
|
UIWebPDFView *getView()
|
|
{
|
|
UIWebBrowserView *browserView;
|
|
UIWebPDFView *pdfView;
|
|
return pdfView ? pdfView : browserView; // expected-warning {{incompatible pointer types returning 'UIView *' from a function with result type 'UIWebPDFView *'}}
|
|
}
|