------------------8<------------------ #include <functional>
int fn(long, float) { return 0; } int main(int argc, char *argv[]) { typedef std::result_of<decltype(fn)>::type type; return 0; } ------------------8<------------------ $ g++ -std=c++0x testcase.cpp In file included from /opt/gcc-4.4.0-trunk/lib/gcc/i686-pc-cygwin/4.4.0/include/ c++/functional:75, from testcase.cpp:2: /opt/gcc-4.4.0-trunk/lib/gcc/i686-pc-cygwin/4.4.0/include/c++/tr1_impl/functiona l: In instantiation of 'std::_Result_of_impl<false, int ()(long int, float)>': /opt/gcc-4.4.0-trunk/lib/gcc/i686-pc-cygwin/4.4.0/include/c++/tr1_impl/functiona l:154: instantiated from 'std::result_of<int ()(long int, float)>' testcase.cpp:13: instantiated from here /opt/gcc-4.4.0-trunk/lib/gcc/i686-pc-cygwin/4.4.0/include/c++/tr1_impl/functiona l:200: error: 'int' is not a class, struct, or union type gcc used is: $ gcc -v Using built-in specs. Target: i686-pc-cygwin Configured with: ../configure --prefix=/opt/gcc-4.4.0-trunk -v --enable-bootstra p --enable-version-specific-runtime-libs --enable-static --enable-shared --enabl e-shared-libgcc --with-gnu-ld --with-gnu-as --enable-sjlj-exceptions --enable-la nguages=c,c++ --disable-symvers --enable-libjava --disable-nls --with-cpu-32=cor e2 --with-cpu-64=core2 --enable-threads=posix Thread model: posix gcc version 4.4.0 20090309 (experimental) (GCC) -- Summary: std::result_of doesn't work Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: piotr dot wyderski at gmail dot com GCC host triplet: WinXP/x86/Cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39676