[cfe-commits] r69980 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaObjC/sizeof-interface.m

Fariborz Jahanian fjahanian at apple.com
Fri Apr 24 11:53:37 PDT 2009


On Apr 24, 2009, at 11:35 AM, Eli Friedman wrote:

> On Fri, Apr 24, 2009 at 10:35 AM, Fariborz Jahanian <fjahanian at apple.com 
> > wrote:
>>   // Reject sizeof(interface) and sizeof(interface<proto>) in 64- 
>> bit mode.
>> -  if (exprType->isObjCInterfaceType() &&  
>> LangOpts.ObjCNonFragileABI) {
>> +  if (LangOpts.ObjCNonFragileABI && exprType- 
>> >isObjCInterfaceType()) {
>>     Diag(OpLoc, diag::err_sizeof_nonfragile_interface)
>>       << exprType << isSizeof;
>> -    return true;
>> +    return false;
>>   }
>
> This patch looks wrong; this should definitely be returning true.
> Otherwise, it looks like a valid declaration.

But we are issuing the diagnostic and then return true.

>
>
>> +    @public
>> +    unsigned long attributeRuns[1024 + sizeof(I)]; // expected- 
>> error {{invalid application of 'sizeof' to interface 'I' in non- 
>> fragile ABI}}
>
> Specifically, have you considered what happens when someone tries to
> compute sizeof(attributeRuns)?

Intention is to not issue additional errors.
We have already issued the diagnostic on the declaration. But, I  
understand, that
this may be contentious (project I was concerned with issued 100s of  
additional
diagnostics).

Chris?

- Fariborz

>
>
> -Eli




More information about the cfe-commits mailing list