[libcxx-commits] [libcxx] [libc++] Base string's alignment on __STDCPP_DEFAULT_NEW_ALIGNMENT__ (PR #171785)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 28 07:48:41 PST 2026


================
@@ -2364,7 +2364,15 @@ private:
   static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __align_it(size_type __s) _NOEXCEPT {
     return (__s + (__a - 1)) & ~(__a - 1);
   }
-  enum { __alignment = 8 };
+
+#  ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
----------------
ldionne wrote:

Let's file a bug report against GCC to ask them to always define this macro. Let's also add a short comment with a link to that bug report.

https://github.com/llvm/llvm-project/pull/171785


More information about the libcxx-commits mailing list