| 1 |
/* Test if compiler detects object as an parameter to a method |
| 2 |
or not. It is not valid. */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-additional-options "-Wno-objc-root-class" } */ |
| 5 |
|
| 6 |
@interface foo |
| 7 |
@end |
| 8 |
|
| 9 |
@implementation foo |
| 10 |
@end |
| 11 |
|
| 12 |
@interface bar |
| 13 |
-(void) my_method:(foo) my_param; /* { dg-error "cannot use an object as parameter to a method" } */ |
| 14 |
@end |
| 15 |
|
| 16 |
@implementation bar |
| 17 |
-(void) my_method:(foo) my_param /* { dg-error "cannot use an object as parameter to a method" } */ |
| 18 |
{ |
| 19 |
} |
| 20 |
@end |
| 21 |
|