re PR c++/77786 (ICE in tsubst_copy, at cp/pt.c:13040)
authorJakub Jelinek <jakub@redhat.com>
Tue, 10 Oct 2017 20:10:25 +0000 (22:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 10 Oct 2017 20:10:25 +0000 (22:10 +0200)
PR c++/77786
* g++.dg/cpp1y/pr77786.C: New test.

From-SVN: r253614

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

index 307acde68c8c32d3b80704b957ff1fb1c7ff9acf..c306573c5e985b45f3c5cab3c3c3f2cc93539c00 100644 (file)
@@ -1,5 +1,8 @@
 2017-10-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/77786
+       * g++.dg/cpp1y/pr77786.C: New test.
+
        PR c++/71875
        * g++.dg/cpp1y/pr71875.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr77786.C b/gcc/testsuite/g++.dg/cpp1y/pr77786.C
new file mode 100644 (file)
index 0000000..e242228
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/77786
+// { dg-do compile { target c++14 } }
+
+#include <vector>
+
+template<int N>
+void
+foo (std::vector<int> a)
+{
+  auto const a_size = a.size();
+  auto bar = [&](auto y) -> void { int a_size_2 = a_size; };
+  double x = 0.0;
+  bar (x);
+}
+
+int
+main ()
+{
+  std::vector<int> a(1);
+  foo<1>(a);
+}