[cfe-commits] r71887 - /cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp
Anders Carlsson
andersca at mac.com
Fri May 15 13:29:28 PDT 2009
Author: andersca
Date: Fri May 15 15:29:28 2009
New Revision: 71887
URL: http://llvm.org/viewvc/llvm-project?rev=71887&view=rev
Log:
I take it back, InstantiateExpr does not check for null.
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp?rev=71887&r1=71886&r2=71887&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp Fri May 15 15:29:28 2009
@@ -98,10 +98,13 @@
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));
}
More information about the cfe-commits
mailing list