re PR c++/80194 (ICE with local constant referenced by a lambda expression)
authorJakub Jelinek <jakub@redhat.com>
Wed, 11 Oct 2017 20:49:46 +0000 (22:49 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 11 Oct 2017 20:49:46 +0000 (22:49 +0200)
PR c++/80194
* g++.dg/cpp1y/pr80194.C: New test.

From-SVN: r253658

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

index 71647a87b7a909edebfb5ab3e7c7f24d5b5bbf8e..558d19c2150fd9c1464672307a164ef2e78c8e0b 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/80194
+       * g++.dg/cpp1y/pr80194.C: New test.
+
 2017-10-11  Qing Zhao  <qing.zhao@oracle.com>
 
        PR target/81422
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr80194.C b/gcc/testsuite/g++.dg/cpp1y/pr80194.C
new file mode 100644 (file)
index 0000000..2a892c3
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/80194
+// { dg-do compile { target c++14 } }
+
+int fn1 ();
+
+template <class Fn>
+void
+fn2 (Fn &&fn)
+{
+  fn (42);
+}
+
+void fn2 ()
+{
+  auto const x = fn1 ();
+  fn2 ([&](auto) { x; });
+}