diff options
-rw-r--r-- | lib/AST/ASTContext.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaType.cpp | 3 | ||||
-rw-r--r-- | test/SemaObjCXX/arc-type-conversion.mm | 1 |
3 files changed, 2 insertions, 4 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index aca011f9df..53fb7129fd 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3523,7 +3523,7 @@ Qualifiers::ObjCLifetime ASTContext::getInnerObjCOwnership(QualType T) const { else if (const PointerType *PT = T->getAs<PointerType>()) T = PT->getPointeeType(); else if (const ReferenceType *RT = T->getAs<ReferenceType>()) - RT->getPointeeType(); + T = RT->getPointeeType(); else break; } diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index cd4a5b50d8..3f211daeac 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -2546,7 +2546,6 @@ static void transferARCOwnershipToDeclSpec(Sema &S, qs.addObjCLifetime(ownership); declSpecTy = S.Context.getQualifiedType(declSpecTy, qs); } - return; } static void transferARCOwnershipToDeclaratorChunk(TypeProcessingState &state, @@ -2570,8 +2569,6 @@ static void transferARCOwnershipToDeclaratorChunk(TypeProcessingState &state, case Qualifiers::OCL_Weak: attrStr = "weak"; break; case Qualifiers::OCL_Autoreleasing: attrStr = "autoreleasing"; break; } - if (!attrStr) - return; // If there wasn't one, add one (with an invalid source location // so that we don't make an AttributedType for it). diff --git a/test/SemaObjCXX/arc-type-conversion.mm b/test/SemaObjCXX/arc-type-conversion.mm index 5e7d5cc859..baf4b82082 100644 --- a/test/SemaObjCXX/arc-type-conversion.mm +++ b/test/SemaObjCXX/arc-type-conversion.mm @@ -203,6 +203,7 @@ typedef void (^Block_autoreleasing)() __autoreleasing; void ownership_transfer_in_cast(void *vp, Block *pblk) { __strong NSString **sip2 = static_cast<NSString **>(static_cast<__strong id *>(vp)); + __strong NSString **&si2pref = static_cast<NSString **&>(sip2); __weak NSString **wip2 = static_cast<NSString **>(static_cast<__weak id *>(vp)); __autoreleasing id *aip2 = static_cast<id *>(static_cast<__autoreleasing id *>(vp)); __unsafe_unretained id *uip2 = static_cast<id *>(static_cast<__unsafe_unretained id *>(vp)); |