[PATCH] D29764: [OpenCL] Blocks cannot capture/reference another block

Nicola Zaghen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 10 08:15:54 PST 2017


Nicola added a comment.

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.


https://reviews.llvm.org/D29764





More information about the cfe-commits mailing list