diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 0564cbefa637..fc51684f9e74 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/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