From: Marek Polacek Date: Sat, 11 Apr 2020 14:45:33 +0000 (-0400) Subject: c++: Add test for PR 86327. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ded16a7782fd3a9e7b37291d04bca596b00b8bd;p=gcc.git c++: Add test for PR 86327. Fixed by r264171. PR c++/86327 * g++.dg/cpp1y/constexpr-return5.C: New test. --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fa09a7d2877..460e6bd43d8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-04-11 Marek Polacek + + PR c++/86327 + * g++.dg/cpp1y/constexpr-return5.C: New test. + 2020-04-11 Uroš Bizjak PR target/94494 diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-return5.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-return5.C new file mode 100644 index 00000000000..e8de5ed671e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-return5.C @@ -0,0 +1,12 @@ +// PR c++/86327 +// { dg-do compile { target c++14 } } + +int global = 0; + +constexpr int +f (bool arg) +{ + if (arg) + return 1; + return global++; +}