From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13AAF386EC42; Fri, 24 Apr 2020 13:32:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13AAF386EC42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587735124; bh=qR9eA6H3p5vL3gNEczuznBsDNNQsjeyz6uoYxZonblc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jypgNGN/K5Ec0Ggbu7RGUvHjHM6suFISepGwmZ9uGgwW+6Thx5vbddGMmP0lupu+O Hgr+EiX0pBrQGuveKbilX+Rxa/oPPmlvJbvLrRJ2o5VNSrnDrrV0acI+b1qFpDiynt V1L6jL/23bDbsALx0AwrVwjdJASgsqecdel9Vh38= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/94203] experimental/executor and socket header issues- Date: Fri, 24 Apr 2020 13:32:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2020 13:32:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94203 --- Comment #3 from CVS Commits --- The releases/gcc-9 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:942b32e261c414a033766ed7848d923f9630b991 commit r9-8543-g942b32e261c414a033766ed7848d923f9630b991 Author: Jonathan Wakely Date: Fri Apr 24 14:29:37 2020 +0100 libstdc++: Fix type-erasure in experimental::net::executor (PR 94203) The _Tgt and _TgtImpl types that implement type-erasure didn't agree on the virtual interface, so failed as soon as they were instantiated. With Clang they failed even sooner. The interface was also dependent on whether RTTI was enabled or not. This patch fixes the broken virtual functions and makes the type work without RTTI, by using a pointer to a specialization of a function template (similar to the approaches in std::function and std::any). The changes to the virtual functions would be an ABI change, except that the previous code didn't even compile if instantiated. This is experimental TS material anyway. Backport from mainline 2020-03-18 Jonathan Wakely PR libstdc++/94203 * include/experimental/executor (executor::executor(Executor)): Call make_shared directly instead of _M_create. Create _Tgt1 object. (executor::executor(allocator_arg_t, const ProtoAlloc&, Executo= r)): Call allocate_shared directly instead of _M_create. Create _Tgt2 object. (executor::target_type): Add cast needed for new _Tgt interface. (executor::target): Define when RTTI is disabled. Use _Tgt::_M_func. (executor::_Tgt): Define the same interface whether RTTI is ena= bled or not. (executor::_Tgt::target_type, executor::_Tgt::target): Do not u= se std::type_info in the interface. (executor::_Tgt::_M_func): Add data member. (executor::_TgtImpl): Replace with _Tgt1 and _Tgt2 class templa= tes. (executor::_Tgt1::_S_func): Define function to access target without depending on RTTI. (executor::_M_create): Remove. (operator=3D=3D, operator!=3D): Simplify comparisons for execut= or. * include/experimental/socket (is_error_code_enum): Define specialization before use. * testsuite/experimental/net/executor/1.cc: New test.=