aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/objc.dg/param-1.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/objc.dg/param-1.m')
-rw-r--r--gcc-4.9/gcc/testsuite/objc.dg/param-1.m20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/objc.dg/param-1.m b/gcc-4.9/gcc/testsuite/objc.dg/param-1.m
new file mode 100644
index 000000000..e796a3b51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/objc.dg/param-1.m
@@ -0,0 +1,20 @@
+/* Test if compiler detects object as an parameter to a method
+ or not. It is not valid. */
+/* { dg-do compile } */
+
+@interface foo
+@end
+
+@implementation foo
+@end
+
+@interface bar
+-(void) my_method:(foo) my_param; /* { dg-error "can not use an object as parameter to a method" } */
+@end
+
+@implementation bar
+-(void) my_method:(foo) my_param /* { dg-error "can not use an object as parameter to a method" } */
+{
+}
+@end
+