From: Paolo Carlini Date: Fri, 27 Mar 2015 17:21:32 +0000 (+0000) Subject: re PR c++/59329 (Using `assert(...)` is not allowed in constexpr functions) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e55d61a1ba6d868e3ea537868ce2b8c81e1043a;p=gcc.git 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 --- 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; +}