2009-09-03 08:43:07 +08:00
|
|
|
// RUN: clang-cc -fsyntax-only -verify %s
|
2009-01-18 05:57:49 +08:00
|
|
|
|
|
|
|
@interface foo
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation foo
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface bar
|
2009-04-12 03:08:56 +08:00
|
|
|
-(void) my_method:(foo) my_param; // expected-error {{Objective-C interface type 'foo' cannot be passed by value}}
|
|
|
|
- (foo)cccccc:(long)ddddd; // expected-error {{Objective-C interface type 'foo' cannot be returned by value}}
|
2009-01-18 05:57:49 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation bar
|
2009-04-12 03:08:56 +08:00
|
|
|
-(void) my_method:(foo) my_param // expected-error {{Objective-C interface type 'foo' cannot be passed by value}}
|
2009-02-21 06:59:16 +08:00
|
|
|
{
|
|
|
|
}
|
2009-04-12 03:08:56 +08:00
|
|
|
- (foo)cccccc:(long)ddddd // expected-error {{Objective-C interface type 'foo' cannot be returned by value}}
|
2009-01-18 05:57:49 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2009-04-12 03:08:56 +08:00
|
|
|
void somefunc(foo x) {} // expected-error {{Objective-C interface type 'foo' cannot be passed by value}}
|
2009-04-12 03:17:25 +08:00
|
|
|
foo somefunc2() {} // expected-error {{Objective-C interface type 'foo' cannot be returned by value}}
|
2009-04-12 16:11:20 +08:00
|
|
|
|
|
|
|
// rdar://6780761
|
|
|
|
void f0(foo *a0) {
|
|
|
|
extern void g0(int x, ...);
|
|
|
|
g0(1, *(foo*)0); // expected-error {{cannot pass object with interface type 'foo' by-value through variadic function}}
|
|
|
|
}
|