Patchwork C++ PATCH for c++/46645 (libstdc++ testsuite failure)

login
register
mail settings
Submitter Jason Merrill
Date Dec. 3, 2010, 4:19 p.m.
Message ID <4CF91888.4020301@redhat.com>
Download mbox | patch
Permalink /patch/74161/
State New
Headers show

Comments

Jason Merrill - Dec. 3, 2010, 4:19 p.m.
The asserts in build_data_member_initialization were too strict; we can 
see an initialization of an empty base in a copy constructor, too.

Tested x86_64-pc-linux-gnu, applied to trunk.
commit 70d4870d0fd8c4bc580915f16f1e94641e346a3f
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Dec 1 17:43:49 2010 -0500

    	* semantics.c (build_data_member_initialization): Remove assert.

Patch

diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 9b565da..2424e49 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5484,10 +5484,8 @@  build_data_member_initialization (tree t, VEC(constructor_elt,gc) **vec)
       init = unshare_expr (TREE_OPERAND (t, 1));
       if (TREE_CODE (member) == INDIRECT_REF)
 	{
-	  /* Don't put out anything for value-init of an empty base.  */
+	  /* Don't put out anything for an empty base.  */
 	  gcc_assert (is_empty_class (TREE_TYPE (member)));
-	  gcc_assert (TREE_CODE (init) == CONSTRUCTOR
-		      && CONSTRUCTOR_NELTS (init) == 0);
 	  return true;
 	}
     }