aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-04-04 20:09:10 -0400
committerJason Merrill <jason@gcc.gnu.org>2018-04-04 20:09:10 -0400
commita7ec7182dbbd85f14dd5d9f4adb5f16faed9581d (patch)
treef221fb4ea704d1fc3476ff125541a26614683dc0 /gcc/cp/call.c
parent0dd285f9a8da75fd01a36acb6b427a9afbd189ce (diff)
downloadgcc-a7ec7182dbbd85f14dd5d9f4adb5f16faed9581d.zip
gcc-a7ec7182dbbd85f14dd5d9f4adb5f16faed9581d.tar.gz
gcc-a7ec7182dbbd85f14dd5d9f4adb5f16faed9581d.tar.bz2
PR c++/84938 - ICE with division by ~-1.
* call.c (set_up_extended_ref_temp): Call cp_fully_fold. From-SVN: r259108
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index f817731..7c99e8a 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -10869,6 +10869,8 @@ set_up_extended_ref_temp (tree decl, tree expr, vec<tree, va_gc> **cleanups,
/* If the initializer is constant, put it in DECL_INITIAL so we get
static initialization and use in constant expressions. */
init = maybe_constant_init (expr);
+ /* As in store_init_value. */
+ init = cp_fully_fold (init);
if (TREE_CONSTANT (init))
{
if (literal_type_p (type) && CP_TYPE_CONST_NON_VOLATILE_P (type))