1 // RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks
7 take(^(int x
, int y
){});
8 take(^(int x
, int y
){});
9 take(^(int x
, // expected-note {{previous declaration is here}}
10 int x
){}); // expected-error {{redefinition of parameter 'x'}}
13 take(^(int x
) { return x
+1; });
15 int (^CP
)(int) = ^(int x
) { return x
*x
; };
20 ^{return 2;}(arg
); // expected-error {{too many arguments to block call}}
21 ^(void){return 3;}(1); // expected-error {{too many arguments to block call}}
22 ^(){return 4;}(arg
); // expected-error {{too many arguments to block call}}
23 ^(int x
, ...){return 5;}(arg
, arg
); // Explicit varargs, ok.
26 int main(int argc
, char** argv
) {
34 ^(int, double d
, char) {}(1, 1.34, 'a'); // expected-warning {{omitting the parameter name in a function definition is a C2x extension}} \
35 // expected-warning {{omitting the parameter name in a function definition is a C2x extension}}
38 // rdar://problem/8962770
40 int (^f
)(void) = ^((x
)) { }; // expected-error {{type specifier missing}} expected-error {{type-id cannot have a name}}
43 // rdar://problem/9170609
44 void test5_helper(void (^)(int, int[*]));
46 test5_helper(^(int n
, int array
[n
]) {});
49 // Reduced from a problem on platforms where va_list is an array.
53 typedef struct tag array_ty
[1];
55 void (^block
)(array_ty
) = ^(array_ty arr
) { };