diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2026,6 +2026,7 @@ CompilerType clang_type; uint64_t uval64 = 0; bool uval64_valid = false; + bool is_default_template_arg = false; if (num_attributes > 0) { DWARFFormValue form_value; for (size_t i = 0; i < num_attributes; ++i) { @@ -2056,6 +2057,11 @@ uval64 = form_value.Unsigned(); } break; + case DW_AT_default_value: + if (attributes.ExtractFormValueAtIndex(i, form_value)) { + is_default_template_arg = form_value.Boolean(); + } + break; default: break; } @@ -2078,19 +2084,21 @@ if (!size) return false; llvm::APInt apint(*size, uval64, is_signed); - template_param_infos.InsertArg( - name, + auto TA = clang::TemplateArgument(ast, llvm::APSInt(apint, !is_signed), - ClangUtil::GetQualType(clang_type))); + ClangUtil::GetQualType(clang_type)); + TA.setIsDefaulted(is_default_template_arg); + template_param_infos.InsertArg(name, std::move(TA)); } else { - template_param_infos.InsertArg( - name, - clang::TemplateArgument(ClangUtil::GetQualType(clang_type))); + auto TA = clang::TemplateArgument(ClangUtil::GetQualType(clang_type)); + TA.setIsDefaulted(is_default_template_arg); + template_param_infos.InsertArg(name, std::move(TA)); } } else { auto *tplt_type = m_ast.CreateTemplateTemplateParmDecl(template_name); - template_param_infos.InsertArg( - name, clang::TemplateArgument(clang::TemplateName(tplt_type))); + auto TA = clang::TemplateArgument(clang::TemplateName(tplt_type)); + TA.setIsDefaulted(is_default_template_arg); + template_param_infos.InsertArg(name, std::move(TA)); } } }