From 4e55d61a1ba6d868e3ea537868ce2b8c81e1043a Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 27 Mar 2015 17:21:32 +0000 Subject: [PATCH] re PR c++/59329 (Using `assert(...)` is not allowed in constexpr functions) 2015-03-27 Paolo Carlini PR c++/59329 * g++.dg/cpp1y/constexpr-assert1.C: New. From-SVN: r221740 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1y/constexpr-assert1.C | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/constexpr-assert1.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a5863094050..3409c964175 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-27 Paolo Carlini + + PR c++/59329 + * g++.dg/cpp1y/constexpr-assert1.C: New. + 2015-03-27 Marek Polacek 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 index 00000000000..df2a31539ff --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-assert1.C @@ -0,0 +1,10 @@ +// PR c++/59329 +// { dg-do compile { target c++14 } } + +#include + +inline constexpr int exampleFunction(int min, int max) +{ + assert(min <= max); + return min + max; +} -- 2.30.2