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

            Bug ID: 57336
           Summary: [4.8/4.9 Regression] Cannot INVOKE a reference_wrapper
                    around an abstract type
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: redi at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

This C++11 example no longer compiles:


#include <functional>

struct ABC
{
    virtual bool operator()() const = 0;
};

struct Concrete : ABC
{
    virtual bool operator()() const { return true; }
};

Concrete c;
ABC& abc = c;

auto b = std::cref(abc)();



I think we're just missing an rvalue-ref on the function argument and in the
result_of argument in the first overload of __invoke, which is also necessary
to get the right answer when invoking function objects with ref-qualified
function call operators (something I plan to finish support for asap)

Reply via email to