aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2018-09-21 18:45:59 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2018-09-21 18:45:59 +0000
commit382955736eca482bfebe5eecdc2eb6ac5f9f0d72 (patch)
treea95f55fc8c34da8c13203cd8494c4c6f4bedce25 /gcc/cp
parentedaaef601d0d6d263fba87b42d6d04c99dd23dba (diff)
downloadgcc-382955736eca482bfebe5eecdc2eb6ac5f9f0d72.zip
gcc-382955736eca482bfebe5eecdc2eb6ac5f9f0d72.tar.gz
gcc-382955736eca482bfebe5eecdc2eb6ac5f9f0d72.tar.bz2
PR c++/87372 - __func__ constexpr evaluation.
* constexpr.c (maybe_constant_init_1): Pass false for strict down to cxx_eval_outermost_constant_expr. * g++.dg/cpp1y/func_constexpr2.C: New test. From-SVN: r264489
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/constexpr.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b75d0c7..079d1cb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-21 Marek Polacek <polacek@redhat.com>
+
+ PR c++/87372 - __func__ constexpr evaluation.
+ * constexpr.c (maybe_constant_init_1): Pass false for strict down to
+ cxx_eval_outermost_constant_expr.
+
2018-09-20 Marek Polacek <polacek@redhat.com>
PR c++/87109 - wrong ctor with maybe-rvalue semantics.
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index b481474..08d00e8 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -5364,7 +5364,7 @@ maybe_constant_init_1 (tree t, tree decl, bool allow_non_constant,
/* No evaluation needed. */;
else
t = cxx_eval_outermost_constant_expr (t, allow_non_constant,
- !allow_non_constant,
+ /*strict*/false,
pretend_const_required, decl);
if (TREE_CODE (t) == TARGET_EXPR)
{