From 950e6107f0241343dec402a6c80f3a28db6a6242 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 20 Sep 2013 21:04:09 +0000 Subject: [PATCH] re PR c++/58481 (Internal compiler error when passing argument packs to base class method inside a lambda) /cp 2013-09-20 Paolo Carlini PR c++/58481 * pt.c (tsubst_copy): Use current_nonlambda_class_type to call tsubst_baselink. /testsuite 2013-09-20 Paolo Carlini PR c++/58481 * g++.dg/cpp0x/lambda/lambda-this17.C: New. From-SVN: r202797 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ .../g++.dg/cpp0x/lambda/lambda-this17.C | 21 +++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this17.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5ee1f9173b0..a542ab1ffa3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-09-20 Paolo Carlini + + PR c++/58481 + * pt.c (tsubst_copy): Use current_nonlambda_class_type to + call tsubst_baselink. + 2013-09-18 Paolo Carlini PR c++/58457 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index e0b71108fcf..b330b78cbc8 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -12434,7 +12434,8 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) return t; case BASELINK: - return tsubst_baselink (t, current_class_type, args, complain, in_decl); + return tsubst_baselink (t, current_nonlambda_class_type (), + args, complain, in_decl); case TEMPLATE_DECL: if (DECL_TEMPLATE_TEMPLATE_PARM_P (t)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cef626ab314..2fc781a3e37 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-09-20 Paolo Carlini + + PR c++/58481 + * g++.dg/cpp0x/lambda/lambda-this17.C: New. + 2013-09-20 Jan-Benedict Glaw PR target/56875 diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this17.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this17.C new file mode 100644 index 00000000000..2386e6b1eb8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this17.C @@ -0,0 +1,21 @@ +// PR c++/58481 +// { dg-require-effective-target c++11 } + +struct Test { + template inline void triggerTest (Args&&... fargs) { } +}; + +struct TestPickled : Test { + template void triggerTest (Args&&... fargs) { + [=](Args... as) { + Test::triggerTest (as...); + } (); + } +}; + +int main() +{ + TestPickled test; + test.triggerTest (); + return 0; +}