Add patch for Boost.Asio to fix allocator usage (#1403165)

This commit is contained in:
Jonathan Wakely 2016-12-09 10:31:48 +00:00
parent 783423d8bf
commit b4161c034b
2 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From 42e7869f411a75512fb6994c634eb086fb9eb5cc Mon Sep 17 00:00:00 2001
From: Christopher Kohlhoff <chris@kohlhoff.com>
Date: Sun, 11 Sep 2016 12:04:18 +1000
Subject: [PATCH] Fix allocator usage to compile with g++ 6.
---
include/boost/asio/impl/use_future.hpp | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/include/boost/asio/impl/use_future.hpp b/include/boost/asio/impl/use_future.hpp
index b954e14..92106f4 100644
--- a/include/boost/asio/impl/use_future.hpp
+++ b/include/boost/asio/impl/use_future.hpp
@@ -34,10 +34,12 @@ namespace detail {
{
public:
// Construct from use_future special value.
- template <typename Allocator>
- promise_handler(use_future_t<Allocator> uf)
+ template <typename Alloc>
+ promise_handler(use_future_t<Alloc> uf)
: promise_(std::allocate_shared<std::promise<T> >(
- uf.get_allocator(), std::allocator_arg, uf.get_allocator()))
+ typename Alloc::template rebind<char>::other(uf.get_allocator()),
+ std::allocator_arg,
+ typename Alloc::template rebind<char>::other(uf.get_allocator())))
{
}
@@ -66,10 +68,12 @@ namespace detail {
{
public:
// Construct from use_future special value. Used during rebinding.
- template <typename Allocator>
- promise_handler(use_future_t<Allocator> uf)
+ template <typename Alloc>
+ promise_handler(use_future_t<Alloc> uf)
: promise_(std::allocate_shared<std::promise<void> >(
- uf.get_allocator(), std::allocator_arg, uf.get_allocator()))
+ typename Alloc::template rebind<char>::other(uf.get_allocator()),
+ std::allocator_arg,
+ typename Alloc::template rebind<char>::other(uf.get_allocator())))
{
}

View File

@ -32,7 +32,7 @@ Name: boost
Summary: The free peer-reviewed portable C++ source libraries
Version: 1.58.0
%define version_enc 1_58_0
Release: 11%{?dist}
Release: 12%{?dist}
License: Boost and MIT and Python
%define toplev_dirname %{name}_%{version_enc}
@ -140,6 +140,9 @@ Patch80: 0002-Fix-a-regression-with-non-constexpr-types.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1294515
Patch81: boost-1.58-binomial_heap.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1403165
Patch85: boost-1.58-asio-use-future.patch
%bcond_with tests
%bcond_with docs_generated
@ -641,6 +644,7 @@ a number of significant features and is now developed independently
%patch70 -p1
%patch80 -p2
%patch81 -p2
%patch85 -p2
# At least python2_version needs to be a macro so that it's visible in
# %%install as well.
@ -1302,6 +1306,9 @@ fi
%{_mandir}/man1/bjam.1*
%changelog
* Fri Dec 09 2016 Jonathan Wakely <jwakely@redhat.com> - 1.58.0-12
- Add patch for Boost.Asio to fix allocator usage (#1403165)
* Fri Jan 15 2016 Jonathan Wakely <jwakely@redhat.com> 1.58.0-11
- Add patch for binomial_heap::pop (#1294515)