This test was fixed by r269094, a fix for PR88394. Tested on x86_64-linux, applying to trunk.
2019-02-23 Marek Polacek <pola...@redhat.com> PR c++/89419 * g++.dg/cpp1y/lambda-generic-89419.C: New test. diff --git gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C new file mode 100644 index 00000000000..46ce909f3b8 --- /dev/null +++ gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C @@ -0,0 +1,24 @@ +// PR c++/89419 +// { dg-do compile { target c++14 } } + +struct A; +struct B { + struct C { C (); C (C &); } b; +}; +struct D { A operator* (); }; +struct A { + template <typename T> void foo (T x) { x (this); } +}; +struct E { + auto bar () { return e; } + D e; +}; +struct F { B f; int g; }; + +int +main () +{ + E e; + auto f = *e.bar (); + auto i = [&] { F g; g.g = 1; auto h = [&](auto) { g.g = 0; }; f.foo (h); return g; }; +}