* [Bug c++/101243] Coroutine lambda capture is destroyed twice
2021-06-28 13:37 [Bug c++/101243] New: Coroutine lambda capture is destroyed twice victor.burckel at gmail dot com
@ 2021-06-28 13:37 ` victor.burckel at gmail dot com
2021-06-28 18:57 ` iains at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: victor.burckel at gmail dot com @ 2021-06-28 13:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101243
--- Comment #1 from Victor Burckel <victor.burckel at gmail dot com> ---
May be similar to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99576
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98401
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/101243] Coroutine lambda capture is destroyed twice
2021-06-28 13:37 [Bug c++/101243] New: Coroutine lambda capture is destroyed twice victor.burckel at gmail dot com
2021-06-28 13:37 ` [Bug c++/101243] " victor.burckel at gmail dot com
@ 2021-06-28 18:57 ` iains at gcc dot gnu.org
2021-08-26 11:39 ` nathan at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: iains at gcc dot gnu.org @ 2021-06-28 18:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101243
--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Victor Burckel from comment #1)
> May be similar to
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99576
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98401
I agree this is likely to be a duplicate ( I am in the process of reviewing
coros bugs)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/101243] Coroutine lambda capture is destroyed twice
2021-06-28 13:37 [Bug c++/101243] New: Coroutine lambda capture is destroyed twice victor.burckel at gmail dot com
2021-06-28 13:37 ` [Bug c++/101243] " victor.burckel at gmail dot com
2021-06-28 18:57 ` iains at gcc dot gnu.org
@ 2021-08-26 11:39 ` nathan at gcc dot gnu.org
2021-08-26 11:49 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-08-26 11:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101243
Nathan Sidwell <nathan at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nathan at gcc dot gnu.org
--- Comment #3 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Created attachment 51358
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51358&action=edit
move-only type
Modified to make the capture a move-only type
devvm1702:323>./cc1plus -std=c++20 pr.ii -quiet
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-linkage]
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&, const
std::_Any_data&, std::false_type) [with _Functor =
f(f()::_Z1fv.Frame*)::<lambda()>; std::false_type =
std::integral_constant<bool, false>]':
/data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h:196:16:
required from 'static bool
std::_Function_base::_Base_manager<_Functor>::_M_manager(std::_Any_data&, const
std::_Any_data&, std::_Manager_operation) [with _Functor =
f(f()::_Z1fv.Frame*)::<lambda()>]'
/data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h:283:23:
required from 'static bool std::_Function_handler<_Res(_ArgTypes ...),
_Functor>::_M_manager(std::_Any_data&, const std::_Any_data&,
std::_Manager_operation) [with _Res = void; _Functor =
f(f()::_Z1fv.Frame*)::<lambda()>; _ArgTypes = {}]'
/data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h:611:19:
required from 'std::function<_Res(_ArgTypes ...)>::function(_Functor) [with
_Functor = f(f()::_Z1fv.Frame*)::<lambda()>; <template-parameter-2-2> = void;
<template-parameter-2-3> = void; _Res = void; _ArgTypes = {}]'
pr.cc:71:13: required from here
/data/users/nathans/tools/include/c++/10.1.1/bits/std_function.h:161:13: error:
use of deleted function 'f(f()::_Z1fv.Frame*)::<lambda()>::<lambda>(const
f(f()::_Z1fv.Frame*)::<lambda()>&)'
161 | new _Functor(*__source._M_access<const _Functor*>());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pr.cc:71:22: note: 'f(f()::_Z1fv.Frame*)::<lambda()>::<lambda>(const
f(f()::_Z1fv.Frame*)::<lambda()>&)' is implicitly deleted because the default
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/101243] Coroutine lambda capture is destroyed twice
2021-06-28 13:37 [Bug c++/101243] New: Coroutine lambda capture is destroyed twice victor.burckel at gmail dot com
` (2 preceding siblings ...)
2021-08-26 11:39 ` nathan at gcc dot gnu.org
@ 2021-08-26 11:49 ` redi at gcc dot gnu.org
2021-08-26 23:14 ` redi at gcc dot gnu.org
2021-10-01 20:37 ` iains at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-26 11:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101243
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Nathan Sidwell from comment #3)
> pr.cc:71:22: error: use of deleted function 'FOO::FOO(const FOO&)'
> pr.cc:59:3: note: declared here
Maybe I'm missing the point of the code, but this is expected, isn't it?
std::function cannot store move-only callables, it requires them to be
copyable.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/101243] Coroutine lambda capture is destroyed twice
2021-06-28 13:37 [Bug c++/101243] New: Coroutine lambda capture is destroyed twice victor.burckel at gmail dot com
` (3 preceding siblings ...)
2021-08-26 11:49 ` redi at gcc dot gnu.org
@ 2021-08-26 23:14 ` redi at gcc dot gnu.org
2021-10-01 20:37 ` iains at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-26 23:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101243
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
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 instantiation
of 'std::function<_Res(_ArgTypes ...)>::function(_Functor&&) [with _Functor =
f(f()::_Z1fv.frame*)::<lambda()>; <template-parameter-2-2> = void; _Res = void;
_ArgTypes = {}]':
/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 |
static_assert(is_copy_constructible<__decay_t<_Functor>>::value,
|
^~~~~
/home/jwakely/gcc/12/include/c++/12.0.0/bits/std_function.h:442:69: note:
'std::integral_constant<bool, false>::value' evaluates to false
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/101243] Coroutine lambda capture is destroyed twice
2021-06-28 13:37 [Bug c++/101243] New: Coroutine lambda capture is destroyed twice victor.burckel at gmail dot com
` (4 preceding siblings ...)
2021-08-26 23:14 ` redi at gcc dot gnu.org
@ 2021-10-01 20:37 ` iains at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: iains at gcc dot gnu.org @ 2021-10-01 20:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101243
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
this appears to be the same issue as 100611
*** This bug has been marked as a duplicate of bug 100611 ***
^ permalink raw reply [flat|nested] 7+ messages in thread