diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-04 23:58:03 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-04 23:58:03 +0000 |
commit | 9e7dbd1cc6582ba72bb5a042996eee8dfcf8bff5 (patch) | |
tree | e602e2c9cb90c3cf420c4401533966e71da185b9 /clang/lib | |
parent | cd1c0236fe46c507c533bc81e1e66336b2dbaa64 (diff) | |
download | bcm5719-llvm-9e7dbd1cc6582ba72bb5a042996eee8dfcf8bff5.tar.gz bcm5719-llvm-9e7dbd1cc6582ba72bb5a042996eee8dfcf8bff5.zip |
objc rewriter: Fixes a rewriting of implicit casting of an integral
argument to bool. // rdar://9899834
llvm-svn: 136946
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Rewrite/RewriteObjC.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Rewrite/RewriteObjC.cpp b/clang/lib/Rewrite/RewriteObjC.cpp index 63e2084686f..3ba7e90dac9 100644 --- a/clang/lib/Rewrite/RewriteObjC.cpp +++ b/clang/lib/Rewrite/RewriteObjC.cpp @@ -3008,7 +3008,11 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp, type = Context->getObjCIdType(); // Make sure we convert "type (^)(...)" to "type (*)(...)". (void)convertBlockPointerToFunctionPointer(type); - userExpr = NoTypeInfoCStyleCastExpr(Context, type, CK_BitCast, + const Expr *SubExpr = ICE->IgnoreParenImpCasts(); + bool integral = SubExpr->getType()->isIntegralType(*Context); + userExpr = NoTypeInfoCStyleCastExpr(Context, type, + (integral && type->isBooleanType()) + ? CK_IntegralToBoolean : CK_BitCast, userExpr); } // Make id<P...> cast into an 'id' cast. |