From dba99244eaddee9153c1ae605861014f55a30f70 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 19 Jan 2018 20:52:21 +0000 Subject: [PATCH] * constexpr.c (fold_simple): Simplify. From-SVN: r256899 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/constexpr.c | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d23bfc433a5..3e40d79e952 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2018-01-19 Marek Polacek + + * constexpr.c (fold_simple): Simplify. + 2018-01-18 Jason Merrill PR c++/83714 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 9a548d29bbc..ca7f369f7e9 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -4931,22 +4931,21 @@ fold_simple_1 (tree t) } /* If T is a simple constant expression, returns its simplified value. - Otherwise returns T. In contrast to maybe_constant_value do we + Otherwise returns T. In contrast to maybe_constant_value we simplify only few operations on constant-expressions, and we don't try to simplify constexpressions. */ tree fold_simple (tree t) { - tree r = NULL_TREE; if (processing_template_decl) return t; - r = fold_simple_1 (t); - if (!r) - r = t; + tree r = fold_simple_1 (t); + if (r) + return r; - return r; + return t; } /* If T is a constant expression, returns its reduced value. -- 2.30.2