From: Marek Polacek Date: Wed, 2 Jan 2019 17:07:02 +0000 (+0000) Subject: re PR c++/86875 (ICE in tsubst_copy, at cp/pt.c:15478) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=905969f941d0428665ab2ff1c0826f60b5e41073;p=gcc.git re PR c++/86875 (ICE in tsubst_copy, at cp/pt.c:15478) PR c++/86875 * g++.dg/cpp1y/lambda-generic-86875.C: New test. From-SVN: r267519 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 782b3d26c19..23691cd282d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-01-02 Marek Polacek + + PR c++/86875 + * g++.dg/cpp1y/lambda-generic-86875.C: New test. + 2019-01-02 Thomas Koenig PR fortran/48543 diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-86875.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-86875.C new file mode 100644 index 00000000000..3a81b00df96 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-86875.C @@ -0,0 +1,21 @@ +// PR c++/86875 +// { dg-do compile { target c++14 } } + +template using decay_t = _Tp; +template class A { + Fun fun_; + +public: + template A(T p1) : fun_(p1) {} + auto operator()() { fun_(this); } +}; + +template auto y_combinator(Fun p1) { return A>(p1); } + +int +main() +{ + const unsigned int w = 1; + auto foo = y_combinator([=](auto) { auto i = +w; }); + foo(); +}