blob: 6cd6be00a8cf1bd0a32fa141367ae02a0e5e7738 [file] [log] [blame]
Ted Kremeneka18d7d82009-08-14 20:49:40 +00001// RUN: clang-cc -verify -fsyntax-only -fblocks %s
2
Ted Kremeneka18d7d82009-08-14 20:49:40 +00003@interface TestAttrMallocOnMethods {}
Ted Kremenek2cff7d12009-08-15 00:51:46 +00004- (id) test1 __attribute((malloc)); // expected-warning {{functions returning a pointer type}}
5- (int) test2 __attribute((malloc)); // expected-warning {{functions returning a pointer type}}
Ted Kremeneka18d7d82009-08-14 20:49:40 +00006@end
7
8id bar(void) __attribute((malloc)); // no-warning
9
10typedef void (^bptr)(void);
11bptr baz(void) __attribute((malloc)); // no-warning
12
Ted Kremenek2cff7d12009-08-15 00:51:46 +000013__attribute((malloc)) id (*f)(); // expected-warning {{functions returning a pointer type}}
14__attribute((malloc)) bptr (*g)(); // expected-warning {{functions returning a pointer type}}
15__attribute((malloc)) void *(^h)(); // expected-warning {{functions returning a pointer type}}
Ted Kremenek2733b662009-08-14 22:06:01 +000016