Applying bugprone-narrowing-conversions clang-tidy fixes

This commit is contained in:
Bartek Kryza
2022-12-21 18:05:45 +01:00
parent 5d8f31dbe6
commit 14128374ef
5 changed files with 13 additions and 7 deletions

View File

@@ -194,10 +194,14 @@ void generator::generate(const class_ &c, std::ostream &ostr) const
std::string destination;
try {
destination = r.destination();
auto target_element = m_model.get(r.destination());
if (!target_element.has_value())
throw error::uml_alias_missing{
fmt::format("Missing element in the model for ID: {}",
r.destination())};
destination = target_element.value().full_name(false);
// TODO: Refactor destination to a namespace qualified entity
// name
if (util::starts_with(destination, std::string{"::"}))
destination = destination.substr(2, destination.size());