[libc++] Workaround broken support for C++17 in GCC 5
authorLouis Dionne <ldionne@apple.com>
Wed, 22 Jul 2020 19:24:16 +0000 (15:24 -0400)
committerLouis Dionne <ldionne@apple.com>
Wed, 22 Jul 2020 19:38:58 +0000 (15:38 -0400)
libcxx/include/variant

index 03557239a69e68638faead81007a5bc92ca30727..5ea2cbdae7446d9db744458f2cdb42f2d473f2e0 100644 (file)
@@ -227,7 +227,10 @@ public:
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+// 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)
 
 _LIBCPP_NORETURN
 inline _LIBCPP_INLINE_VISIBILITY