git: 2456bb083ea3 - main - games/openmw: fix to sol's optional::emplace for clang++ 19 (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Wed, 06 Nov 2024 15:07:50 UTC
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2456bb083ea37de8960e747bd4a07a441e663ee4

commit 2456bb083ea37de8960e747bd4a07a441e663ee4
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2024-11-06 15:05:57 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2024-11-06 15:05:57 +0000

    games/openmw: fix to sol's optional::emplace for clang++ 19 (+)
    
    Obtained from:  https://github.com/ThePhD/sol2/pull/1606/
---
 .../files/patch-extern_sol3_sol_optional__implementation.hpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/games/openmw/files/patch-extern_sol3_sol_optional__implementation.hpp b/games/openmw/files/patch-extern_sol3_sol_optional__implementation.hpp
new file mode 100644
index 000000000000..ac31cf924f51
--- /dev/null
+++ b/games/openmw/files/patch-extern_sol3_sol_optional__implementation.hpp
@@ -0,0 +1,12 @@
+--- extern/sol3/sol/optional_implementation.hpp.orig	2023-08-08 09:23:20 UTC
++++ extern/sol3/sol/optional_implementation.hpp
+@@ -2191,7 +2191,8 @@ namespace sol {
+ 			static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
+ 
+ 			*this = nullopt;
+-			this->construct(std::forward<Args>(args)...);
++			new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...);
++			return **this;
+ 		}
+ 
+ 		/// Swaps this optional with the other.