Skip to content

Commit 00b56e9

Browse files
authored
fix: destructors cannot have overload sets
1 parent becda0c commit 00b56e9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/lib/Metadata/Finalizers/OverloadsFinalizer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ foldOverloads(SymbolID const& contextId, std::vector<SymbolID>& functionIds, boo
105105
MRDOCS_CHECK_OR_CONTINUE(recordInfoPtr);
106106
auto* function = recordInfoPtr->asFunctionPtr();
107107
MRDOCS_CHECK_OR_CONTINUE(function);
108+
MRDOCS_CHECK_OR_CONTINUE(function->Class != FunctionClass::Destructor);
108109

109110
// Check if the FunctionInfo is unique
110111
std::ranges::subrange otherFunctionIds(

src/lib/Metadata/Info/Overloads.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ merge(OverloadsInfo& I, OverloadsInfo&& Other)
4444
void
4545
addMember(OverloadsInfo& I, FunctionInfo const& Member)
4646
{
47+
MRDOCS_ASSERT(Member.Class != FunctionClass::Destructor);
48+
4749
if (I.Members.empty())
4850
{
4951
I.Name = Member.Name;

0 commit comments

Comments
 (0)