Skip to content

Instantly share code, notes, and snippets.

@ihameed
Created March 18, 2023 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihameed/b226d72537e8a4a8e9c590bef529a137 to your computer and use it in GitHub Desktop.
Save ihameed/b226d72537e8a4a8e9c590bef529a137 to your computer and use it in GitHub Desktop.
diff --git a/libcxx/include/string b/libcxx/include/string
index 3723dc8a3938..40cef4e88a47 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -4657,6 +4657,8 @@ basic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator*
#endif // _LIBCPP_ENABLE_DEBUG_MODE
#if _LIBCPP_STD_VER > 11
+
+#if !defined(_VOIDLINUX_GCC_BUG_109180_WORKAROUND) // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180
// Literal suffixes for basic_string [basic.string.literals]
inline namespace literals
{
@@ -4697,6 +4699,7 @@ inline namespace literals
}
} // namespace string_literals
} // namespace literals
+#endif // !defined(_VOIDLINUX_GCC_BUG_109180_WORKAROUND)
#if _LIBCPP_STD_VER > 17
template <>
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 9abf548abbb9..8a850e40ddc1 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -314,6 +314,10 @@ if (LIBCXX_ENABLE_STATIC)
endif()
endif()
+set_property(
+ SOURCE string.cpp
+ APPEND PROPERTY COMPILE_DEFINITIONS "_VOIDLINUX_GCC_BUG_109180_WORKAROUND")
+
# Add a meta-target for both libraries.
add_custom_target(cxx DEPENDS ${LIBCXX_BUILD_TARGETS})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment