From 2ac0518a81ed8d2143f1b6b056f2f9207f8c452a Mon Sep 17 00:00:00 2001 From: Ed Catmur Date: Wed, 28 Jun 2023 14:30:07 -0500 Subject: [PATCH] Fix C++17 detection for clang Clang (even recent, e.g. llvm 16) sets __GNUC__ to 4, so the check for C++17 fails. This results in the check for invoke_result_t in phmap_base.h failing, so it uses std::result_of, which is removed entirely in recent libc++, breaking the build. --- parallel_hashmap/phmap_config.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parallel_hashmap/phmap_config.h b/parallel_hashmap/phmap_config.h index 8a881f4..2a5ceee 100644 --- a/parallel_hashmap/phmap_config.h +++ b/parallel_hashmap/phmap_config.h @@ -120,7 +120,8 @@ #define PHMAP_HAVE_BUILTIN(x) 0 #endif -#if (!defined(__GNUC__) || __GNUC__ >= 5) && ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) +#if (!defined(__GNUC__) || defined(__clang__) || __GNUC__ >= 5) && \ + ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #define PHMAP_HAVE_CC17 1 #else #define PHMAP_HAVE_CC17 0