From 7cc06da5d8dbd2a721186eca32745dde83ac199a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 13 Jan 2026 01:25:57 +0100 Subject: [PATCH] Insert alignment assertion for construct --- include/boost/container/allocator_traits.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/boost/container/allocator_traits.hpp b/include/boost/container/allocator_traits.hpp index a29a675..a5a6481 100644 --- a/include/boost/container/allocator_traits.hpp +++ b/include/boost/container/allocator_traits.hpp @@ -47,6 +47,8 @@ #include #endif +#include + #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED) @@ -488,6 +490,7 @@ struct allocator_traits template inline static void construct(Allocator & a, T* p, BOOST_FWD_REF(Args)... args) { + BOOST_ASSERT(std::size_t(p) % dtl::alignment_of::value == 0); BOOST_STATIC_CONSTEXPR bool value = ::boost::move_detail::and_ < dtl::is_not_std_allocator , boost::container::dtl::has_member_function_callable_with_construct