mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Disable use of consteval in String::from_utf8_short_string for Apple
This causes an ICE on older versions of clang, and Apple's clang is currently based on such a version.
This commit is contained in:
parent
95d1678553
commit
c8e25a71e0
Notes:
sideshowbarker
2024-07-17 03:30:41 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/c8e25a71e0 Pull-request: https://github.com/SerenityOS/serenity/pull/17110
1 changed files with 8 additions and 1 deletions
|
@ -23,6 +23,13 @@ namespace Detail {
|
|||
class StringData;
|
||||
}
|
||||
|
||||
// FIXME: Remove this when Apple Clang fully supports consteval.
|
||||
#if defined(AK_OS_MACOS)
|
||||
# define AK_SHORT_STRING_CONSTEVAL constexpr
|
||||
#else
|
||||
# define AK_SHORT_STRING_CONSTEVAL consteval
|
||||
#endif
|
||||
|
||||
// String is a strongly owned sequence of Unicode code points encoded as UTF-8.
|
||||
// The data may or may not be heap-allocated, and may or may not be reference counted.
|
||||
// There is no guarantee that the underlying bytes are null-terminated.
|
||||
|
@ -51,7 +58,7 @@ public:
|
|||
|
||||
// Creates a new String from a short sequence of UTF-8 encoded code points. If the provided string
|
||||
// does not fit in the short string storage, a compilation error will be emitted.
|
||||
static consteval String from_utf8_short_string(StringView string)
|
||||
static AK_SHORT_STRING_CONSTEVAL String from_utf8_short_string(StringView string)
|
||||
{
|
||||
VERIFY(string.length() <= MAX_SHORT_STRING_BYTE_COUNT);
|
||||
|
||||
|
|
Loading…
Reference in a new issue