Given: int && f (); template <typename> struct incomplete; incomplete<decltype(f())> i;
GCC says (when invoked with -std=c++0x): "'incomplete<int> i' has incomplete type" However, the latest standard draft (n2369) states in section 7.1.6.2 paragraph 4: "if e is a function call [...], decltype(e) is the return type of that function". So the error should've been: 'incomplete<int &&> i' has incomplete type. -- Summary: [c++0x] Incorrect decltype result for function calls. Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gcc-bugzilla at contacts dot eelis dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33045