[lldb] Fix another instance where we pass a nullptr as TypeSourceInfo to NonTypeTemplateParmDecl::Create

Summary:
Follow up to an issue pointed out in the review of D73808. We shouldn't just pass in a nullptr TypeSourceInfo
in case Clang decided to access it.

Reviewers: shafik, vsk

Reviewed By: shafik, vsk

Subscribers: kristof.beyls, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D73946
This commit is contained in:
Raphael Isemann 2020-02-18 13:25:08 +01:00
parent db23825970
commit 40b2c7f29b
1 changed files with 5 additions and 3 deletions

View File

@ -1298,11 +1298,13 @@ static TemplateParameterList *CreateTemplateParameterList(
if (!template_param_infos.packed_args->args.empty() &&
IsValueParam(template_param_infos.packed_args->args[0])) {
QualType template_param_type =
template_param_infos.packed_args->args[0].getIntegralType();
template_param_decls.push_back(NonTypeTemplateParmDecl::Create(
ast, decl_context, SourceLocation(), SourceLocation(), depth,
num_template_params, identifier_info,
template_param_infos.packed_args->args[0].getIntegralType(),
parameter_pack_true, nullptr));
num_template_params, identifier_info, template_param_type,
parameter_pack_true,
ast.getTrivialTypeSourceInfo(template_param_type)));
} else {
template_param_decls.push_back(TemplateTypeParmDecl::Create(
ast, decl_context, SourceLocation(), SourceLocation(), depth,