re PR c++/81032 (ICE with lambda and broken constexpr)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 10 Oct 2017 20:16:40 +0000 (20:16 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 10 Oct 2017 20:16:40 +0000 (20:16 +0000)
2017-10-10  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/81032
* g++.dg/cpp1y/lambda-generic-ice6.C: New.

From-SVN: r253619

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice6.C [new file with mode: 0644]

index 0eadf82a31d3427c3cd091d6c5af21909ed48256..14c2a5ad907e2bb36fbdd29bd0eb053bfcec556c 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-10  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/81032
+       * g++.dg/cpp1y/lambda-generic-ice6.C: New.
+
 2017-10-10  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/68205
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice6.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice6.C
new file mode 100644 (file)
index 0000000..6851afc
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/81032
+// { dg-do compile { target c++14 } }
+
+template<typename T> constexpr void foo(T t)
+{
+  constexpr int i = t;  // { dg-error "constant" }
+  [=](auto){ return i; }(0);
+}
+
+void bar()
+{
+  foo(0);
+}