diff options
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 19c0f2a9390..941672c6e39 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -602,7 +602,7 @@ Decl *Sema::ActOnTypeParameter(Scope *S, bool Typename, return Param; } - Param->setDefaultArgument(DefaultTInfo, false); + Param->setDefaultArgument(DefaultTInfo); } return Param; @@ -723,7 +723,7 @@ Decl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, } Default = DefaultRes.get(); - Param->setDefaultArgument(Default, false); + Param->setDefaultArgument(Default); } return Param; @@ -799,7 +799,7 @@ Decl *Sema::ActOnTemplateTemplateParameter(Scope* S, UPPC_DefaultArgument)) return Param; - Param->setDefaultArgument(DefaultArg, false); + Param->setDefaultArgument(Context, DefaultArg); } return Param; @@ -1328,8 +1328,7 @@ bool Sema::CheckTemplateParameterList(TemplateParameterList *NewParams, } else if (OldTypeParm && OldTypeParm->hasDefaultArgument()) { // Merge the default argument from the old declaration to the // new declaration. - NewTypeParm->setDefaultArgument(OldTypeParm->getDefaultArgumentInfo(), - true); + NewTypeParm->setInheritedDefaultArgument(Context, OldTypeParm); PreviousDefaultArgLoc = OldTypeParm->getDefaultArgumentLoc(); } else if (NewTypeParm->hasDefaultArgument()) { SawDefaultArgument = true; @@ -1375,12 +1374,7 @@ bool Sema::CheckTemplateParameterList(TemplateParameterList *NewParams, } else if (OldNonTypeParm && OldNonTypeParm->hasDefaultArgument()) { // Merge the default argument from the old declaration to the // new declaration. - // FIXME: We need to create a new kind of "default argument" - // expression that points to a previous non-type template - // parameter. - NewNonTypeParm->setDefaultArgument( - OldNonTypeParm->getDefaultArgument(), - /*Inherited=*/ true); + NewNonTypeParm->setInheritedDefaultArgument(Context, OldNonTypeParm); PreviousDefaultArgLoc = OldNonTypeParm->getDefaultArgumentLoc(); } else if (NewNonTypeParm->hasDefaultArgument()) { SawDefaultArgument = true; @@ -1424,11 +1418,7 @@ bool Sema::CheckTemplateParameterList(TemplateParameterList *NewParams, } else if (OldTemplateParm && OldTemplateParm->hasDefaultArgument()) { // Merge the default argument from the old declaration to the // new declaration. - // FIXME: We need to create a new kind of "default argument" expression - // that points to a previous template template parameter. - NewTemplateParm->setDefaultArgument( - OldTemplateParm->getDefaultArgument(), - /*Inherited=*/ true); + NewTemplateParm->setInheritedDefaultArgument(Context, OldTemplateParm); PreviousDefaultArgLoc = OldTemplateParm->getDefaultArgument().getLocation(); } else if (NewTemplateParm->hasDefaultArgument()) { |

