On 21/05/20 01:01 +0100, Jonathan Wakely wrote:
Also add some missing member functions, nodiscard attributes, and
noexcept-specifiers.
* include/experimental/executor (use_future_t::use_future_t()): Fix
incorrect noexcept-specifier.
* include/experimental/internet (basic_resolver_results): Adjust
whitespace.
* include/experimental/socket (__basic_socket_impl::release): Add
member function.
(basic_socket(io_context&, const endpoint_type&)): Fix argument to
target constructor.
(basic_socket::release(), basic_socket::release(error_code&)): Add
missing member functions.
(basic_socket::is_open()): Add nodiscard attribute.
(basic_socket::close(error_code&)): Pass argument to base function.
(basic_socket_acceptor::release())
(basic_socket_acceptor::release(error_code&)): Add missing member
functions.
(basic_socket_acceptor::is_open()): Add nodiscard attribute.
(basic_socket_streambuf::error()): Add noexcept.
(basic_socket_iostream::error()): Likewise.
* testsuite/experimental/net/socket/basic_socket.cc: New test.
This adjusts the nodiscard attributes to use the _GLIBCXX_NODISCARD
macro for consistency (even though that means the attribute isn't
there for C++14 mode).
Tested powerpc64le-linux, committed to master.
commit 0a1baad8eb3a6f4604a64fdbc82a5f5144fa8be4
Author: Jonathan Wakely <jwak...@redhat.com>
Date: Thu May 21 01:03:27 2020 +0100
libstdc++: Use macro for nodiscard attribute
* include/experimental/socket (basic_socket::is_open()
(basic_socket_acceptor::is_open()): Use _GLIBCXX_NODISCARD macro.
diff --git a/libstdc++-v3/include/experimental/socket b/libstdc++-v3/include/experimental/socket
index 84d23ebe37c..c74aba6919b 100644
--- a/libstdc++-v3/include/experimental/socket
+++ b/libstdc++-v3/include/experimental/socket
@@ -725,7 +725,7 @@ inline namespace v1
native_handle_type release(error_code& __ec)
{ return __base::release(__ec); }
- [[__nodiscard__]] bool
+ _GLIBCXX_NODISCARD bool
is_open() const noexcept { return __base::is_open(); }
void close() { close(__throw_on_error{"basic_socket::close"}); }
@@ -1918,7 +1918,7 @@ inline namespace v1
native_handle_type release(error_code& __ec)
{ return __base::release(__ec); }
- [[__nodiscard__]] bool
+ _GLIBCXX_NODISCARD bool
is_open() const noexcept { return __base::is_open(); }
void