arc migrator: twik previous patch to exclude user provided

explicit type cast. // rdar://10521744

llvm-svn: 149437
This commit is contained in:
Fariborz Jahanian
2012-01-31 22:09:44 +00:00
parent eedecf51bb
commit a1c1b152f0
2 changed files with 2 additions and 4 deletions

View File

@@ -136,7 +136,7 @@ private:
FD->getParent()->isTranslationUnit() &&
FD->getLinkage() == ExternalLinkage) {
Expr *Arg = callE->getArg(0);
if (const CastExpr *ICE = dyn_cast<CastExpr>(Arg)) {
if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg)) {
const Expr *sub = ICE->getSubExpr();
QualType T = sub->getType();
if (T->isObjCObjectPointerType())

View File

@@ -33,9 +33,7 @@ CFTypeRef CFRetain(CFTypeRef cf);
// expected-note {{use __bridge to convert directly (no change in ownership)}} \
// expected-note {{use __bridge_transfer to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
result = (id) CFRetain((CFTypeRef)((objc_format))); // expected-error {{cast of C pointer type 'CFTypeRef' (aka 'const void *') to Objective-C pointer type 'id' requires a bridged cast}} \
// expected-note {{use __bridge to convert directly (no change in ownership)}} \
// expected-note {{use __bridge_transfer to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
result = (id) CFRetain((CFTypeRef)((objc_format)));
result = (id) CFRetain(cf_format); // OK
}