2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fsyntax-only -fblocks %s
|
2009-08-15 04:49:40 +08:00
|
|
|
|
|
|
|
@interface TestAttrMallocOnMethods {}
|
2009-08-15 08:51:46 +08:00
|
|
|
- (id) test1 __attribute((malloc)); // expected-warning {{functions returning a pointer type}}
|
|
|
|
- (int) test2 __attribute((malloc)); // expected-warning {{functions returning a pointer type}}
|
2009-08-15 04:49:40 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
id bar(void) __attribute((malloc)); // no-warning
|
|
|
|
|
|
|
|
typedef void (^bptr)(void);
|
|
|
|
bptr baz(void) __attribute((malloc)); // no-warning
|
|
|
|
|
2009-08-15 08:51:46 +08:00
|
|
|
__attribute((malloc)) id (*f)(); // expected-warning {{functions returning a pointer type}}
|
|
|
|
__attribute((malloc)) bptr (*g)(); // expected-warning {{functions returning a pointer type}}
|
|
|
|
__attribute((malloc)) void *(^h)(); // expected-warning {{functions returning a pointer type}}
|
2009-08-15 06:06:01 +08:00
|
|
|
|