http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46497
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2010.11.16 15:13:01 Ever Confirmed|0 |1 --- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2010-11-16 15:13:01 UTC --- Reduced: template<class T> struct A { T first; A(const A&) = default; A(A&&) = default; template<class _U1> A(A<_U1>&&); }; struct move_only { move_only(move_only&&) = default; }; A<move_only>&& f(); void g(A<const move_only>); template<typename T> static decltype(g(f())) h(); int main() { g(f()); h<int>(); } There seems to be a problem with non-dependent types in templates; the plain call to g(f()) works fine, but the call in the decltype fails.