re PR c++/70338 (ICE combining debug symbols, range-for in lambda in function templat...
authorJakub Jelinek <jakub@redhat.com>
Tue, 10 Oct 2017 20:10:56 +0000 (22:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 10 Oct 2017 20:10:56 +0000 (22:10 +0200)
PR c++/70338
* g++.dg/cpp0x/pr70338.C: New test.

From-SVN: r253615

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

index c306573c5e985b45f3c5cab3c3c3f2cc93539c00..43fb756f6ffcacb3797ce711e4c42c04e21ff950 100644 (file)
@@ -1,5 +1,8 @@
 2017-10-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/70338
+       * g++.dg/cpp0x/pr70338.C: New test.
+
        PR c++/77786
        * g++.dg/cpp1y/pr77786.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr70338.C b/gcc/testsuite/g++.dg/cpp0x/pr70338.C
new file mode 100644 (file)
index 0000000..156cb91
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/70338
+// { dg-do compile { target c++11 } }
+// { dg-options "-g" }
+
+template<typename T>
+void
+foo (int x)
+{
+  T a[x];
+  auto b = [&]() { for (auto &c: a) c = 0.; };
+}
+
+int
+main ()
+{
+  foo<double> (3);
+}