Skip to content

Commit

Permalink
Fix clang-18 compilation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jarzec committed Jan 5, 2025
1 parent bbee890 commit 9e1c305
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions source/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -1913,20 +1913,10 @@ struct compound_statement_node
return open_brace;
}

auto add_statement(
auto add_statement(
std::unique_ptr<statement_node>&& statement,
int before_pos
)
-> bool
{
// Adopt this statement into our list of statements
statements.insert(
statements.begin() + std::clamp( before_pos, 0, unchecked_narrow<int>(std::ssize(statements)) ),
std::move(statement)
);

return true;
}
) -> bool;

auto visit(auto& v, int depth) -> void;
};
Expand Down Expand Up @@ -2320,6 +2310,20 @@ auto alternative_node::visit(auto& v, int depth)
v.end(*this, depth);
}

auto compound_statement_node::add_statement(
std::unique_ptr<statement_node>&& statement,
int before_pos
)
-> bool
{
// Adopt this statement into our list of statements
statements.insert(
statements.begin() + std::clamp( before_pos, 0, unchecked_narrow<int>(std::ssize(statements)) ),
std::move(statement)
);

return true;
}

auto compound_statement_node::visit(auto& v, int depth)
-> void
Expand Down

0 comments on commit 9e1c305

Please sign in to comment.