[cfe-commits] r65751 - in /cfe/trunk: lib/CodeGen/CGBlocks.cpp test/CodeGenObjC/blocks-unsupported.m

Anders Carlsson andersca at mac.com
Sun Mar 1 10:55:16 PST 2009


1 mar 2009 kl. 10.35 skrev Mike Stump:

> On Feb 28, 2009, at 5:45 PM, Anders Carlsson wrote:
>> +void t1()
>> +{
>> +	__block int a;
>> +	^{ a = 10; }(); // expected-error {{cannot compile this block  
>> expression with __block variables yet}}
>
> I believe this check is too expansive, in particular this works as  
> expected.

__block variables don't work. For example

void f()
{
   __block int a = 10;

   ^{
     a = 20;
   }();

   printf("a is: %d\n", a);
}

does not work as expected.

Anders




More information about the cfe-commits mailing list