aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2020-04-11 10:45:33 -0400
committerMarek Polacek <polacek@redhat.com>2020-04-11 10:45:33 -0400
commit4ded16a7782fd3a9e7b37291d04bca596b00b8bd (patch)
tree02cb922285011696ef04d048edd46feb6bfec05d /gcc
parentf883c46b4877f637e0fa5025b4d6b5c9040ec566 (diff)
downloadgcc-4ded16a7782fd3a9e7b37291d04bca596b00b8bd.zip
gcc-4ded16a7782fd3a9e7b37291d04bca596b00b8bd.tar.gz
gcc-4ded16a7782fd3a9e7b37291d04bca596b00b8bd.tar.bz2
c++: Add test for PR 86327.
Fixed by r264171. PR c++/86327 * g++.dg/cpp1y/constexpr-return5.C: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-return5.C12
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fa09a7d..460e6bd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-11 Marek Polacek <polacek@redhat.com>
+
+ PR c++/86327
+ * g++.dg/cpp1y/constexpr-return5.C: New test.
+
2020-04-11 Uroš Bizjak <ubizjak@gmail.com>
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 0000000..e8de5ed
--- /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++;
+}