From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A2F073858415; Thu, 26 Aug 2021 11:39:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2F073858415 From: "nathan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101243] Coroutine lambda capture is destroyed twice Date: Thu, 26 Aug 2021 11:39:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: nathan at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created 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: Thu, 26 Aug 2021 11:39:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101243 Nathan Sidwell changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nathan at gcc dot gnu.org --- Comment #3 from Nathan Sidwell --- Created attachment 51358 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51358&action=3Dedit move-only type Modified to make the capture a move-only type devvm1702:323>./cc1plus -std=3Dc++20 pr.ii -quiet=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 pr.cc: In function 'task f()': pr.cc:73:1: warning: 'f()::_Z1fv.Frame' has a field 'f()::_Z1fv.Frame::D.48642_2_3' whose type has no linkage [-Wsubobject-link= age] In file included from /data/users/nathans/tools/include/c++/10.1.1/functional:59, from pr.cc:2: /data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h: In instantiation of 'static void std::_Function_base::_Base_manager<_Functor>::_M_clone(std::_Any_data&, con= st std::_Any_data&, std::false_type) [with _Functor =3D f(f()::_Z1fv.Frame*)::; std::false_type =3D std::integral_constant]': /data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h:196:16:=20= =20 required from 'static bool std::_Function_base::_Base_manager<_Functor>::_M_manager(std::_Any_data&, c= onst std::_Any_data&, std::_Manager_operation) [with _Functor =3D f(f()::_Z1fv.Frame*)::]' /data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h:283:23:=20= =20 required from 'static bool std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_manager(std::_Any_data&, const std::_Any_data&, std::_Manager_operation) [with _Res =3D void; _Functor =3D f(f()::_Z1fv.Frame*)::; _ArgTypes =3D {}]' /data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h:611:19:=20= =20 required from 'std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor =3D f(f()::_Z1fv.Frame*)::; =3D= void; =3D void; _Res =3D void; _ArgTypes =3D {}]' pr.cc:71:13: required from here /data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h:161:13: er= ror: use of deleted function 'f(f()::_Z1fv.Frame*)::::(const f(f()::_Z1fv.Frame*)::&)' 161 | new _Functor(*__source._M_access()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pr.cc:71:22: note: 'f(f()::_Z1fv.Frame*)::::(const f(f()::_Z1fv.Frame*)::&)' is implicitly deleted because the defau= lt definition would be ill-formed: pr.cc:71:22: error: use of deleted function 'FOO::FOO(const FOO&)' pr.cc:59:3: note: declared here=