From 055c968ab56de2db0391baba18a8918a91df52b1 Mon Sep 17 00:00:00 2001 From: jarzec Date: Fri, 31 Jan 2025 02:06:16 +0100 Subject: [PATCH] Fix clang-18 compilation issue (#1335) --- 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