Patchwork C++ PATCH for c++/54325 (wrong error initializing abstract base class)

login
register
mail settings
Submitter Paolo Carlini
Date Dec. 7, 2012, 10:10 a.m.
Message ID <50C1C082.4020601@oracle.com>
Download mbox | patch
Permalink /patch/204443/
State New
Headers show

Comments

Paolo Carlini - Dec. 7, 2012, 10:10 a.m.
Hi,

On 12/07/2012 10:24 AM, Matthias Klose wrote:
> committed.
>
>    Matthias
>
> 2012-12-07  Matthias Klose  <doko@ubuntu.com>
>
>          * tree.c (build_aggr_init_expr): Add parameter name, mark as unused.
Thanks.

I was wondering if in mainline we could just do the below. It seems 
straightforward enough...

Thanks!
Paolo.

///////////////////////
2012-12-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* tree.c (build_aggr_init_expr): Remove tsubst_flags_t parameter.
	(build_cplus_new): Adjust.
	* cp-tree.h: Adjust declaration.
	* init.c (build_value_init): Adjust.
Jason Merrill - Dec. 7, 2012, 2:40 p.m.
OK.

Jason

Patch

Index: cp-tree.h
===================================================================
--- cp-tree.h	(revision 194296)
+++ cp-tree.h	(working copy)
@@ -5762,7 +5762,7 @@  extern tree build_min_nt_loc			(location_t, enum t
 extern tree build_min_non_dep			(enum tree_code, tree, ...);
 extern tree build_min_non_dep_call_vec		(tree, tree, vec<tree, va_gc> *);
 extern tree build_cplus_new			(tree, tree, tsubst_flags_t);
-extern tree build_aggr_init_expr		(tree, tree, tsubst_flags_t);
+extern tree build_aggr_init_expr		(tree, tree);
 extern tree get_target_expr			(tree);
 extern tree get_target_expr_sfinae		(tree, tsubst_flags_t);
 extern tree build_cplus_array_type		(tree, tree);
Index: init.c
===================================================================
--- init.c	(revision 194296)
+++ init.c	(working copy)
@@ -350,8 +350,7 @@  build_value_init (tree type, tsubst_flags_t compla
 	  (type,
 	   build_special_member_call (NULL_TREE, complete_ctor_identifier,
 				      NULL, type, LOOKUP_NORMAL,
-				      complain),
-	   complain);
+				      complain));
       else if (TYPE_HAS_COMPLEX_DFLT (type))
 	{
 	  /* This is a class that needs constructing, but doesn't have
@@ -361,7 +360,7 @@  build_value_init (tree type, tsubst_flags_t compla
 	  tree ctor = build_special_member_call
 	    (NULL_TREE, complete_ctor_identifier,
 	     NULL, type, LOOKUP_NORMAL, complain);
-	  ctor = build_aggr_init_expr (type, ctor, complain);
+	  ctor = build_aggr_init_expr (type, ctor);
 	  if (ctor != error_mark_node)
 	    AGGR_INIT_ZERO_FIRST (ctor) = 1;
 	  return ctor;
Index: tree.c
===================================================================
--- tree.c	(revision 194296)
+++ tree.c	(working copy)
@@ -407,7 +407,7 @@  build_aggr_init_array (tree return_type, tree fn,
    callable.  */
 
 tree
-build_aggr_init_expr (tree type, tree init, tsubst_flags_t /*complain*/)
+build_aggr_init_expr (tree type, tree init)
 {
   tree fn;
   tree slot;
@@ -469,7 +469,7 @@  tree
 tree
 build_cplus_new (tree type, tree init, tsubst_flags_t complain)
 {
-  tree rval = build_aggr_init_expr (type, init, complain);
+  tree rval = build_aggr_init_expr (type, init);
   tree slot;
 
   /* Make sure that we're not trying to create an instance of an