[cfe-commits] r71889 - in /cfe/trunk/lib/Sema: SemaTemplateInstantiateExpr.cpp SemaTemplateInstantiateStmt.cpp

Douglas Gregor dgregor at apple.com
Fri May 15 13:47:12 PDT 2009


Author: dgregor
Date: Fri May 15 15:47:12 2009
New Revision: 71889

URL: http://llvm.org/viewvc/llvm-project?rev=71889&view=rev
Log:
Allow instantiation of NULL expressions and statements

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp
    cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp?rev=71889&r1=71888&r2=71889&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp Fri May 15 15:47:12 2009
@@ -432,6 +432,9 @@
 
 Sema::OwningExprResult 
 Sema::InstantiateExpr(Expr *E, const TemplateArgumentList &TemplateArgs) {
+  if (!E)
+    return Owned((Expr *)0);
+
   TemplateExprInstantiator Instantiator(*this, TemplateArgs);
   return Instantiator.Visit(E);
 }

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp?rev=71889&r1=71888&r2=71889&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateStmt.cpp Fri May 15 15:47:12 2009
@@ -166,6 +166,9 @@
 
 Sema::OwningStmtResult 
 Sema::InstantiateStmt(Stmt *S, const TemplateArgumentList &TemplateArgs) {
+  if (!S)
+    return Owned((Stmt *)0);
+
   TemplateStmtInstantiator Instantiator(*this, TemplateArgs);
   return Instantiator.Visit(S);
 }





More information about the cfe-commits mailing list