From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E11AF3857C78; Thu, 26 Aug 2021 23:14:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E11AF3857C78 From: "redi 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 23:14:05 +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: redi 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: 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 23:14:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101243 --- Comment #5 from Jonathan Wakely --- For the attachment in comment 3 trunk now says: In file included from /home/jwakely/gcc/12/include/c++/12.0.0/functional:59, from /tmp/pr-1.cc:2: /home/jwakely/gcc/12/include/c++/12.0.0/bits/std_function.h: In instantiati= on of 'std::function<_Res(_ArgTypes ...)>::function(_Functor&&) [with _Functor= =3D f(f()::_Z1fv.frame*)::; =3D void; _Res = =3D void; _ArgTypes =3D {}]': /tmp/pr-1.cc:71:13: required from here /home/jwakely/gcc/12/include/c++/12.0.0/bits/std_function.h:442:69: error: static assertion failed: std::function target must be copy-constructible 442 |=20=20=20=20=20=20=20=20=20=20 static_assert(is_copy_constructible<__decay_t<_Functor>>::value, |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ^~~~~ /home/jwakely/gcc/12/include/c++/12.0.0/bits/std_function.h:442:69: note: 'std::integral_constant::value' evaluates to false=