PR c++/77786
* g++.dg/cpp1y/pr77786.C: New test.
From-SVN: r253614
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.
--- /dev/null
+// 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);
+}