diff --git a/src/uml/class_diagram_visitor.cc b/src/uml/class_diagram_visitor.cc index 69d0ff12..151c56aa 100644 --- a/src/uml/class_diagram_visitor.cc +++ b/src/uml/class_diagram_visitor.cc @@ -1265,6 +1265,25 @@ class_ tu_visitor::build_template_instantiation( const cppast::cpp_template_instantiation_type &>( targ.type().value())); + auto fn = cx::util::full_name( + cppast::remove_cv( + cx::util::unreferenced(targ.type().value())), + ctx.entity_index, false); + fn = util::split(fn, "<")[0]; + + class_relationship tinst_dependency; + tinst_dependency.type = relationship_t::kDependency; + tinst_dependency.label = ""; + + tinst_dependency.destination = + nested_tinst.full_name(ctx.config.using_namespace); + + LOG_DBG("Creating nested template dependency {} -> {}", + tinst.full_name(ctx.config.using_namespace), + tinst_dependency.destination); + + tinst.add_relationship(std::move(tinst_dependency)); + ctx.d.add_class(std::move(nested_tinst)); } }