[cfe-commits] r149437 - in /cfe/trunk: lib/ARCMigrate/TransUnbridgedCasts.cpp test/ARCMT/no-canceling-bridge-to-bridge-cast.m
Fariborz Jahanian
fjahanian at apple.com
Tue Jan 31 14:09:44 PST 2012
Author: fjahanian
Date: Tue Jan 31 16:09:44 2012
New Revision: 149437
URL: http://llvm.org/viewvc/llvm-project?rev=149437&view=rev
Log:
arc migrator: twik previous patch to exclude user provided
explicit type cast. // rdar://10521744
Modified:
cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp
cfe/trunk/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
Modified: cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp?rev=149437&r1=149436&r2=149437&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp Tue Jan 31 16:09:44 2012
@@ -136,7 +136,7 @@
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())
Modified: cfe/trunk/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/no-canceling-bridge-to-bridge-cast.m?rev=149437&r1=149436&r2=149437&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/no-canceling-bridge-to-bridge-cast.m (original)
+++ cfe/trunk/test/ARCMT/no-canceling-bridge-to-bridge-cast.m Tue Jan 31 16:09:44 2012
@@ -33,9 +33,7 @@
// 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
}
More information about the cfe-commits
mailing list