]> granicus.if.org Git - clang/commitdiff
No need to null check the expr, Sema::SemaRef.InstantiateExpr handles all that.
authorAnders Carlsson <andersca@mac.com>
Fri, 15 May 2009 20:10:48 +0000 (20:10 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 15 May 2009 20:10:48 +0000 (20:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71885 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateInstantiateStmt.cpp

index 957402ac6f666e3e60e7bec2a5084d1550ad6f83..8bdb42b58f6767ea78c62f598a40670b645a914b 100644 (file)
@@ -98,13 +98,10 @@ Sema::OwningStmtResult TemplateStmtInstantiator::VisitGotoStmt(GotoStmt *S) {
 
 Sema::OwningStmtResult
 TemplateStmtInstantiator::VisitReturnStmt(ReturnStmt *S) {
-  Sema::OwningExprResult Result = SemaRef.ExprEmpty();
-  if (Expr *E = S->getRetValue()) {
-    Result = SemaRef.InstantiateExpr(E, TemplateArgs);
-    
-    if (Result.isInvalid())
-      return SemaRef.StmtError();
-  }
+  Sema::OwningExprResult Result = 
+        SemaRef.InstantiateExpr(S->getRetValue(), TemplateArgs);
+  if (Result.isInvalid())
+    return SemaRef.StmtError();
   
   return SemaRef.ActOnReturnStmt(S->getReturnLoc(), move(Result));
 }