aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-06-22 13:24:25 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-06-22 13:24:25 -0400
commite8a3c59754d169057b2ec4867c109528b8be05cc (patch)
tree8df863833876a602eb39478998f15509b7a90c9d
parent5a5fd9515438888931ed1c3b925e0f6bfc7627b5 (diff)
downloadgcc-e8a3c59754d169057b2ec4867c109528b8be05cc.zip
gcc-e8a3c59754d169057b2ec4867c109528b8be05cc.tar.gz
gcc-e8a3c59754d169057b2ec4867c109528b8be05cc.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7b3cd2c..9f4e8b2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index ba5da4c..a6c313a 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)