http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49058
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2011.05.19 15:43:41 AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-19 15:43:41 UTC --- This has nothing to do with variadics; the same error occurs with template<typename T> T val(); struct F1 { void operator()(); }; template<typename F> struct Bind { template<typename R = decltype( val<F>()( ) )> R f(); template<typename R = decltype( val<const F>()( ) )> R f() const; }; int main() { Bind<F1>().f(); } The problem is that F1::operator() is non-const, so when we instantiate Bind<F1>, val<const F>() is ill-formed. And this error is not dependent on EDG also rejects this testcase. The bug is that we silently accept it without -pedantic; we should be giving a pedwarn.