[gcc r9-8542] libstdc++: Make net::service_already_exists default constructible

Jonathan Wakely redi@gcc.gnu.org
Fri Apr 24 13:31:57 GMT 2020


https://gcc.gnu.org/g:557fd3b4989b677ac944afb0b0ca2d60480e19e4

commit r9-8542-g557fd3b4989b677ac944afb0b0ca2d60480e19e4
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Apr 24 14:27:23 2020 +0100

    libstdc++: Make net::service_already_exists default constructible
    
    The LWG issue I created is Tentatively Ready and proposes to declare a
    public default constructor, rather than the private one I added
    recently.
    
    Backport from mainline
    2020-04-24  Jonathan Wakely  <jwakely@redhat.com>
    
            * include/experimental/executor (service_already_exists): Make default
            constructor public (LWG 3414).
            * testsuite/experimental/net/execution_context/make_service.cc: Check
            the service_already_exists can be default constructed.

Diff:
---
 libstdc++-v3/ChangeLog                                         | 10 ++++++++++
 libstdc++-v3/include/experimental/executor                     |  7 +++----
 .../experimental/net/execution_context/make_service.cc         |  3 +++
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 9434ab185fe..23203b3ed15 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,13 @@
+2020-04-24  Jonathan Wakely  <jwakely@redhat.com>
+
+	Backport from mainline
+	2020-04-24  Jonathan Wakely  <jwakely@redhat.com>
+
+	* include/experimental/executor (service_already_exists): Make default
+	constructor public (LWG 3414).
+	* testsuite/experimental/net/execution_context/make_service.cc: Check
+	the service_already_exists can be default constructed.
+
 2020-04-23  Thomas Rodgers  <rodgert@appliantology.com>
 
 	Backport from mainline
diff --git a/libstdc++-v3/include/experimental/executor b/libstdc++-v3/include/experimental/executor
index 9c0c7186234..13a24a8cdb5 100644
--- a/libstdc++-v3/include/experimental/executor
+++ b/libstdc++-v3/include/experimental/executor
@@ -129,10 +129,9 @@ inline namespace v1
 
   class service_already_exists : public logic_error
   {
-    template<typename _Service, typename... _Args>
-      friend _Service&
-      make_service(execution_context&, _Args&&...);
-
+  public:
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
+    // 3414. service_already_exists has no usable constructors
     service_already_exists() : logic_error("service already exists") { }
   };
 
diff --git a/libstdc++-v3/testsuite/experimental/net/execution_context/make_service.cc b/libstdc++-v3/testsuite/experimental/net/execution_context/make_service.cc
index f134add48b5..0898d12927a 100644
--- a/libstdc++-v3/testsuite/experimental/net/execution_context/make_service.cc
+++ b/libstdc++-v3/testsuite/experimental/net/execution_context/make_service.cc
@@ -34,3 +34,6 @@ void test01(net::execution_context& c)
 {
   net::make_service<S>(c);
 }
+
+static_assert(std::is_default_constructible<net::service_already_exists>(),
+	      "LWG 3414. service_already_exists has no usable constructors");


More information about the Libstdc++-cvs mailing list