Fixed handling of relationships to nested structs

This commit is contained in:
Bartek Kryza
2024-06-18 22:00:50 +02:00
parent fa94022c58
commit 9a43ebe739
4 changed files with 16 additions and 7 deletions

View File

@@ -1433,13 +1433,13 @@ bool translation_unit_visitor::find_relationships(const clang::QualType &type,
}
}
else if (type->getAsCXXRecordDecl() != nullptr) {
const auto target_id = common::to_id(*type->getAsCXXRecordDecl());
relationships.emplace_back(target_id, relationship_hint);
relationships.emplace_back(
type->getAsCXXRecordDecl()->getID(), relationship_hint);
result = true;
}
else {
const auto target_id = common::to_id(*type->getAsRecordDecl());
relationships.emplace_back(target_id, relationship_hint);
relationships.emplace_back(
type->getAsRecordDecl()->getID(), relationship_hint);
result = true;
}
}