From: Jason Merrill Date: Mon, 22 Jun 2015 17:24:25 +0000 (-0400) Subject: re PR c++/66515 (g++ segfaults when creating an std::initializer_list) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e8a3c59754d169057b2ec4867c109528b8be05cc;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7b3cd2ce720..9f4e8b21e3d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-06-22 Jason Merrill + + PR c++/66515 + * call.c (implicit_conversion): Only reshape for classes. + 2015-06-22 Mikhail Maltsev * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of diff --git a/gcc/cp/call.c b/gcc/cp/call.c index ba5da4c36da..a6c313aed59 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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)