This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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=44380


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]