blob: 0874a476806ca6ce90c7c1bd29a5323835907161 [file] [log] [blame]
Shih-wei Liaoea285162010-06-04 12:34:56 -07001// RUN: %clang_cc1 -verify -fsyntax-only -fblocks %s
2
3@interface TestAttrMallocOnMethods {}
Stephen Hines0e2c34f2015-03-23 12:09:02 -07004- (id) test1 __attribute((malloc)); // expected-warning {{attribute only applies to functions}}
5- (int) test2 __attribute((malloc)); // expected-warning {{attribute only applies to functions}}
Shih-wei Liaoea285162010-06-04 12:34:56 -07006@end
7
8id bar(void) __attribute((malloc)); // no-warning
9
10typedef void (^bptr)(void);
11bptr baz(void) __attribute((malloc)); // no-warning
12
Stephen Hines0e2c34f2015-03-23 12:09:02 -070013__attribute((malloc)) id (*f)(); // expected-warning {{attribute only applies to functions}}
14__attribute((malloc)) bptr (*g)(); // expected-warning {{attribute only applies to functions}}
15__attribute((malloc)) void *(^h)(); // expected-warning {{attribute only applies to functions}}
Shih-wei Liaoea285162010-06-04 12:34:56 -070016