re PR c++/84518 (ICE with lambda capturing broken variable)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 7 Mar 2019 20:49:42 +0000 (20:49 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 7 Mar 2019 20:49:42 +0000 (20:49 +0000)
2019-03-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84518
* g++.dg/cpp0x/lambda/lambda-ice30.C: New.
* g++.dg/cpp0x/lambda/lambda-ice31.C: Likewise.

From-SVN: r269469

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C [new file with mode: 0644]

index e2b22ba5436ed569af5972b9a4404eb849a64fb4..0a90257aa56f1ee7e8ba80b6b86a73acf6a66108 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84518
+       * g++.dg/cpp0x/lambda/lambda-ice30.C: New.
+       * g++.dg/cpp0x/lambda/lambda-ice31.C: Likewise.
+
 2019-03-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR translation/79999
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C
new file mode 100644 (file)
index 0000000..46350bd
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/84518
+// { dg-do compile { target c++11 } }
+
+template<int> void foo()
+{
+  int x[=];  // { dg-error "expected" }
+  [&x]{};
+}
+
+void bar()
+{
+  foo<0>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C
new file mode 100644 (file)
index 0000000..54ded7b
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/84518
+// { dg-do compile { target c++11 } }
+
+template<typename T> void foo()
+{
+  T x[=];  // { dg-error "expected" }
+  [&x]{};
+}