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

Submitted by Paolo Carlini on Dec. 24, 2012, 9:27 a.m.

Details

Message ID 50D81FFF.1050303@oracle.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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.  */