Commit 34f42d7b by Jason Merrill Committed by Jason Merrill

DR 1467 PR c++/51747

	DR 1467
	PR c++/51747
	* typeck2.c (digest_init_r): Replace previous change with
	gcc_unreachable.

From-SVN: r224289
parent 86b76c20
2015-06-09 Jason Merrill <jason@redhat.com>
DR 1467
PR c++/51747
* typeck2.c (digest_init_r): Replace previous change with
gcc_unreachable.
PR c++/66387
* semantics.c (process_outer_var_ref): Make sure the value is
actually constant before returning it.
......
......@@ -1089,6 +1089,7 @@ digest_init_r (tree type, tree init, bool nested, int flags,
|| TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == COMPLEX_TYPE);
#ifdef ENABLE_CHECKING
/* "If T is a class type and the initializer list has a single
element of type cv U, where U is T or a class derived from T,
the object is initialized from that element." */
......@@ -1099,8 +1100,10 @@ digest_init_r (tree type, tree init, bool nested, int flags,
{
tree elt = CONSTRUCTOR_ELT (init, 0)->value;
if (reference_related_p (type, TREE_TYPE (elt)))
init = elt;
/* We should have fixed this in reshape_init. */
gcc_unreachable ();
}
#endif
if (BRACE_ENCLOSED_INITIALIZER_P (init)
&& !TYPE_NON_AGGREGATE_CLASS (type))
......
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