blob: f18388f4e64c2e602f50d89d179e840e3b1de2f0 [file] [log] [blame]
Ted Kremenek527042b2009-08-14 20:49:40 +00001// RUN: clang-cc -verify -fsyntax-only -fblocks %s
2
Ted Kremenek527042b2009-08-14 20:49:40 +00003@interface TestAttrMallocOnMethods {}
4- (id) test1 __attribute((malloc)); // expected-warning{{'malloc' attribute only applies to function types}}
5- (int) test2 __attribute((malloc)); // expected-warning{{'malloc' attribute only applies to function types}}
6@end
7
8id bar(void) __attribute((malloc)); // no-warning
9
10typedef void (^bptr)(void);
11bptr baz(void) __attribute((malloc)); // no-warning
12
Ted Kremenek8d091db2009-08-14 22:06:01 +000013__attribute((malloc)) id (*f)(); // no-warning
14__attribute((malloc)) bptr (*g)(); // no-warning
15