From 2efb729c53124266f5807cb6e56fe145dfc68e30 Mon Sep 17 00:00:00 2001 From: Richard Hodges Date: Wed, 22 Jul 2020 13:07:42 +0200 Subject: [PATCH] Fix compile errors under Clang 3.4 fixes #2030 closes #2031 --- CHANGELOG.md | 2 ++ example/echo-op/echo_op.cpp | 6 +++--- include/boost/beast/http/basic_parser.hpp | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3186ae42..7c1c41ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Fix compile errors under Clang 3.4 +* Fix portability bug in websocket server sync example. -------------------------------------------------------------------------------- diff --git a/example/echo-op/echo_op.cpp b/example/echo-op/echo_op.cpp index 475940be..96be6595 100644 --- a/example/echo-op/echo_op.cpp +++ b/example/echo-op/echo_op.cpp @@ -355,8 +355,8 @@ int main(int argc, char** argv) } namespace net = boost::asio; - auto const address{net::ip::make_address(argv[1])}; - auto const port{static_cast(std::atoi(argv[2]))}; + auto const address = net::ip::make_address(argv[1]); + auto const port = static_cast(std::atoi(argv[2])); using endpoint_type = net::ip::tcp::endpoint; @@ -364,7 +364,7 @@ int main(int argc, char** argv) // the echo, and then shut everything down and exit. net::io_context ioc; net::ip::tcp::acceptor acceptor{ioc}; - endpoint_type ep{address, port}; + endpoint_type ep(address, port); acceptor.open(ep.protocol()); acceptor.set_option(net::socket_base::reuse_address(true)); acceptor.bind(ep); diff --git a/include/boost/beast/http/basic_parser.hpp b/include/boost/beast/http/basic_parser.hpp index 4703f4e8..6f9bf8a8 100644 --- a/include/boost/beast/http/basic_parser.hpp +++ b/include/boost/beast/http/basic_parser.hpp @@ -71,7 +71,8 @@ class basic_parser { boost::optional body_limit_ = - default_body_limit(is_request{}); // max payload body + boost::optional( + default_body_limit(is_request{})); // max payload body std::uint64_t len_ = 0; // size of chunk or body std::uint64_t len0_ = 0; // content length if known std::unique_ptr buf_; // temp storage