From ba62d07a1e72d895427f81ef20176bf59e676fd6 Mon Sep 17 00:00:00 2001 From: Vlad Khorsun Date: Thu, 7 Nov 2024 14:37:51 +0200 Subject: [PATCH] Workaround problem with static_assert(false) in gcc/clang compilers --- src/common/utils_proto.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/utils_proto.h b/src/common/utils_proto.h index 2a555a3f92..72f897cd36 100644 --- a/src/common/utils_proto.h +++ b/src/common/utils_proto.h @@ -275,6 +275,10 @@ namespace fb_utils bool isBpbSegmented(unsigned parLength, const unsigned char* par); + // Workaround, to be removed with C++ 23 + template + constexpr bool fb_always_false_v = false; + // Put integer value into info buffer template inline unsigned char* putInfoItemInt(const unsigned char item, T value, @@ -308,7 +312,7 @@ namespace fb_utils else if constexpr (len == sizeof(char)) *ptr = value; else - static_assert(always_false::value, "unknown data type"); + static_assert(fb_always_false_v, "unknown data type"); ptr += len; return ptr;