Added safety check in unexposed template argument parser

This commit is contained in:
Bartek Kryza
2022-03-17 20:57:07 +01:00
parent 9bbeec7ff1
commit 8e2d6a2931

View File

@@ -522,6 +522,10 @@ void translation_unit_visitor::
c.add_relationship({std::get<1>(r), std::get<0>(r)});
}
if (!tspec.has_value() ||
tspec.value().primary_template().get(ctx.entity_index()).size() == 0)
return;
const auto &primary_template_ref =
static_cast<const cppast::cpp_class_template &>(
tspec.value().primary_template().get(ctx.entity_index())[0].get())