diff --git a/extern/sol3/README.md b/extern/sol3/README.md index 1674dcf599..202b2ca08b 100644 --- a/extern/sol3/README.md +++ b/extern/sol3/README.md @@ -1,3 +1,5 @@ The code in this directory is copied from https://github.com/ThePhD/sol2.git (64096348465b980e2f1d0e5ba9cbeea8782e8f27) +Additional changes include cherry-picking upstream commit d805d027e0a0a7222e936926139f06e23828ce9f to fix compilation under Clang 19. + License: MIT diff --git a/extern/sol3/sol/optional_implementation.hpp b/extern/sol3/sol/optional_implementation.hpp index b7673b17b1..a35df4ec87 100644 --- a/extern/sol3/sol/optional_implementation.hpp +++ b/extern/sol3/sol/optional_implementation.hpp @@ -2191,7 +2191,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.