Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/mrdocs/Metadata/Symbol/Using.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ tag_invoke(
v = dom::LazyObject(I, domCorpus);
}

inline
auto&
allMembers(UsingSymbol const& T)
{
return T.ShadowDeclarations;
}

static_assert(SymbolParent<UsingSymbol>);

} // mrdocs

#endif // MRDOCS_API_METADATA_SYMBOL_USING_HPP
7 changes: 7 additions & 0 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,13 @@ addMember(OverloadsSymbol& I, Symbol const& Member) const
I.Name);
}

void
ASTVisitor::
addMember(UsingSymbol& I, Symbol const& Member) const
{
addMember(I.ShadowDeclarations, Member);
}

void
ASTVisitor::
addMember(std::vector<SymbolID>& container, Symbol const& Member) const
Expand Down
3 changes: 3 additions & 0 deletions src/lib/AST/ASTVisitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,9 @@ class ASTVisitor
void
addMember(OverloadsSymbol& I, Symbol const& Member) const;

void
addMember(UsingSymbol& I, Symbol const& Member) const;

void
addMember(std::vector<SymbolID>& container, Symbol const& Member) const;

Expand Down
1 change: 1 addition & 0 deletions src/lib/Gen/hbs/MultiPageVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ operator()(T const& I)
// ===================================
// Traverse the symbol members
// ===================================
MRDOCS_CHECK_OR_VOID(!I.isUsing());
Corpus::TraverseOptions opts = {.skipInherited = std::same_as<T, RecordSymbol>};
corpus_.traverse(opts, I, *this);
});
Expand Down
1 change: 1 addition & 0 deletions src/lib/Gen/hbs/SinglePageVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ operator()(T const& I)
}
});
}
MRDOCS_CHECK_OR_VOID(!I.isUsing());
Corpus::TraverseOptions opts = {.skipInherited = std::same_as<T, RecordSymbol>};
corpus_.traverse(opts, I, *this);
}
Expand Down
22 changes: 20 additions & 2 deletions src/lib/Support/LegibleNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,26 @@ class LegibleNames::Impl
MRDOCS_ASSERT(corpus_.exists(id));

// Find the legible name information for this symbol
auto const it = map_.find(id);
MRDOCS_ASSERT(it != map_.end());
auto it = map_.find(id);
if (it == map_.end())
{
// Late-build a legible name for this symbol.
// NOTE: This may not perfectly disambiguate against siblings
// because the per-scope disambiguation_map_ is ephemeral,
// but it avoids a hard crash and produces a stable name.
Symbol const& I = corpus_.get(id);
auto const raw = getRawUnqualified(I);
buildLegibleMember(I, raw);
it = map_.find(I.id);
if (it == map_.end())
{
// Final, robust fallback: emit the raw SymbolID (legible-ish),
// and return without crashing.
result.append(toBase16(I.id));
return;
}
}

auto& [unqualified, n_disambig, id_str] = it->second;

// Append the unqualified name to the result
Expand Down
1 change: 1 addition & 0 deletions test-files/golden-tests/regression/1057.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
warn-if-undoc-enum-val: false
Loading