re PR c++/70265 (ICE on code with constexpr on x86_64-linux-gnu in tree check: expect...
authorPaolo Carlini <paolo.carlini@oracle.com>
Sun, 21 May 2017 22:20:05 +0000 (22:20 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sun, 21 May 2017 22:20:05 +0000 (22:20 +0000)
2017-05-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/70265
* g++.dg/cpp1y/constexpr-70265-1.C: New.
* g++.dg/cpp1y/constexpr-70265-2.C: Likewise.

From-SVN: r248313

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C [new file with mode: 0644]

index fb4b1bd2db07705ec09fa4e18abd68001f6c32ad..0ae3270e1c04b2611325e5bfbf69a268ca0be6a7 100644 (file)
@@ -1,3 +1,9 @@
+2017-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/70265
+       * g++.dg/cpp1y/constexpr-70265-1.C: New.
+       * g++.dg/cpp1y/constexpr-70265-2.C: Likewise.
+
 2017-05-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/80333
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C
new file mode 100644 (file)
index 0000000..e0fcdfe
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/70265
+// { dg-do compile { target c++14 } }
+
+constexpr int
+foo (int p)
+{
+  int t = 0;
+  while (1)  // { dg-error "count exceeds" }
+    ;
+  return t;
+}
+
+static_assert (foo (1) == 0, "");  // { dg-error "non-constant" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C
new file mode 100644 (file)
index 0000000..fc360f1
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/70265
+// { dg-do compile { target c++14 } }
+
+constexpr int
+foo (int p)
+{
+  int t = 0;
+  while (1)
+    t = 0;  // { dg-error "count exceeds" }
+  return t;
+}
+
+static_assert (foo (1) == 0, "");  // { dg-error "non-constant" }