mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
arc migrator: twik previous patch to exclude user provided
explicit type cast. // rdar://10521744 llvm-svn: 149437
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user