yaxunl added a comment.
In https://reviews.llvm.org/D29764#673548, @Nicola wrote:
> Looking at "Example 4" in the standard it looks like this should also be
> illegal.
>
> int (^block1)(void) = ^int {return 1;};
> int foo() { return block1(); }
>
> __kernel void k(global int *z)
> {
> int (^block2)(void) = ^int {
> return foo(); // expected-error {{cannot refer to a block inside block}}
> };
> }
>
>
>
> Unless I missed something it's not erroring in this case.
To diagnose this needs to traverse the AST tree. I think it is too much to do
it during parsing.
It may be done through static analysis though.
https://reviews.llvm.org/D29764
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits