Commit a7ec7182 by Jason Merrill Committed by Jason Merrill

PR c++/84938 - ICE with division by ~-1.

	* call.c (set_up_extended_ref_temp): Call cp_fully_fold.

From-SVN: r259108
parent 0dd285f9
2018-04-04 Jason Merrill <jason@redhat.com>
PR c++/84938 - ICE with division by ~-1.
* call.c (set_up_extended_ref_temp): Call cp_fully_fold.
PR c++/84936 - ICE with unexpanded pack in mem-initializer.
* parser.c (cp_parser_mem_initializer_list): Call
check_for_bare_parameter_packs.
......
......@@ -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))
......
// PR c++/84938
const int &a = 1 / ~-1; // { dg-warning "division by zero" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment