I take it back, InstantiateExpr does not check for null.

llvm-svn: 71887
This commit is contained in:
Anders Carlsson 2009-05-15 20:29:28 +00:00
parent 1f911dce22
commit 2cf4387931
1 changed files with 7 additions and 4 deletions

View File

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