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

login
register
mail settings
Submitter Paolo Carlini
Date Dec. 24, 2012, 9:27 a.m.
Message ID <50D81FFF.1050303@oracle.com>
Download mbox | patch
Permalink /patch/208040/
State New
Headers show

Comments

Paolo Carlini - Dec. 24, 2012, 9:27 a.m.
... to explain more concretely what I mean, if I *brutally* hack 
mainline per the below, then the testcase is accepted.

Paolo.

//////////////////

Patch

Index: call.c
===================================================================
--- call.c	(revision 194659)
+++ call.c	(working copy)
@@ -7535,7 +7535,11 @@  build_new_method_call_1 (tree instance, tree fns,
       if (CONSTRUCTOR_NELTS (init_list) == 0
 	  && TYPE_HAS_DEFAULT_CONSTRUCTOR (basetype)
 	  && !processing_template_decl)
-	init = build_value_init (basetype, complain);
+	{
+	  push_deferring_access_checks (dk_no_check);
+	  init = build_value_init (basetype, complain);
+	  pop_deferring_access_checks ();
+	}
 
       /* If BASETYPE is an aggregate, we need to do aggregate
 	 initialization.  */