diff --git a/components/to_utf8/to_utf8.cpp b/components/to_utf8/to_utf8.cpp index 15fb8b26c0..7e34147b1c 100644 --- a/components/to_utf8/to_utf8.cpp +++ b/components/to_utf8/to_utf8.cpp @@ -52,7 +52,7 @@ namespace return std::find_if(input.begin(), input.end(), [](unsigned char v) { return v == 0 || v >= 128; }); } - std::basic_string_view getTranslationArray(FromType sourceEncoding) + std::span getTranslationArray(FromType sourceEncoding) { switch (sourceEncoding) { diff --git a/components/to_utf8/to_utf8.hpp b/components/to_utf8/to_utf8.hpp index 80af6586c9..0dde0fced6 100644 --- a/components/to_utf8/to_utf8.hpp +++ b/components/to_utf8/to_utf8.hpp @@ -2,6 +2,7 @@ #define COMPONENTS_TOUTF8_H #include +#include #include #include #include @@ -50,7 +51,7 @@ namespace ToUTF8 inline void copyFromArrayLegacyEnc( std::string_view::iterator& chp, std::string_view::iterator end, char*& out) const; - const std::basic_string_view mTranslationArray; + const std::span mTranslationArray; }; class Utf8Encoder 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.