This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

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;
 	}
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]