Add semantic parent to forward declarable entities

This commit is contained in:
Jonathan Müller 2017-04-14 16:44:25 +02:00
commit 599f2bbff8
20 changed files with 260 additions and 109 deletions

View file

@ -75,9 +75,12 @@ std::unique_ptr<cpp_entity> detail::parse_cpp_friend(const detail::parse_context
else if (clang_isDeclaration(kind))
{
entity = parse_entity(context, child);
// steal comment
comment = type_safe::copy(entity->comment()).value_or("");
entity->set_comment(type_safe::nullopt);
if (entity)
{
// steal comment
comment = type_safe::copy(entity->comment()).value_or("");
entity->set_comment(type_safe::nullopt);
}
}
else if (inst_builder && clang_isExpression(kind))
{