diff options
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaObjC/arc.m | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 83b01f24a21..84ac897b376 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -1620,7 +1620,7 @@ Sema::CheckObjCARCConversion(SourceRange castRange, QualType castType, ARCConversionTypeClass exprACTC = classifyTypeForARCConversion(castExprType); ARCConversionTypeClass castACTC = classifyTypeForARCConversion(castType); if (exprACTC == castACTC) return; - if (exprACTC && castType->isBooleanType()) return; + if (exprACTC && castType->isIntegralType(Context)) return; // Allow casts between pointers to lifetime types (e.g., __strong id*) // and pointers to void (e.g., cv void *). Casting from void* to lifetime* diff --git a/clang/test/SemaObjC/arc.m b/clang/test/SemaObjC/arc.m index d867b7332e5..e1e6b07456e 100644 --- a/clang/test/SemaObjC/arc.m +++ b/clang/test/SemaObjC/arc.m @@ -563,3 +563,12 @@ id Test32(__weak ITest32 *x) { : (*x).ivar; // expected-error {{dereferencing a __weak pointer is not allowed}} } +// rdar://9619861 +extern int printf(const char*, ...); +typedef long intptr_t; + +int Test33(id someid) { + printf( "Hello%ld", (intptr_t)someid); + return (int)someid; +} + |