aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/super-class-2.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/obj-c++.dg/super-class-2.mm')
-rw-r--r--gcc-4.9/gcc/testsuite/obj-c++.dg/super-class-2.mm35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/obj-c++.dg/super-class-2.mm b/gcc-4.9/gcc/testsuite/obj-c++.dg/super-class-2.mm
new file mode 100644
index 000000000..efc72b819
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/obj-c++.dg/super-class-2.mm
@@ -0,0 +1,35 @@
+/* Bail out gracefully if attempting to derive from a class that has only been
+ forward-declared (via @class). Conversely, @compatibility_alias declarations
+ should be traversed to find the @interface. */
+
+/* { dg-do compile } */
+
+#include "../objc-obj-c++-shared/TestsuiteObject.h"
+
+@class MyWpModule;
+
+@compatibility_alias MyObject TestsuiteObject;
+@compatibility_alias FictitiousModule MyWpModule;
+
+@protocol MySelTarget
+- (id) meth1;
+@end
+
+@protocol Img
+- (id) meth2;
+@end
+
+@interface FunnyModule: FictitiousModule <Img> /* { dg-error ".MyWpModule., superclass of .FunnyModule." } */
+- (id) meth2;
+@end
+
+@interface MyProjWpModule : MyWpModule <MySelTarget, Img> /* { dg-error ".MyWpModule., superclass of .MyProjWpModule." } */ {
+ id i1, i2;
+}
+- (id) meth1;
+- (id) meth2;
+@end
+
+@interface AnotherModule: MyObject <MySelTarget>
+- (id) meth1;
+@end