forked from OSchip/llvm-project
I take it back, InstantiateExpr does not check for null.
llvm-svn: 71887
This commit is contained in:
parent
1f911dce22
commit
2cf4387931
clang/lib/Sema
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue