From 8e7c99b94fd9d4c68579142d3a71224801116a07 Mon Sep 17 00:00:00 2001 From: jarzec Date: Sat, 9 Nov 2024 00:58:05 +0100 Subject: [PATCH] Fix clang-18 compilation issue --- source/parse.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/source/parse.h b/source/parse.h index 657975f0a..16c2a5d53 100644 --- a/source/parse.h +++ b/source/parse.h @@ -1913,20 +1913,10 @@ struct compound_statement_node return open_brace; } - auto add_statement( + auto add_statement( std::unique_ptr&& statement, int before_pos - ) - -> bool - { - // Adopt this statement into our list of statements - statements.insert( - statements.begin() + std::clamp( before_pos, 0, unchecked_narrow(std::ssize(statements)) ), - std::move(statement) - ); - - return true; - } + ) -> bool; auto visit(auto& v, int depth) -> void; }; @@ -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, + int before_pos +) + -> bool +{ + // Adopt this statement into our list of statements + statements.insert( + statements.begin() + std::clamp( before_pos, 0, unchecked_narrow(std::ssize(statements)) ), + std::move(statement) + ); + + return true; +} auto compound_statement_node::visit(auto& v, int depth) -> void