summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/comptypes-6.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/comptypes-6.m')
-rw-r--r--test/SemaObjC/comptypes-6.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaObjC/comptypes-6.m b/test/SemaObjC/comptypes-6.m
new file mode 100644
index 0000000..3217675
--- /dev/null
+++ b/test/SemaObjC/comptypes-6.m
@@ -0,0 +1,16 @@
+// RUN: clang-cc -fsyntax-only -verify -pedantic %s
+
+@interface Derived
+@end
+
+@interface Object @end
+
+extern Object* foo(void);
+
+static Derived *test(void)
+{
+ Derived *m = foo(); // expected-warning {{incompatible pointer types initializing 'Object *', expected 'Derived *'}}
+
+ return m;
+}
+
OpenPOWER on IntegriCloud