brintos

brintos / llvm-project-archived public Read only

0
0
Text · 725 B · 8fe31e2 Raw
17 lines · plain
1// RUN: %clang_cc1 -verify -fsyntax-only -fblocks %s2 3@interface TestAttrMallocOnMethods {}4- (id) test1 __attribute((malloc)); //  expected-warning {{attribute only applies to functions}}5- (int) test2 __attribute((malloc)); //  expected-warning {{attribute only applies to functions}}6@end7 8id bar(void) __attribute((malloc)); // no-warning9 10typedef void (^bptr)(void);11bptr baz(void) __attribute((malloc)); // no-warning12 13__attribute((malloc)) id (*f)(void); //  expected-warning {{attribute only applies to functions}}14__attribute((malloc)) bptr (*g)(void); //  expected-warning {{attribute only applies to functions}}15__attribute((malloc)) void *(^h)(void); //  expected-warning {{attribute only applies to functions}}16 17