[Bug c++/33939] Rvalue references not deduced correctly in vararg function templates
pcarlini at suse dot de
gcc-bugzilla@gcc.gnu.org
Sun Nov 4 20:41:00 GMT 2007
------- Comment #1 from pcarlini at suse dot de 2007-11-04 20:41 -------
Gosh, this bug is horrible, the -basic- forwarding situation doesn't work with
variadic templates:
void foo(int&&);
void foo(const int&) { }
template<typename _Tp>
struct identity
{
typedef _Tp type;
};
template<typename _Tp>
inline _Tp&&
forward(typename identity<_Tp>::type&& __t)
{ return __t; }
template<typename _Args>
void
bar(_Args&& __args)
{
foo(forward<_Args>(__args));
}
template<typename... _Args>
void
barv(_Args&&... __args)
{
foo(forward<_Args>(__args)...);
}
int main()
{
int a;
bar(a);
barv(a);
}
Doug, any chance you can have a look? Many thanks in advance!
--
pcarlini at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pcarlini at suse dot de
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-11-04 20:41:13
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33939
More information about the Gcc-bugs
mailing list