re PR c++/89419 (ICE in is_normal_capture_proxy starting with r253601)
authorMarek Polacek <polacek@redhat.com>
Sat, 23 Feb 2019 14:54:23 +0000 (14:54 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Sat, 23 Feb 2019 14:54:23 +0000 (14:54 +0000)
PR c++/89419
* g++.dg/cpp1y/lambda-generic-89419.C: New test.

From-SVN: r269159

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C [new file with mode: 0644]

index da4aa85aa412758a526ef6aea128b31cf283a35a..3cd5d935edf2fe682d1ae22a165aca3fb568ff7c 100644 (file)
@@ -4,6 +4,9 @@
        * g++.dg/cpp0x/noexcept34.C: New test.
        * g++.dg/cpp0x/noexcept35.C: New test.
 
+       PR c++/89419
+       * g++.dg/cpp1y/lambda-generic-89419.C: New test.
+
 2019-02-23  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/88117
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C
new file mode 100644 (file)
index 0000000..46ce909
--- /dev/null
@@ -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; };
+}