From 183e9006cc0300257d6f74d573514ef86f78cb4e Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 22 Apr 2020 18:05:18 +0200 Subject: [PATCH] Add testcase of PR c++/90448, already fixed in trunk. PR c++/90448 * g++.dg/cpp1y/lambda-generic-variadic20.C: New. --- gcc/testsuite/ChangeLog | 5 +++++ .../g++.dg/cpp1y/lambda-generic-variadic20.C | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic20.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e60da71c99c..f6dd7ac6777 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-04-22 Paolo Carlini + + PR c++/90448 + * g++.dg/cpp1y/lambda-generic-variadic20.C: New. + 2020-04-22 Martin Sebor PR middle-end/94647 diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic20.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic20.C new file mode 100644 index 00000000000..3af971bbf12 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic20.C @@ -0,0 +1,16 @@ +// PR c++/90448 +// { dg-do compile { target c++14 } } + +template int fooV(Ts ... ts) { + auto L = [](auto ... a) { + auto M = [](decltype(a) ... b) -> void { + }; + return M; + }; + + decltype(L(L, ts...)) (*fp)(decltype(L), decltype(ts) ...) = L; + + return 0; +} + +int run2 = fooV("BC", 3, 2.77, 'A', float{}, short{}, unsigned{}); -- 2.30.2