[Bug libstdc++/42761] New: std::bind doesn't work for simple class types

paolo dot carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Fri Jan 15 18:13:00 GMT 2010


Unfortunately, this very simple example, which we have been discussing for
other reasons, regresses very badly vs tr1. Unfortunately the C++ front-end
doesn't seem ready for a conforming result_of :( Can we prepare a reduced
testcase for Jason?

Maybe he can already tell us whether an error message of the form: "sorry,
unimplemented: unable to determine the declared type of expression
‘declval<X>()()’" points to an issue fixable any time soon...

Otherwise, I'm afraid that for 4.5.0 we have to revert consistently most C++0x
work in <functional>.

///////////////

#include <functional>

struct X {
  typedef int result_type;
  int operator()() { return 0; }
  int operator()() const { return 1; }
};

const auto b = std::bind(X());

b(); // b is const, so must return 1


-- 
           Summary: std::bind doesn't work for simple class types
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paolo dot carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42761



More information about the Gcc-bugs mailing list