From: Douglas Gregor Date: Fri, 25 Sep 2009 06:56:31 +0000 (+0000) Subject: Be careful about copying uninstantiated default arguments during template instantiation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f43d0b37c1d3f529d0f206e786ae6de61c5f364a;p=clang 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 --- 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