From a8115267a6c80d22bd483cf075e8709cc68fbb60 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 26 Jul 2021 05:16:29 +0300 Subject: [PATCH] mdbx++: disable using C++20 concepts for CLANG < 12. --- mdbx.h++ | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index 654cee8b..d44f930d 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -192,7 +192,9 @@ #endif /* MDBX_CXX20_UNLIKELY */ #ifndef MDBX_CXX20_CONCEPT -#if defined(DOXYGEN) || (defined(__cpp_concepts) && __cpp_concepts >= 201907L) +#if defined(DOXYGEN) || \ + (defined(__cpp_concepts) && __cpp_concepts >= 201907L && \ + (!defined(__clang__) || __clang_major__ >= 12)) #define MDBX_CXX20_CONCEPT(CONCEPT, NAME) CONCEPT NAME #else #define MDBX_CXX20_CONCEPT(CONCEPT, NAME) typename NAME @@ -200,7 +202,9 @@ #endif /* MDBX_CXX20_CONCEPT */ #ifndef MDBX_ASSERT_CXX20_CONCEPT_SATISFIED -#if defined(DOXYGEN) || (defined(__cpp_concepts) && __cpp_concepts >= 201907L) +#if defined(DOXYGEN) || \ + (defined(__cpp_concepts) && __cpp_concepts >= 201907L && \ + (!defined(__clang__) || __clang_major__ >= 12)) #define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, TYPE) \ static_assert(CONCEPT) #else @@ -466,7 +470,9 @@ static MDBX_CXX20_CONSTEXPR void *memcpy(void *dest, const void *src, size_t bytes) noexcept; //------------------------------------------------------------------------------ -#if defined(DOXYGEN) || (defined(__cpp_concepts) && __cpp_concepts >= 201907L) +#if defined(DOXYGEN) || \ + (defined(__cpp_concepts) && __cpp_concepts >= 201907L && \ + (!defined(__clang__) || __clang_major__ >= 12)) template concept MutableByteProducer = requires(T a, char array[42]) {