re PR c++/59329 (Using `assert(...)` is not allowed in constexpr functions)
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 27 Mar 2015 17:21:32 +0000 (17:21 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 27 Mar 2015 17:21:32 +0000 (17:21 +0000)
2015-03-27  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/59329
* g++.dg/cpp1y/constexpr-assert1.C: New.

From-SVN: r221740

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

index a5863094050ba556632154fdc1cce66af61648c6..3409c9641756324c2619482dae10949a0ff1c72d 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/59329
+       * g++.dg/cpp1y/constexpr-assert1.C: New.
+
 2015-03-27  Marek Polacek  <polacek@redhat.com>
 
        PR c++/65556
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-assert1.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-assert1.C
new file mode 100644 (file)
index 0000000..df2a315
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/59329
+// { dg-do compile { target c++14 } }
+
+#include <cassert>
+
+inline constexpr int exampleFunction(int min, int max)
+{
+  assert(min <= max);
+  return min + max;
+}