From aa98e982ee6178271dd55951ccce7e4b8d137616 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 26 Oct 2024 09:32:42 -0500 Subject: [PATCH] Sol2 patch for clang 19 See #2306 --- dependencies/sol2/sol/sol.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dependencies/sol2/sol/sol.hpp b/dependencies/sol2/sol/sol.hpp index 6a257bf694..2e9f79eb55 100644 --- a/dependencies/sol2/sol/sol.hpp +++ b/dependencies/sol2/sol/sol.hpp @@ -6752,7 +6752,8 @@ namespace sol { static_assert(std::is_constructible::value, "T must be constructible with Args"); *this = nullopt; - this->construct(std::forward(args)...); + new (static_cast(this)) optional(std::in_place, std::forward(args)...); + return **this; } /// Swaps this optional with the other.