[cfe-commits] r82761 - /cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Douglas Gregor dgregor at apple.com
Fri Sep 25 00:03:23 PDT 2009


Author: dgregor
Date: Fri Sep 25 02:03:22 2009
New Revision: 82761

URL: http://llvm.org/viewvc/llvm-project?rev=82761&view=rev
Log:
Sigh. Be *really* careful when copying a default function argument during template instantiation

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Fri Sep 25 02:03:22 2009
@@ -711,7 +711,9 @@
   // Mark the default argument as being uninstantiated.
   if (D->hasUninstantiatedDefaultArg())
     Param->setUninstantiatedDefaultArg(D->getUninstantiatedDefaultArg());
-
+  else if (Expr *Arg = D->getDefaultArg())
+    Param->setUninstantiatedDefaultArg(Arg);
+  
   // Note: we don't try to instantiate function parameters until after
   // we've instantiated the function's type. Therefore, we don't have
   // to check for 'void' parameter types here.





More information about the cfe-commits mailing list