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.
This commit is contained in:
Ed Catmur
2023-06-28 14:30:07 -05:00
committed by GitHub
parent 93201da2ba
commit 2ac0518a81
+2 -1
View File
@@ -120,7 +120,8 @@
#define PHMAP_HAVE_BUILTIN(x) 0 #define PHMAP_HAVE_BUILTIN(x) 0
#endif #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 #define PHMAP_HAVE_CC17 1
#else #else
#define PHMAP_HAVE_CC17 0 #define PHMAP_HAVE_CC17 0