From a5650762680ea88c789906de91ded06ee48e1e67 Mon Sep 17 00:00:00 2001
From: Marek Polacek <polacek@redhat.com>
Date: Mon, 30 Dec 2019 16:07:33 +0000
Subject: [PATCH] Remove assert in reshape_init_r.

Asserting !BRACE_ENCLOSED_INITIALIZER_P seems pretty pointless, since
that checks for init_list_type_node, and a compound literal won't have
that type, nor will we see that type if we just checked that it's
something else.

	* decl.c (reshape_init_r): Remove assert.

From-SVN: r279771
---
 gcc/cp/ChangeLog | 4 ++++
 gcc/cp/decl.c    | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9c30253f0948..a237a8ffba3f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2019-12-30  Marek Polacek  <polacek@redhat.com>
+
+	* decl.c (reshape_init_r): Remove assert.
+
 2019-12-30  Paolo Carlini  <paolo.carlini@oracle.com>
 
 	* decl2.c (delete_sanity): Add location_t parameter and use
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2760dba5be52..afe2aacf0d5f 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6408,7 +6408,6 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
 	  else if (same_type_ignoring_top_level_qualifiers_p (type, init_type))
 	    {
 	      ++d->cur;
-	      gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (stripped_init));
 	      return init;
 	    }
 	  else
-- 
GitLab