[libc++] Make sure we only consider _GNUC_VER_NEW when the compiler is GCC
authorLouis Dionne <ldionne@apple.com>
Wed, 22 Jul 2020 19:59:09 +0000 (15:59 -0400)
committerLouis Dionne <ldionne@apple.com>
Wed, 22 Jul 2020 20:08:19 +0000 (16:08 -0400)
When the compiler is Clang, _GNUC_VER_NEW is 0, which messes up the logic.

libcxx/include/variant

index 5ea2cbd..33d5dc7 100644 (file)
@@ -230,7 +230,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // TODO: GCC 5 lies about its support for C++17 (it says it supports it but it
 //       really doesn't). That breaks variant, which uses some C++17 features.
 //       Remove this once we drop support for GCC 5.
-#if _LIBCPP_STD_VER > 14 && !(_GNUC_VER_NEW < 6000)
+#if _LIBCPP_STD_VER > 14 && !(defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER_NEW < 6000)
 
 _LIBCPP_NORETURN
 inline _LIBCPP_INLINE_VISIBILITY