libstdc++: fix allocator_traits<>::allocate_at_least

allocator_traits<>::allocate_at_least has taken its allocator
by value, incorrectly. This patch makes it take its allocator
by reference, as specified.

libstdc++-v3/ChangeLog:
	* include/bits/alloc_traits.h (allocate_at_least):
	Take allocator argument by reference, per Standard.
This commit is contained in:
Nathan Myers
2026-04-13 14:48:22 -04:00
parent 6fd78515cc
commit 83e758acdb

View File

@@ -670,7 +670,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* Returns `a.allocate_at_least(n)`.
*/
[[nodiscard]] static constexpr auto
allocate_at_least(allocator_type __a, size_type __n)
allocate_at_least(allocator_type& __a, size_type __n)
-> allocation_result<pointer, size_type>
{ return __a.allocate_at_least(__n); }
#endif