http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52851
Bug #: 52851 Summary: auto&& fails to deduce type in function template Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: delon...@fb.com // Code snippet: struct C { int var; }; template<class T> void func(C* x) { // error: invalid initialization of reference of type ‘int&&’ from expression of type ‘int’ auto&& foo = x->var; } int main() { func<int>(new C); }