[cfe-commits] r143219 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExprObjC.cpp test/SemaObjC/arc-objc-lifetime.m test/SemaObjC/arc-unavailable-for-weakref.m test/SemaObjCXX/arc-unavailable-for-weakref.mm

jahanian fjahanian at apple.com
Fri Oct 28 15:38:54 PDT 2011


On Oct 28, 2011, at 2:33 PM, John McCall wrote:

> 
> On Oct 28, 2011, at 1:06 PM, Fariborz Jahanian wrote:
> 
> 
>> +    if ((castACTC == ACTC_retainable) && 
>> +        isa<AttributedType>(castType) &&
>> +        (castType.getObjCLifetime() !=  Qualifiers::OCL_None) &&
>> +        (CCK == CCK_CStyleCast || CCK == CCK_OtherCast) &&
> 
> I don't think the CCK restriction is meaningful.

Need to check this. We will have:  CCK == CCK_ImplicitConversion
In this test case:

void f8(const __strong id&);
void test_f8() {
  __strong id strong_id;
  f8(strong_id);
}

> 
> I know it's kindof marginal, but please do look through ParenTypes
> and other AttributedTypes here.  Also, AttributedTypes are not
> necessarily only ownership attributes.  Also also, please add a
> comment explaining that you're intentionally looking at type sugar
> and that you don't want to look through certain kinds of sugar.
> 
> I don't know if it's currently possible to get a good test case for other
> AttributedTypes, but (__strong NSString(*)) is a good test case for

Here is a good test for this:

NSString * NSStringObj;
…
((__strong typeof(NSStringObj)) CFBridgingRelease());

- Fariborz


> ParenTypes.
> 
> John.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111028/4eaab63a/attachment.html>


More information about the cfe-commits mailing list