]> granicus.if.org Git - clang/commitdiff
Try to de-bork DISABLE_SMART_POINTERS build
authorDouglas Gregor <dgregor@apple.com>
Fri, 18 Dec 2009 17:31:58 +0000 (17:31 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 18 Dec 2009 17:31:58 +0000 (17:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91696 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaStmt.cpp

index e09243372eb2f03bc8b896b678772c4e28549ad4..c2a3a3a8ca629e0a61434345c7b660052cf7b8e3 100644 (file)
@@ -1126,17 +1126,17 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, ExprArg rex) {
 
     // In C++ the return statement is handled via a copy initialization.
     // the C version of which boils down to CheckSingleAssignmentConstraints.
-    rex = PerformCopyInitialization(
-                            InitializedEntity::InitializeResult(ReturnLoc, 
-                                                                FnRetTypeLoc),
-                            SourceLocation(),
-                            Owned(RetValExp));
-    if (rex.isInvalid()) {
+    OwningExprResult Res = PerformCopyInitialization(
+                             InitializedEntity::InitializeResult(ReturnLoc, 
+                                                                 FnRetTypeLoc),
+                             SourceLocation(),
+                             Owned(RetValExp));
+    if (Res.isInvalid()) {
       // FIXME: Cleanup temporaries here, anyway?
       return StmtError();
     }
 
-    RetValExp = rex.takeAs<Expr>();
+    RetValExp = Res.takeAs<Expr>();
     if (RetValExp) 
       CheckReturnStackAddr(RetValExp, FnRetType, ReturnLoc);
   }