re PR c++/66515 (g++ segfaults when creating an std::initializer_list)

PR c++/66515
	* call.c (implicit_conversion): Only reshape for classes.

From-SVN: r224748
This commit is contained in:
Jason Merrill 2015-06-22 13:24:25 -04:00 committed by Jason Merrill
parent 5a5fd95154
commit e8a3c59754
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2015-06-22 Jason Merrill <jason@redhat.com>
PR c++/66515
* call.c (implicit_conversion): Only reshape for classes.
2015-06-22 Mikhail Maltsev <maltsevm@gmail.com>
* pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of

View File

@ -1759,8 +1759,9 @@ implicit_conversion (tree to, tree from, tree expr, bool c_cast_p,
/* Call reshape_init early to remove redundant braces. */
if (expr && BRACE_ENCLOSED_INITIALIZER_P (expr)
&& CLASS_TYPE_P (to)
&& COMPLETE_TYPE_P (complete_type (to))
&& CP_AGGREGATE_TYPE_P (to))
&& !CLASSTYPE_NON_AGGREGATE (to))
{
expr = reshape_init (to, expr, complain);
if (expr == error_mark_node)