Fixed handling of template template default arguments

This commit is contained in:
Bartek Kryza
2023-04-14 21:05:48 +02:00
parent c91fe43c1c
commit 0d524b38a4
3 changed files with 23 additions and 3 deletions

View File

@@ -1006,11 +1006,11 @@ bool translation_unit_visitor::process_template_parameters(
clang::dyn_cast_or_null<clang::TemplateTemplateParmDecl>(
parameter);
std::optional<std::string> default_arg;
if (template_template_parameter->hasDefaultArgument())
if (template_template_parameter->hasDefaultArgument()) {
default_arg = common::to_string(
template_template_parameter->getDefaultArgument()
.getArgument()
.getAsExpr());
.getArgument());
}
auto ct = template_parameter::make_template_template_type(
template_template_parameter->getNameAsString(), default_arg,
template_template_parameter->isParameterPack());