]> granicus.if.org Git - clang/commitdiff
Be careful about copying uninstantiated default arguments during template instantiation
authorDouglas Gregor <dgregor@apple.com>
Fri, 25 Sep 2009 06:56:31 +0000 (06:56 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 25 Sep 2009 06:56:31 +0000 (06:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82760 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateInstantiateDecl.cpp

index 0564cbefa63775e87f7c05024fdef33a4cb3eb34..fc51684f9e74ba766ae800fca10bd478df1e8f69 100644 (file)
@@ -709,8 +709,8 @@ ParmVarDecl *TemplateDeclInstantiator::VisitParmVarDecl(ParmVarDecl *D) {
                                         D->getStorageClass(), 0);
 
   // Mark the default argument as being uninstantiated.
-  if (Expr *Arg = D->getDefaultArg())
-    Param->setUninstantiatedDefaultArg(Arg);
+  if (D->hasUninstantiatedDefaultArg())
+    Param->setUninstantiatedDefaultArg(D->getUninstantiatedDefaultArg());
 
   // Note: we don't try to instantiate function parameters until after
   // we've instantiated the function's type. Therefore, we don't have