]> granicus.if.org Git - clang/commitdiff
Be sure to try a final ARC-production even in Objective-C++.
authorJohn McCall <rjmccall@apple.com>
Thu, 16 Jun 2011 23:24:51 +0000 (23:24 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 16 Jun 2011 23:24:51 +0000 (23:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133215 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp
lib/Sema/SemaStmt.cpp
test/CodeGenObjCXX/arc.mm

index 77932151c1c06d2fd7c15101653a3ab3422212b1..5bdadc6166b11560719caf4e9b3cc539a8202287 100644 (file)
@@ -3544,6 +3544,8 @@ InitializationSequence::InitializationSequence(Sema &S,
       SetFailed(InitializationSequence::FK_ConversionFailed);
   } else {
     AddConversionSequenceStep(ICS, Entity.getType());
+
+    MaybeProduceObjCObject(S, *this, Entity);
   }
 }
 
index 18e5f7e3a46c143096e69a1c5345bc12e8146a2e..a5ad0a5a2b32207e387e3004d95bb12786840e99 100644 (file)
@@ -1787,7 +1787,7 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
       // overlap restriction of subclause 6.5.16.1 does not apply to the case of
       // function return.
 
-      // In C++ the return statement is handled via a copy initialization.
+      // In C++ the return statement is handled via a copy initialization,
       // the C version of which boils down to CheckSingleAssignmentConstraints.
       NRVOCandidate = getCopyElisionCandidate(FnRetType, RetValExp, false);
       InitializedEntity Entity = InitializedEntity::InitializeResult(ReturnLoc,
index 5d46a818cff78f2b58c6e13e6fded89239780f18..43098553aaabb211fa13bf487307f293d649dced 100644 (file)
@@ -150,3 +150,13 @@ void test35b(Test35_Helper x0, Test35_Helper *x0p) {
   // CHECK: call void @objc_release
   // CHECK-NEXT: ret void
 }
+
+// rdar://problem/9603128
+// CHECK: define i8* @_Z6test36P11objc_object(
+id test36(id z) {
+  // CHECK: objc_retain
+  // CHECK: objc_retain
+  // CHECK: objc_release
+  // CHECK: objc_autoreleaseReturnValue
+  return z;
+}