mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-05 01:10:24 +00:00
AK: Remove a clang-15 consteval workaround
This is a really really old workaround and it doesn't seem to be needed anymore as clang-15 is supported for a really long time.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
80003ecc09
commit
cde3941d9f
Notes:
github-actions[bot]
2025-11-07 10:28:57 +00:00
Author: https://github.com/cqundefine Commit: https://github.com/LadybirdBrowser/ladybird/commit/cde3941d9fb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6631 Reviewed-by: https://github.com/gmta ✅
@@ -26,15 +26,6 @@
|
||||
|
||||
namespace AK {
|
||||
|
||||
// FIXME: Remove this when OpenBSD Clang fully supports consteval.
|
||||
// And once oss-fuzz updates to clang >15.
|
||||
// And once Android ships an NDK with clang >14
|
||||
#if defined(AK_OS_OPENBSD) || defined(OSS_FUZZ) || defined(AK_OS_ANDROID)
|
||||
# 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.
|
||||
|
||||
@@ -378,19 +378,7 @@ struct CaseInsensitiveASCIIStringViewTraits : public Traits<StringView> {
|
||||
|
||||
}
|
||||
|
||||
// FIXME: Remove this when clang on BSD distributions fully support consteval (specifically in the context of default parameter initialization).
|
||||
// Note that this is fixed in clang-15, but is not yet picked up by all downstream distributions.
|
||||
// See: https://github.com/llvm/llvm-project/issues/48230
|
||||
// Additionally, oss-fuzz currently ships an llvm-project commit that is a pre-release of 15.0.0.
|
||||
// See: https://github.com/google/oss-fuzz/issues/9989
|
||||
// Android currently doesn't ship clang-15 in any NDK
|
||||
#if defined(AK_OS_BSD_GENERIC) || defined(OSS_FUZZ) || defined(AK_OS_ANDROID)
|
||||
# define AK_STRING_VIEW_LITERAL_CONSTEVAL constexpr
|
||||
#else
|
||||
# define AK_STRING_VIEW_LITERAL_CONSTEVAL consteval
|
||||
#endif
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE AK_STRING_VIEW_LITERAL_CONSTEVAL AK::StringView operator""sv(char const* cstring, size_t length)
|
||||
[[nodiscard]] ALWAYS_INLINE consteval AK::StringView operator""sv(char const* cstring, size_t length)
|
||||
{
|
||||
return AK::StringView(cstring, length);
|
||||
}
|
||||
|
||||
@@ -704,7 +704,7 @@ inline constexpr bool IsHashCompatible<Utf16String, Utf16View> = true;
|
||||
|
||||
}
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE AK_STRING_VIEW_LITERAL_CONSTEVAL AK::Utf16View operator""sv(char16_t const* string, size_t length)
|
||||
[[nodiscard]] ALWAYS_INLINE consteval AK::Utf16View operator""sv(char16_t const* string, size_t length)
|
||||
{
|
||||
return { string, length };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user