[libc++] Workaround broken support for C++17 in GCC 5
Cr-Mirrored-From: https://chromium.googlesource.com/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: e9748a7255df1f45175a391d90803e84f62b3c12
diff --git a/include/variant b/include/variant
index 0355723..5ea2cbd 100644
--- a/include/variant
+++ b/include/variant
@@ -227,7 +227,10 @@
_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