1 // RUN: %clang_cc1 -fblocks -fsyntax-only -verify %s
3 template <typename T
, typename T1
> void foo(T t
, T1 r
)
6 __block T1 byref_block_arg
;
8 T1 (^block
)(T
) = ^ T1 (T arg
) {
10 block_arg
= arg
; // expected-error {{variable is not assignable (missing __block type specifier)}}
11 return block_arg
+arg
; };
14 template <typename T
, typename T1
> void noret(T t
, T1 r
)
20 return r
; // expected-error {{return type 'double' must match previous return type 'float' when block literal has unspecified explicit return type}}
26 foo(100, 'a'); // expected-note {{in instantiation of function template specialization 'foo<int, char>' requested here}}
28 noret((float)0.0, double(0.0)); // expected-note {{in instantiation of function template specialization 'noret<float, double>' requested here}}
31 namespace rdar41200624
{
34 int (^p
)() = ^{ return 0; };
35 T (^t
)() = ^{ return T
{}; };
36 T s
= ^{ return T
{}; }();