Skip to content

Commit 2ca1850

Browse files
committed
Merge branch 'clang19' into 'master'
Clang 19 build fix (!4549 without sol update) See merge request OpenMW/openmw!4585
2 parents 9a35e3f + ced142d commit 2ca1850

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

components/to_utf8/to_utf8.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace
5252
return std::find_if(input.begin(), input.end(), [](unsigned char v) { return v == 0 || v >= 128; });
5353
}
5454

55-
std::basic_string_view<signed char> getTranslationArray(FromType sourceEncoding)
55+
std::span<const signed char> getTranslationArray(FromType sourceEncoding)
5656
{
5757
switch (sourceEncoding)
5858
{

components/to_utf8/to_utf8.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define COMPONENTS_TOUTF8_H
33

44
#include <cstring>
5+
#include <span>
56
#include <string>
67
#include <string_view>
78
#include <utility>
@@ -50,7 +51,7 @@ namespace ToUTF8
5051
inline void copyFromArrayLegacyEnc(
5152
std::string_view::iterator& chp, std::string_view::iterator end, char*& out) const;
5253

53-
const std::basic_string_view<signed char> mTranslationArray;
54+
const std::span<const signed char> mTranslationArray;
5455
};
5556

5657
class Utf8Encoder

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)