Skip to content

Commit 11604cd

Browse files
committed
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.
1 parent 95aabd4 commit 11604cd

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

AK/String.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@
2626

2727
namespace AK {
2828

29-
// FIXME: Remove this when OpenBSD Clang fully supports consteval.
30-
// And once oss-fuzz updates to clang >15.
31-
// And once Android ships an NDK with clang >14
32-
#if defined(AK_OS_OPENBSD) || defined(OSS_FUZZ) || defined(AK_OS_ANDROID)
33-
# define AK_SHORT_STRING_CONSTEVAL constexpr
34-
#else
35-
# define AK_SHORT_STRING_CONSTEVAL consteval
36-
#endif
37-
3829
// String is a strongly owned sequence of Unicode code points encoded as UTF-8.
3930
// The data may or may not be heap-allocated, and may or may not be reference counted.
4031
// There is no guarantee that the underlying bytes are null-terminated.

AK/StringView.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -378,19 +378,7 @@ struct CaseInsensitiveASCIIStringViewTraits : public Traits<StringView> {
378378

379379
}
380380

381-
// FIXME: Remove this when clang on BSD distributions fully support consteval (specifically in the context of default parameter initialization).
382-
// Note that this is fixed in clang-15, but is not yet picked up by all downstream distributions.
383-
// See: https://github.com/llvm/llvm-project/issues/48230
384-
// Additionally, oss-fuzz currently ships an llvm-project commit that is a pre-release of 15.0.0.
385-
// See: https://github.com/google/oss-fuzz/issues/9989
386-
// Android currently doesn't ship clang-15 in any NDK
387-
#if defined(AK_OS_BSD_GENERIC) || defined(OSS_FUZZ) || defined(AK_OS_ANDROID)
388-
# define AK_STRING_VIEW_LITERAL_CONSTEVAL constexpr
389-
#else
390-
# define AK_STRING_VIEW_LITERAL_CONSTEVAL consteval
391-
#endif
392-
393-
[[nodiscard]] ALWAYS_INLINE AK_STRING_VIEW_LITERAL_CONSTEVAL AK::StringView operator""sv(char const* cstring, size_t length)
381+
[[nodiscard]] ALWAYS_INLINE consteval AK::StringView operator""sv(char const* cstring, size_t length)
394382
{
395383
return AK::StringView(cstring, length);
396384
}

AK/Utf16View.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ inline constexpr bool IsHashCompatible<Utf16String, Utf16View> = true;
704704

705705
}
706706

707-
[[nodiscard]] ALWAYS_INLINE AK_STRING_VIEW_LITERAL_CONSTEVAL AK::Utf16View operator""sv(char16_t const* string, size_t length)
707+
[[nodiscard]] ALWAYS_INLINE consteval AK::Utf16View operator""sv(char16_t const* string, size_t length)
708708
{
709709
return { string, length };
710710
}

0 commit comments

Comments
 (0)