After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759732 - libsigc++-2.6: Return-statement with a value, in function returning 'void'
libsigc++-2.6: Return-statement with a value, in function returning 'void'
Status: RESOLVED INVALID
Product: libsigc++
Classification: Bindings
Component: general
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: libsigc++ maintainer(s)
libsigc++ maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-12-21 12:45 UTC by Pacho Ramos
Modified: 2016-01-14 08:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pacho Ramos 2015-12-21 12:45:01 UTC
We in Gentoo are also noticing some reverse deps failing with errors like:
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:256:21: error: return-
statement with a value, in function returning 'void' [-fpermissive]
{ return functor_(); }

It looks like also some debian maintainers are wondering if maybe this is a bug in libsigc++ side :/
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805932
https://bugs.gentoo.org/show_bug.cgi?id=568796

What do you think? thanks a lot
Comment 1 Kjell Ahlstedt 2015-12-23 15:49:07 UTC
I suspect that libsigc++ can't correctly deduce the return type of a functor.
In what situation do you get this error? What does the application code look
like?

Does your code build with an older version of libsigc++?
The way return types are deduced have been changed slightly in some cases when
we switched to C++11, but I would expect it to work at least as well as before.
That was our intention.
Comment 2 Pacho Ramos 2015-12-23 16:26:24 UTC
It worked with older versions than 2.6

For exAMPLE with gnomoradio the error looks like:
In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:9:0,
                 from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:27,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:86,
                 from ../rainbow/alarm.h:23,
                 from hub-client.h:23,
                 from hub-client.cc:18:
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1896:7: note: candidate is:
 class bound_mem_functor2
       ^
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1926:12: note: T_return sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::operator()(sigc::type_trait_take_t<T_arg3>, sigc::type_trait_take_t<T_arg4>) const [with T_return = void; T_obj = Rainbow::HubClient; T_arg1 = unsigned int; T_arg2 = Rainbow::Resource*; sigc::type_trait_take_t<T_arg3> = const unsigned int&; sigc::type_trait_take_t<T_arg4> = Rainbow::Resource* const&]
   T_return operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2) const
            ^
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1926:12: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/memory:79:0,
                 from /usr/include/glibmm-2.4/glibmm/objectbase.h:32,
                 from /usr/include/glibmm-2.4/glibmm/wrap.h:23,
                 from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:26,
                 from /usr/include/glibmm-2.4/glibmm/arrayhandle.h:23,
                 from /usr/include/glibmm-2.4/glibmm.h:91,
                 from ../rainbow/http-client.h:26,
                 from hub-client.h:24,
                 from hub-client.cc:18:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1333:2: note: template<class ... _Args, class _Result> _Result std::_Bind<_Functor(_Bound_args ...)>::operator()(_Args&& ...) const [with _Args = {_Args ...}; _Result = _Result; _Functor = sigc::bound_mem_functor2<void, Rainbow::HubClient, unsigned int, Rainbow::Resource*>; _Bound_args = {Rainbow::Resource*}]
  operator()(_Args&&... __args) const
  ^
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1333:2: note:   template argument deduction/substitution failed:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1329:53: error: no match for call to '(const sigc::bound_mem_functor2<void, Rainbow::HubClient, unsigned int, Rainbow::Resource*>) (Rainbow::Resource* const&)'
          typename add_const<_Functor>::type>::type>()(
                                                     ^
In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:9:0,
                 from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:27,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:86,
                 from ../rainbow/alarm.h:23,
                 from hub-client.h:23,
                 from hub-client.cc:18:
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1896:7: note: candidate is:
 class bound_mem_functor2
       ^
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1926:12: note: T_return sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::operator()(sigc::type_trait_take_t<T_arg3>, sigc::type_trait_take_t<T_arg4>) const [with T_return = void; T_obj = Rainbow::HubClient; T_arg1 = unsigned int; T_arg2 = Rainbow::Resource*; sigc::type_trait_take_t<T_arg3> = const unsigned int&; sigc::type_trait_take_t<T_arg4> = Rainbow::Resource* const&]
   T_return operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2) const
            ^
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1926:12: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/memory:79:0,
                 from /usr/include/glibmm-2.4/glibmm/objectbase.h:32,
                 from /usr/include/glibmm-2.4/glibmm/wrap.h:23,
                 from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:26,
                 from /usr/include/glibmm-2.4/glibmm/arrayhandle.h:23,
                 from /usr/include/glibmm-2.4/glibmm.h:91,
                 from ../rainbow/http-client.h:26,
                 from hub-client.h:24,
                 from hub-client.cc:18:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1347:2: note: template<class ... _Args, class _Result> _Result std::_Bind<_Functor(_Bound_args ...)>::operator()(_Args&& ...) volatile [with _Args = {_Args ...}; _Result = _Result; _Functor = sigc::bound_mem_functor2<void, Rainbow::HubClient, unsigned int, Rainbow::Resource*>; _Bound_args = {Rainbow::Resource*}]
  operator()(_Args&&... __args) volatile
  ^
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1347:2: note:   template argument deduction/substitution failed:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1343:70: error: no match for call to '(volatile sigc::bound_mem_functor2<void, Rainbow::HubClient, unsigned int, Rainbow::Resource*>) (Rainbow::Resource* volatile&)'
                        typename add_volatile<_Functor>::type>::type>()(
                                                                      ^
In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:9:0,
                 from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:27,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:86,
                 from ../rainbow/alarm.h:23,
                 from hub-client.h:23,
                 from hub-client.cc:18:
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1896:7: note: candidate is:
 class bound_mem_functor2
       ^
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1926:12: note: T_return sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::operator()(sigc::type_trait_take_t<T_arg3>, sigc::type_trait_take_t<T_arg4>) const [with T_return = void; T_obj = Rainbow::HubClient; T_arg1 = unsigned int; T_arg2 = Rainbow::Resource*; sigc::type_trait_take_t<T_arg3> = const unsigned int&; sigc::type_trait_take_t<T_arg4> = Rainbow::Resource* const&]
   T_return operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2) const
            ^
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1926:12: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/memory:79:0,
                 from /usr/include/glibmm-2.4/glibmm/objectbase.h:32,
                 from /usr/include/glibmm-2.4/glibmm/wrap.h:23,
                 from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:26,
                 from /usr/include/glibmm-2.4/glibmm/arrayhandle.h:23,
                 from /usr/include/glibmm-2.4/glibmm.h:91,
                 from ../rainbow/http-client.h:26,
                 from hub-client.h:24,
                 from hub-client.cc:18:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1361:2: note: template<class ... _Args, class _Result> _Result std::_Bind<_Functor(_Bound_args ...)>::operator()(_Args&& ...) const volatile [with _Args = {_Args ...}; _Result = _Result; _Functor = sigc::bound_mem_functor2<void, Rainbow::HubClient, unsigned int, Rainbow::Resource*>; _Bound_args = {Rainbow::Resource*}]
  operator()(_Args&&... __args) const volatile
  ^
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1361:2: note:   template argument deduction/substitution failed:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/functional:1357:64: error: no match for call to '(const volatile sigc::bound_mem_functor2<void, Rainbow::HubClient, unsigned int, Rainbow::Resource*>) (Rainbow::Resource* const volatile&)'
                        typename add_cv<_Functor>::type>::type>()(
                                                                ^
In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:9:0,
                 from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:27,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:86,
                 from ../rainbow/alarm.h:23,
                 from hub-client.h:23,
                 from hub-client.cc:18:
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1896:7: note: candidate is:
 class bound_mem_functor2
       ^
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1926:12: note: T_return sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::operator()(sigc::type_trait_take_t<T_arg3>, sigc::type_trait_take_t<T_arg4>) const [with T_return = void; T_obj = Rainbow::HubClient; T_arg1 = unsigned int; T_arg2 = Rainbow::Resource*; sigc::type_trait_take_t<T_arg3> = const unsigned int&; sigc::type_trait_take_t<T_arg4> = Rainbow::Resource* const&]
   T_return operator()(type_trait_take_t<T_arg1> _A_a1, type_trait_take_t<T_arg2> _A_a2) const
            ^
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1926:12: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7:0,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:27,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:86,
                 from ../rainbow/alarm.h:23,
                 from hub-client.h:23,
                 from hub-client.cc:18:
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89:30: error: return-statement with a value, in function returning 'void' [-fpermissive]
     { return functor_(_A_arg1); }
                              ^
Makefile:644: recipe for target 'hub-client.lo' failed
make[2]: *** [hub-client.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from http-server.cc:19:0:
hub-client.h:86:29: warning: 'auto_ptr' is deprecated (declared at /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
   std::auto_ptr<HttpClient> dl;
                             ^
make[2]: Leaving directory '/var/tmp/portage/media-sound/gnomoradio-0.15.1/work/gnomoradio-0.15.1/rainbow'
Makefile:412: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/media-sound/gnomoradio-0.15.1/work/gnomoradio-0.15.1'
Makefile:344: recipe for target 'all' failed
make: *** [all] Error 2
Comment 3 Pacho Ramos 2015-12-23 16:27:07 UTC
It looks like the sources of that can be retrieved from:
http://savannah.nongnu.org/download/gnomoradio/gnomoradio-0.15.1.tar.gz
Comment 4 Kjell Ahlstedt 2015-12-24 09:11:27 UTC
Don't use

  using namespace std;
  using namespace sigc;

With C++11 there are more possibilities for name clashes than before.
E.g. std::bind and sigc::bind, std::signal and sigc::signal.

I tried to build gnomeradio with
  make CXXFLAGS=-std=c++11

It first stopped in hub-client.cc. When I had changed all bind to sigc::bind in
hub-client.cc, it compiled.
The build then stopped in license.cc. When I had changed signal to sigc::signal
in license.cc, it compiled.
The build then stopped with
  rdf-resource.cc:38:4: error: reference to 'signal' is ambiguous

Then I gave up. There are probably many files in gnomeradio that must be
changed in order to make it work with C++11.
Comment 5 Pacho Ramos 2015-12-24 09:40:45 UTC
OK, thanks for the info :)
Comment 6 Murray Cumming 2016-01-14 08:44:41 UTC
Closing then as this seems more of an issue with use of C++11 than a problem with libsigc++. Hopefully you are reporting this to the gnomeradio upstream developers.