Commit ae3f9c32 by Paolo Carlini Committed by Paolo Carlini

re PR c++/65949 (Compiler can not deduce auto type in lambda)

2017-09-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/65949
	* g++.dg/cpp1y/lambda-generic-variadic5.C: New.

From-SVN: r253322
parent 333cb612
2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/65949
* g++.dg/cpp1y/lambda-generic-variadic5.C: New.
2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/68754
* g++.dg/cpp1y/constexpr-68754.C: Move...
* g++.dg/cpp0x/constexpr-68754.C: ... here, adjust.
......
// PR c++/65949
// { dg-do compile { target c++14 } }
#include <initializer_list>
template<class T, class... Ts>
struct Over : T, Over<Ts...>::type
{
using type = Over;
Over(T f1, Ts... f2)
: T(f1), Over<Ts...>::type(f2...)
{
}
using T::operator();
using Over<Ts...>::type::operator();
};
template<class T>
struct Over<T> : T
{
using type = T;
using T::operator();
};
template <class... Lambdas>
auto CreateLambdas(Lambdas... lambdas)
{
return Over<Lambdas...>(lambdas...);
}
int main()
{
auto mesLambda = CreateLambdas
(
[]()
{
},
[](auto i)
{
(void)i;
},
[](auto... args)
{
auto list = {args...};
for(auto &&a : list)
(void)a;
return 3;
}
);
mesLambda();
mesLambda(1);
mesLambda(12,24,36,48);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment