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
OK, I'll revert it all tomorrow if necessary
Thanks Jason! If we manage to solve this tough problem, then I know how to enable also the volatile / const volatile call operators + other improvements bringing us real close to the WP.
Subject: Bug 42761 Author: jason Date: Sat Jan 16 15:23:19 2010 New Revision: 155966 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155966 Log: PR c++/42761 * semantics.c (finish_decltype_type): Within a template, treat unresolved CALL_EXPR as dependent. Added: trunk/gcc/testsuite/g++.dg/cpp0x/decltype22.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/semantics.c trunk/gcc/testsuite/ChangeLog
Fixed.
Thanks, Jason! Paolo, what's the trick I missed to make the volatile overloads work?