C++ PATCH to put static initialization functions in globalscope

Mark Mitchell mark@codesourcery.com
Tue Oct 5 23:17:00 GMT 1999


We weren't pusing the implicitly generated static initialization
functions into namespace scope.  That's not consistent with how we
handle other implicitly generated functions, and inconvenient for
people connecting the front-end to other back-ends.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

1999-10-05  Mark Mitchell  <mark@codesourcery.com>

	* decl2.c (start_static_storage_duration_function): Push the
	function declaration so it ends up in namespace scope.

Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.273
diff -c -p -r1.273 decl2.c
*** decl2.c	1999/10/04 15:13:26	1.273
--- decl2.c	1999/10/06 05:52:35
*************** start_static_storage_duration_function (
*** 2985,2990 ****
--- 2985,2993 ----
    TREE_CHAIN (initialize_p_decl) = priority_decl;
    DECL_ARGUMENTS (ssdf_decl) = initialize_p_decl;
  
+   /* Put the function in the global scope.  */
+   pushdecl (ssdf_decl);
+ 
    /* Start the function itself.  This is equivalent to declarating the
       function as:
  


More information about the Gcc-patches mailing list