[Bug c++/44389] New: [C++0x]: result_of broken for functor references.

avenikov at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jun 2 15:29:00 GMT 2010


The FCD (n3092) states in 20.7.6.6 (Table # 53), that result_of should work
with references to functors as well. Current implementation of result_of will
only work with functor types, not with references to functor types.

The following will produce incorrect results:

#include <functional>

struct F
{
  typedef int result_type;
  int operator() ();
};

std::result_of<F&()>::type N1; //Will fail but shouldn't
std::result_of<F()>::type N2; //Works as expected


Build with the following compile arguments (where test.cpp is the code above):

g++ --std=c++0x -g -O2 -Wall -Wno-long-long --pedantic test.cpp 

Andy.


-- 
           Summary: [C++0x]: result_of broken for functor references.
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: avenikov at gmail dot com
  GCC host triplet: x86-64, Linux 2.6.18 (Suse 11.0), gcc 4.3.3
GCC target triplet: x86-64, Linux 2.6.18 (Suse 11.0), gcc 4.3.3


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



More information about the Gcc-bugs mailing list