Commit 6a026035 by Paolo Carlini Committed by Paolo Carlini

re PR c++/53307 (internal crash with variadic templates and decltype)

2012-10-10  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/53307
	* g++.dg/cpp0x/decltype44.C: New.

From-SVN: r192279
parent b3618b71
2012-10-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53307
* g++.dg/cpp0x/decltype44.C: New.
2012-10-09 Steve Ellcey <sellcey@mips.com>
* gcc.target/ext_ins.c: Modify f2 to aviod uninitialized data.
......
// PR c++/53307
// { dg-do compile { target c++11 } }
template <class...Ts> struct tuple{};
struct funct
{
template <class T, class...argTs>
T operator()(T arg1, argTs...)
{
return arg1;
}
};
template <class...>class test;
template < template <class...> class tp,
class...arg1Ts,
class...arg2Ts>
class test<tp<arg1Ts...>, tp<arg2Ts...>>
{
public:
template <class func>
auto test_pass(func fun, arg2Ts...arg2s)
-> decltype(fun(arg2s...))
{
return fun(arg2s...);
}
template <class func, class...arg3Ts>
auto testbug(func fun, arg2Ts...arg2s, arg3Ts...arg3s)
-> decltype(fun(arg2s..., arg3s...))
{
return fun(arg2s..., arg3s...);
}
};
int main()
{
test<tuple<>, tuple<char, int>> t;
t.test_pass (funct(), 'a', 2);
t.testbug (funct(), 'a', 2, "fine");
t.testbug (funct(), 'a', 2);
}
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