From f43d0b37c1d3f529d0f206e786ae6de61c5f364a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 25 Sep 2009 06:56:31 +0000 Subject: [PATCH] Be careful about copying uninstantiated default arguments during template instantiation git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82760 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplateInstantiateDecl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 0564cbefa6..fc51684f9e 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -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 -- 2.50.1