diff options
author | Marek Polacek <polacek@redhat.com> | 2018-01-19 20:52:21 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2018-01-19 20:52:21 +0000 |
commit | dba99244eaddee9153c1ae605861014f55a30f70 (patch) | |
tree | 6c6c9c788af3843f914c09eed4783bcedeb0a7ae /gcc | |
parent | 2af6483634c6f369731a6de07631921a570ff178 (diff) | |
download | gcc-dba99244eaddee9153c1ae605861014f55a30f70.zip gcc-dba99244eaddee9153c1ae605861014f55a30f70.tar.gz gcc-dba99244eaddee9153c1ae605861014f55a30f70.tar.bz2 |
* constexpr.c (fold_simple): Simplify.
From-SVN: r256899
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d23bfc4..3e40d79 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2018-01-19 Marek Polacek <polacek@redhat.com> + + * constexpr.c (fold_simple): Simplify. + 2018-01-18 Jason Merrill <jason@redhat.com> PR c++/83714 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 9a548d2..ca7f369 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. |