summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/protocol-warn.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-02-12 19:27:33 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-02-12 19:27:33 +0000
commitdc68f9539c38973cdeff0747205f6d22dbe6abc7 (patch)
treed6f5990ad262ca52f240bd9896b6c1843d6d041f /clang/test/SemaObjC/protocol-warn.m
parent363f847ec67cfa52912370d6b5c1cc74d5f9b1fe (diff)
downloadbcm5719-llvm-dc68f9539c38973cdeff0747205f6d22dbe6abc7.tar.gz
bcm5719-llvm-dc68f9539c38973cdeff0747205f6d22dbe6abc7.zip
Patch to fix a warning which exposed a bug in building
a qualified objective-c pointer type. Fixes radar 7638810. (Also removes a FIXME). llvm-svn: 96003
Diffstat (limited to 'clang/test/SemaObjC/protocol-warn.m')
-rw-r--r--clang/test/SemaObjC/protocol-warn.m55
1 files changed, 55 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/protocol-warn.m b/clang/test/SemaObjC/protocol-warn.m
new file mode 100644
index 00000000000..d0c51e3ffab
--- /dev/null
+++ b/clang/test/SemaObjC/protocol-warn.m
@@ -0,0 +1,55 @@
+// 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> *', expected 'UIWebPDFView *'}}
+}
OpenPOWER on IntegriCloud