brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · ba0f9e6 Raw
27 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -Wstrict-prototypes -verify -fblocks %s2 3@interface Foo4 5@property (nonatomic, copy) void (^noProtoBlock)(); // expected-warning {{a block declaration without a prototype is deprecated}}6@property (nonatomic, copy) void (^block)(void); // no warning7 8- doStuff:(void (^)()) completionHandler; // expected-warning {{a block declaration without a prototype is deprecated}}9- doOtherStuff:(void (^)(void)) completionHandler; // no warning10 11@end12 13void foo() { // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}14  void (^block)() = // expected-warning {{a block declaration without a prototype is deprecated}}15                    ^void(int arg) { // no warning16  };17  void (^block2)(void) = ^void() {18  };19  void (^block3)(void) = ^ { // no warning20  };21}22 23void (*(^(*(^block4)()) // expected-warning {{a block declaration without a prototype is deprecated}}24     ()) // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}25     ()) // expected-warning {{a block declaration without a prototype is deprecated}}26     (); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}27