mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-28 15:58:57 -04:00

destination type for initialization, assignment, parameter-passing, etc. The main issue fixed here is that we used rather confusing wording for diagnostics such as t.c:2:9: warning: initializing 'char const [2]' discards qualifiers, expected 'char *' [-pedantic] char *name = __func__; ^ ~~~~~~~~ We're not initializing a 'char const [2]', we're initializing a 'char *' with an expression of type 'char const [2]'. Similar problems existed for other diagnostics in this area, so I've normalized them all with more precise descriptive text to say what we're initializing/converting/assigning/etc. from and to. The warning for the code above is now: t.c:2:9: warning: initializing 'char *' from an expression of type 'char const [2]' discards qualifiers [-pedantic] char *name = __func__; ^ ~~~~~~~~ Fixes <rdar://problem/7447179>. llvm-svn: 100832
56 lines
939 B
Objective-C
56 lines
939 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<NSObject> *' from a function with result type 'UIWebPDFView *'}}
|
|
}
|