Skip to content

Commit ced142d

Browse files
committed
Lift upstream sol::optional::emplace Clang 19 build fix
1 parent e5ad1cd commit ced142d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

extern/sol3/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
The code in this directory is copied from https://github.com/ThePhD/sol2.git (64096348465b980e2f1d0e5ba9cbeea8782e8f27)
22

3+
Additional changes include cherry-picking upstream commit d805d027e0a0a7222e936926139f06e23828ce9f to fix compilation under Clang 19.
4+
35
License: MIT

extern/sol3/sol/optional_implementation.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,8 @@ namespace sol {
21912191
static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
21922192

21932193
*this = nullopt;
2194-
this->construct(std::forward<Args>(args)...);
2194+
new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...);
2195+
return **this;
21952196
}
21962197

21972198
/// Swaps this optional with the other.

0 commit comments

Comments
 (0)