chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.95k stars 1.22k forks source link

clang-11 warning: 'allocator<void>' is deprecated #785

Open k15tfu opened 3 years ago

k15tfu commented 3 years ago

In file boost/asio/associated_allocator.hpp:

boost/asio/associated_allocator.hpp:72:49: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
template <typename T, typename Allocator = std::allocator<void> >
                                                ^

In file boost/asio/impl/compose.hpp:

boost/asio/impl/compose.hpp:332:12: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
      std::allocator<void> >::type allocator_type;
           ^

In file boost/asio/impl/executor.hpp:

boost/asio/impl/executor.hpp:210:14: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
        std::allocator<void>());
             ^
boost/asio/impl/executor.hpp:216:14: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
        std::allocator<void>());
             ^
boost/asio/impl/executor.hpp:245:31: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
  : impl_(impl<Executor, std::allocator<void> >::create(e))
                              ^

In file boost/asio/execution/any_executor.hpp:

boost/asio/execution/any_executor.hpp:607:53: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
          function(BOOST_ASIO_MOVE_CAST(F)(f), std::allocator<void>()));
                                                    ^

In file boost/asio/system_executor.hpp:

boost/asio/system_executor.hpp:166:54: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
  basic_system_executor<Blocking, Relationship, std::allocator<void> >
                                                     ^

In file boost/asio/io_context.hpp:

boost/asio/io_context.hpp:229:36: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
  typedef basic_executor_type<std::allocator<void>, 0> executor_type;
                                   ^

In file boost/asio/system_context.hpp:

boost/asio/system_context.hpp:40:12: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
      std::allocator<void>
           ^

In file boost/asio/detail/impl/strand_executor_service.hpp:

boost/asio/detail/impl/strand_executor_service.hpp:254:12: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
      std::allocator<void>());
           ^

In file boost/asio/thread_pool.hpp:

boost/asio/thread_pool.hpp:86:36: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
  typedef basic_executor_type<std::allocator<void>, 0> executor_type;
                                   ^
boost/asio/thread_pool.hpp:89:36: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
  typedef basic_executor_type<std::allocator<void>, 0> scheduler_type;
                                   ^
boost/asio/thread_pool.hpp:387:49: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
  BOOST_ASIO_CONSTEXPR basic_executor_type<std::allocator<void>, Bits>
                                                ^
boost/asio/thread_pool.hpp:390:37: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
    return basic_executor_type<std::allocator<void>, Bits>(
                                    ^
boost/asio/thread_pool.hpp:391:21: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
        pool_, std::allocator<void>(), bits_);
                    ^

There are other places that should be fixed.

eakraly commented 3 years ago

Same warnings with Android NDK22

nx10 commented 3 years ago

Might be related to https://github.com/chriskohlhoff/asio/issues/290.

k15tfu commented 2 years ago

In file boost/asio/buffer_registration.hpp:

boost/asio/buffer_registration.hpp:62:31: error: 'allocator<void>' is deprecated [-Werror,-Wdeprecated-declarations]
    typename Allocator = std::allocator<void> >
                              ^
INotfound commented 1 year ago

I also encountered this problem, how to deal with it, I think the C++20 standard has been removed allocator