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