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:
Undefine
2025-11-02 19:23:57 +01:00
committed by Jelle Raaijmakers
parent 80003ecc09
commit cde3941d9f
Notes: github-actions[bot] 2025-11-07 10:28:57 +00:00
3 changed files with 2 additions and 23 deletions

View File

@@ -26,15 +26,6 @@
namespace AK { 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. // 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. // 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. // There is no guarantee that the underlying bytes are null-terminated.

View File

@@ -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). [[nodiscard]] ALWAYS_INLINE consteval AK::StringView operator""sv(char const* cstring, size_t length)
// 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)
{ {
return AK::StringView(cstring, length); return AK::StringView(cstring, length);
} }

View File

@@ -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 }; return { string, length };
} }