diff mbox series

C++ PATCH to add test for c++/89419

Message ID 20190223145941.GL20014@redhat.com
State New
Headers show
Series C++ PATCH to add test for c++/89419 | expand

Commit Message

Marek Polacek Feb. 23, 2019, 2:59 p.m. UTC
This test was fixed by r269094, a fix for PR88394.

Tested on x86_64-linux, applying to trunk.

2019-02-23  Marek Polacek  <polacek@redhat.com>

	PR c++/89419
	* g++.dg/cpp1y/lambda-generic-89419.C: New test.
diff mbox series

Patch

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; };
+}