re PR c++/78523 (ICE on valid lambda code with implicit capture)
authorJakub Jelinek <jakub@redhat.com>
Wed, 11 Oct 2017 20:50:07 +0000 (22:50 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 11 Oct 2017 20:50:07 +0000 (22:50 +0200)
PR c++/78523
* g++.dg/cpp1y/pr78523.C: New test.

From-SVN: r253659

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/pr78523.C [new file with mode: 0644]

index 558d19c2150fd9c1464672307a164ef2e78c8e0b..4d08108323d31e47b848eb84d7ce679a7661b215 100644 (file)
@@ -1,5 +1,8 @@
 2017-10-11  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/78523
+       * g++.dg/cpp1y/pr78523.C: New test.
+
        PR c++/80194
        * g++.dg/cpp1y/pr80194.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr78523.C b/gcc/testsuite/g++.dg/cpp1y/pr78523.C
new file mode 100644 (file)
index 0000000..31e0cc8
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/78523
+// { dg-do compile { target c++14 } }
+
+int bar ();
+
+void
+foo ()
+{
+  const int t = bar ();
+  auto f = [=] (auto x) { return t; };
+  f (0);
+}