From 2714f99c1ca59bc81a4dc6308d91e6d22fdb2725 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 19 Jun 2023 11:44:39 -0400 Subject: [PATCH] AK: Update clang workaround for consteval StringView literals The underlying issue was fixed in clang-15. See: https://github.com/llvm/llvm-project/commit/a4f8590247264b9c3121f48dd5b3db707c934ba2 However, Apple and BSD distributions do not yet have this patch. --- AK/StringView.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AK/StringView.h b/AK/StringView.h index c2ea6759dd..77ce92a70b 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -371,9 +371,10 @@ struct CaseInsensitiveASCIIStringViewTraits : public Traits { } -// FIXME: Remove this when clang fully supports consteval (specifically in the context of default parameter initialization). -// See: https://stackoverflow.com/questions/68789984/immediate-function-as-default-function-argument-initializer-in-clang -#if defined(AK_COMPILER_CLANG) +// 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 +#if defined(AK_OS_BSD_GENERIC) # define AK_STRING_VIEW_LITERAL_CONSTEVAL constexpr #else # define AK_STRING_VIEW_LITERAL_CONSTEVAL consteval