From patchwork Tue Oct 9 23:39:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [C++,testcase] PR 53307 Date: Tue, 09 Oct 2012 13:39:04 -0000 From: Paolo Carlini X-Patchwork-Id: 190513 Message-Id: <5074B598.3090801@oracle.com> To: "gcc-patches@gcc.gnu.org" Hi, I'm adding the testcase and closing the PR as fixed. Tested x86_64-linux. Thanks, Paolo. ////////////////////// 2012-10-10 Paolo Carlini PR c++/53307 * g++.dg/cpp0x/decltype44.C: New. Index: g++.dg/cpp0x/decltype44.C =================================================================== --- g++.dg/cpp0x/decltype44.C (revision 0) +++ g++.dg/cpp0x/decltype44.C (working copy) @@ -0,0 +1,44 @@ +// PR c++/53307 +// { dg-do compile { target c++11 } } + +template struct tuple{}; + +struct funct +{ + template + T operator()(T arg1, argTs...) + { + return arg1; + } +}; + +template class test; + +template < template class tp, + class...arg1Ts, + class...arg2Ts> +class test, tp> +{ + public: + template + auto test_pass(func fun, arg2Ts...arg2s) + -> decltype(fun(arg2s...)) + { + return fun(arg2s...); + } + + template + auto testbug(func fun, arg2Ts...arg2s, arg3Ts...arg3s) + -> decltype(fun(arg2s..., arg3s...)) + { + return fun(arg2s..., arg3s...); + } +}; + +int main() +{ + test, tuple> t; + t.test_pass (funct(), 'a', 2); + t.testbug (funct(), 'a', 2, "fine"); + t.testbug (funct(), 'a', 2); +}