This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52851] auto&& fails to deduce type in function template


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52851

--- Comment #2 from Jordan DeLong <delong.j at fb dot com> 2012-04-03 19:07:21 UTC ---
In that case it would be a bug that it works outside of a template, no?

But I don't think this is actually supposed to declare an rvalue reference. 
The && on an auto works more like it does in template argument deduction, and
should collapse into an lvalue reference here.  (I'm failing to find
chapter/verse about this at the moment, but if you look at the definition of
range-based for in 6.5.4 it's using auto&& in this way.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]