]> granicus.if.org Git - clang/commitdiff
arc migrator: twik previous patch to exclude user provided
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 31 Jan 2012 22:09:44 +0000 (22:09 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 31 Jan 2012 22:09:44 +0000 (22:09 +0000)
explicit type cast. // rdar://10521744

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149437 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ARCMigrate/TransUnbridgedCasts.cpp
test/ARCMT/no-canceling-bridge-to-bridge-cast.m

index 5650824c964167fea0531d250157acfc36527a1b..42a92edd4ea0d0f824dedd9dc2d5cf6ad4c1cb1f 100644 (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())
index e94e6574aebce93d625057c5b88dab3c0478a821..164b84b8923e50e833b8540d7788da4afa7c79af 100644 (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
 }