[libcxx-commits] [libcxx] 9798b23 - [libc++] Make sure we only consider _GNUC_VER_NEW when the compiler is GCC

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 22 13:08:33 PDT 2020


Author: Louis Dionne
Date: 2020-07-22T16:08:19-04:00
New Revision: 9798b2311f7f5b06e0a377613b3e90ed34d5d9c1

URL: https://github.com/llvm/llvm-project/commit/9798b2311f7f5b06e0a377613b3e90ed34d5d9c1
DIFF: https://github.com/llvm/llvm-project/commit/9798b2311f7f5b06e0a377613b3e90ed34d5d9c1.diff

LOG: [libc++] Make sure we only consider _GNUC_VER_NEW when the compiler is GCC

When the compiler is Clang, _GNUC_VER_NEW is 0, which messes up the logic.

Added: 
    

Modified: 
    libcxx/include/variant

Removed: 
    


################################################################################
diff  --git a/libcxx/include/variant b/libcxx/include/variant
index 5ea2cbdae744..33d5dc7dbeb1 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -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


        


More information about the libcxx-commits mailing list