chriskohlhoff / asio

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

Compilation failure with -DBOOST_ASIO_NO_DYNAMIC_BUFFER_V1 #1416

Open viccie30 opened 5 months ago

viccie30 commented 5 months ago

Commit 5459f3b12f4c4ca4428dd611060b249ac5e52c38 broke compilation for asio/impl/read_until.hpp with -DBOOST_ASIO_NO_DYNAMIC_BUFFER_V1:

$ g++ -DBOOST_ASIO_NO_DYNAMIC_BUFFER_V1 -x c++ /usr/include/boost/asio/read_until.hpp
In file included from /usr/include/boost/asio/read_until.hpp:3124:
/usr/include/boost/asio/impl/read_until.hpp: In function 'std::size_t boost::asio::read_until(SyncReadStream&, DynamicBuffer_v2, const boost::basic_regex<char, Traits>&, boost::system::error_code&, constraint_t<is_dynamic_buffer_v2<DynamicBuffer_v2>::value>)':
/usr/include/boost/asio/impl/read_until.hpp:686:25: error: 'regex_match_flags' is not a member of 'boost::asio::detail'
  686 |           expr, detail::regex_match_flags()))
      |                         ^~~~~~~~~~~~~~~~~
/usr/include/boost/asio/impl/read_until.hpp: In member function 'void boost::asio::detail::read_until_expr_op_v2<AsyncReadStream, DynamicBuffer_v2, RegEx, ReadHandler>::operator()(boost::system::error_code, std::size_t, int)':
/usr/include/boost/asio/impl/read_until.hpp:2490:39: error: there are no arguments to 'regex_match_flags' that depend on a template parameter, so a declaration of 'regex_match_flags' must be available [-fpermissive]
 2490 |                 match_results, expr_, regex_match_flags());
      |                                       ^~~~~~~~~~~~~~~~~
/usr/include/boost/asio/impl/read_until.hpp:2490:39: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)

The definition of struct regex_match_flags should not be guarded by #if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1).