C++ PATCH: Remove traditional C constructs 4/n.

Gabriel Dos Reis gdr@integrable-solutions.net
Sun Dec 29 06:57:00 GMT 2002


This is the fourth part of removing traditional C constructs in cp/.
Regtested on an i686-pc-linux-gnu.  Applied to mainline.

-- Gaby
2002-12-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
  
 	Remove traditional C constructs 4/n.
 	* decl2.c (grok_method_quals, warn_if_unknown_interface,
 	grok_x_components, cp_build_parm_decl, build_artificial_parm,
 	maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
 	delete_sanity, check_member_template, check_java_method,
 	check_classfn, finish_static_data_member_decl, grokfield,
 	grokbitfield, grokoptypename, grok_function_init,
 	cplus_decl_attributes, constructor_name, defer_fn,
 	build_anon_union_vars, finish_anon_union, coerce_new_type,
 	coerce_delete_type, comdat_linkage, maybe_make_one_only,
 	key_method, import_export_vtable, import_export_class,
 	output_vtable_inherit, import_export_decl, import_export_tinfo,
 	build_cleanup, get_guard, get_guard_bits, get_guard_cond,
 	set_guard, start_objects, finish_objects,
 	start_static_storage_duration_function,
 	finish_static_storage_duration_function, get_priority_info,
 	start_static_initialization_or_destruction,
 	finish_static_initialization_or_destruction,
 	do_static_initialization, do_static_destruction,
 	prune_vars_needing_no_initialization, write_out_vars,
 	reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
 	add_using_namespace, merge_functions, ambiguous_decl,
 	lookup_using_namespace, lookup_using_namespace,
 	qualified_lookup_using_namespace, set_decl_namespace,
 	decl_namespace, current_decl_namespace, push_decl_namespace,
 	pop_decl_namespace, push_scope, pop_scope, add_function,
 	arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
 	lookup_arg_dependent, do_namespace_alias,
 	validate_nonmember_using_decl, do_nonmember_using_decl,
 	do_toplevel_using_decl, do_local_using_decl,
 	do_class_using_decl, do_using_directive, check_default_args,
 	mark_used, handle_class_head): Use C90 prototypings.  Use booleans.
 	* parser.c (cp_parser_class_head): Use booleanss.
 	* decl.c (walk_globals, walk_vtables): Likewise.
 	* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
 	walk_globals): Change return type from 'int' to 'bool'.
 	* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
 	throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
 	build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
 	get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
 	qualifier_flags, tinfo_base_init, generic_initializer,
 	ptr_initializer, dfs_class_hint_mark, ptm_initializer,
 	dfs_class_hint_unmark, class_hint_flags, class_initializer,
 	typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
 	get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
 	unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
 	* repo.c (repo_compile_flags, repo_template_declared,
 	repo_template_defined, repo_class_defined, repo_get_id,
 	repo_template_used, repo_vtable_used, repo_inline_used,
 	repo_tinfo_used, repo_template_instantiated, extract_string,
 	open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
 	finish_repo): Likewise.
 	* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
 	cxx_print_xnode): Likewise..
 	* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
 	cxx_warn_unused_global_decl, cp_expr_size): Likewise.
 	* cxxfilt.c (demangle_it, print_demangler_list, usage,
 	standard_symbol_characters, hp_symbol_characters, main, fatal):
 	Likewise. 
 	(strip_underscore):  Change type from 'int' to 'bool'.
 	(main): Use boolean constants.
 
Index: cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.785
diff -p -r1.785 cp-tree.h
*** cp-tree.h	28 Dec 2002 14:38:37 -0000	1.785
--- cp-tree.h	29 Dec 2002 14:51:18 -0000
*************** extern void pop_lang_context			PARAMS ((
*** 3620,3629 ****
  extern tree instantiate_type			PARAMS ((tree, tree, tsubst_flags_t));
  extern void print_class_statistics              PARAMS ((void));
  extern void cxx_print_statistics		PARAMS ((void));
! extern void cxx_print_xnode			PARAMS ((FILE *, tree, int));
! extern void cxx_print_decl			PARAMS ((FILE *, tree, int));
! extern void cxx_print_type			PARAMS ((FILE *, tree, int));
! extern void cxx_print_identifier		PARAMS ((FILE *, tree, int));
  extern void cxx_print_error_function	PARAMS ((struct diagnostic_context *,
  						 const char *));
  extern void build_self_reference		PARAMS ((void));
--- 3620,3629 ----
  extern tree instantiate_type			PARAMS ((tree, tree, tsubst_flags_t));
  extern void print_class_statistics              PARAMS ((void));
  extern void cxx_print_statistics		PARAMS ((void));
! extern void cxx_print_xnode (FILE *, tree, int);
! extern void cxx_print_decl (FILE *, tree, int);
! extern void cxx_print_type (FILE *, tree, int);
! extern void cxx_print_identifier (FILE *, tree, int);
  extern void cxx_print_error_function	PARAMS ((struct diagnostic_context *,
  						 const char *));
  extern void build_self_reference		PARAMS ((void));
*************** extern void end_only_namespace_names    
*** 3738,3745 ****
  extern tree namespace_ancestor			PARAMS ((tree, tree));
  extern tree unqualified_namespace_lookup	PARAMS ((tree, int, tree *));
  extern tree check_for_out_of_scope_variable     (tree);
! extern int  lookup_using_namespace              PARAMS ((tree, tree, tree, tree, int, tree *));
! extern int  qualified_lookup_using_namespace    PARAMS ((tree, tree, tree, int));
  extern tree build_library_fn			PARAMS ((tree, tree));
  extern tree build_library_fn_ptr		PARAMS ((const char *, tree));
  extern tree build_cp_library_fn_ptr		PARAMS ((const char *, tree));
--- 3738,3745 ----
  extern tree namespace_ancestor			PARAMS ((tree, tree));
  extern tree unqualified_namespace_lookup	PARAMS ((tree, int, tree *));
  extern tree check_for_out_of_scope_variable     (tree);
! extern bool lookup_using_namespace (tree, tree, tree, tree, int, tree *);
! extern bool qualified_lookup_using_namespace (tree, tree, tree, int);
  extern tree build_library_fn			PARAMS ((tree, tree));
  extern tree build_library_fn_ptr		PARAMS ((const char *, tree));
  extern tree build_cp_library_fn_ptr		PARAMS ((const char *, tree));
*************** extern void storetags                   
*** 3795,3808 ****
  extern int vtable_decl_p                        PARAMS ((tree, void *));
  extern int vtype_decl_p                         PARAMS ((tree, void *));
  extern int sigtable_decl_p                      PARAMS ((tree, void *));
! typedef int (*walk_globals_pred)                PARAMS ((tree, void *));
! typedef int (*walk_globals_fn)                  PARAMS ((tree *, void *));
! extern int walk_globals                         PARAMS ((walk_globals_pred,
! 						       walk_globals_fn,
! 						       void *));
! extern int walk_vtables                         PARAMS ((walk_globals_pred, 
!                                                        walk_globals_fn, 
! 						       void *));
  typedef int (*walk_namespaces_fn)               PARAMS ((tree, void *));
  extern int walk_namespaces                      PARAMS ((walk_namespaces_fn,
  						       void *));
--- 3795,3804 ----
  extern int vtable_decl_p                        PARAMS ((tree, void *));
  extern int vtype_decl_p                         PARAMS ((tree, void *));
  extern int sigtable_decl_p                      PARAMS ((tree, void *));
! typedef bool (*walk_globals_pred) (tree, void *);
! typedef bool (*walk_globals_fn) (tree *, void *);
! extern bool walk_globals (walk_globals_pred, walk_globals_fn, void *);
! extern bool walk_vtables (walk_globals_pred, walk_globals_fn, void *);
  typedef int (*walk_namespaces_fn)               PARAMS ((tree, void *));
  extern int walk_namespaces                      PARAMS ((walk_namespaces_fn,
  						       void *));
*************** extern tree cp_fname_init			PARAMS ((con
*** 3820,3853 ****
  extern bool have_extern_spec;
  
  /* in decl2.c */
! extern int check_java_method			PARAMS ((tree));
! extern int grok_method_quals			PARAMS ((tree, tree, tree));
! extern void warn_if_unknown_interface		PARAMS ((tree));
! extern void grok_x_components			PARAMS ((tree));
! extern void maybe_retrofit_in_chrg		PARAMS ((tree));
! extern void maybe_make_one_only			PARAMS ((tree));
! extern void grokclassfn				PARAMS ((tree, tree, enum overload_flags, tree));
! extern tree grok_array_decl			PARAMS ((tree, tree));
! extern tree delete_sanity			PARAMS ((tree, tree, int, int));
! extern tree check_classfn			PARAMS ((tree, tree));
! extern void check_member_template               PARAMS ((tree));
! extern tree grokfield				PARAMS ((tree, tree, tree, tree, tree));
! extern tree grokbitfield			PARAMS ((tree, tree, tree));
  extern tree groktypefield			PARAMS ((tree, tree));
! extern tree grokoptypename			PARAMS ((tree, tree, tree));
! extern void cplus_decl_attributes		PARAMS ((tree *, tree, int));
  extern tree constructor_name_full		PARAMS ((tree));
! extern tree constructor_name			PARAMS ((tree));
  extern bool constructor_name_p                  (tree, tree);
! extern void defer_fn            		PARAMS ((tree));
! extern void finish_anon_union			PARAMS ((tree));
! extern tree finish_table			PARAMS ((tree, tree, tree, int));
! extern tree coerce_new_type			PARAMS ((tree));
! extern tree coerce_delete_type			PARAMS ((tree));
! extern void comdat_linkage			PARAMS ((tree));
! extern void import_export_vtable		PARAMS ((tree, tree, int));
! extern void import_export_decl			PARAMS ((tree));
! extern void import_export_tinfo			PARAMS ((tree, tree, int));
  extern tree build_cleanup			PARAMS ((tree));
  extern void finish_file				PARAMS ((void));
  extern tree reparse_absdcl_as_expr		PARAMS ((tree, tree));
--- 3816,3849 ----
  extern bool have_extern_spec;
  
  /* in decl2.c */
! extern bool check_java_method (tree);
! extern int grok_method_quals (tree, tree, tree);
! extern void warn_if_unknown_interface (tree);
! extern void grok_x_components (tree);
! extern void maybe_retrofit_in_chrg (tree);
! extern void maybe_make_one_only	(tree);
! extern void grokclassfn	(tree, tree, enum overload_flags, tree);
! extern tree grok_array_decl (tree, tree);
! extern tree delete_sanity (tree, tree, int, int);
! extern tree check_classfn (tree, tree);
! extern void check_member_template (tree);
! extern tree grokfield (tree, tree, tree, tree, tree);
! extern tree grokbitfield (tree, tree, tree);
  extern tree groktypefield			PARAMS ((tree, tree));
! extern tree grokoptypename (tree, tree, tree);
! extern void cplus_decl_attributes (tree *, tree, int);
  extern tree constructor_name_full		PARAMS ((tree));
! extern tree constructor_name (tree);
  extern bool constructor_name_p                  (tree, tree);
! extern void defer_fn (tree);
! extern void finish_anon_union (tree);
! extern tree finish_table (tree, tree, tree, int);
! extern tree coerce_new_type (tree);
! extern tree coerce_delete_type (tree);
! extern void comdat_linkage (tree);
! extern void import_export_vtable (tree, tree, int);
! extern void import_export_decl (tree);
! extern void import_export_tinfo	(tree, tree, bool);
  extern tree build_cleanup			PARAMS ((tree));
  extern void finish_file				PARAMS ((void));
  extern tree reparse_absdcl_as_expr		PARAMS ((tree, tree));
*************** extern tree reparse_absdcl_as_casts		PAR
*** 3855,3883 ****
  extern tree build_expr_from_tree		PARAMS ((tree));
  extern tree build_offset_ref_call_from_tree     (tree, tree);
  extern tree build_call_from_tree                (tree, tree, bool);
! extern tree reparse_decl_as_expr		PARAMS ((tree, tree));
! extern tree finish_decl_parsing			PARAMS ((tree));
! extern void set_decl_namespace                  PARAMS ((tree, tree, int));
  extern tree current_decl_namespace              PARAMS ((void));
  extern void push_decl_namespace                 PARAMS ((tree));
  extern void pop_decl_namespace                  PARAMS ((void));
  extern void push_scope				PARAMS ((tree));
  extern void pop_scope				PARAMS ((tree));
! extern void do_namespace_alias			PARAMS ((tree, tree));
! extern void do_toplevel_using_decl		PARAMS ((tree));
! extern void do_local_using_decl                 PARAMS ((tree));
! extern tree do_class_using_decl			PARAMS ((tree));
! extern void do_using_directive			PARAMS ((tree));
! extern void check_default_args			PARAMS ((tree));
! extern void mark_used				PARAMS ((tree));
! extern tree handle_class_head			(enum tag_types, tree, tree, tree, int, int *);
! extern tree lookup_arg_dependent                PARAMS ((tree, tree, tree));
! extern void finish_static_data_member_decl      PARAMS ((tree, tree, tree, int));
! extern tree cp_build_parm_decl                  PARAMS ((tree, tree));
! extern tree build_artificial_parm               PARAMS ((tree, tree));
! extern tree get_guard                           PARAMS ((tree));
! extern tree get_guard_cond                      PARAMS ((tree));
! extern tree set_guard                           PARAMS ((tree));
  
  extern void cp_error_at		PARAMS ((const char *msgid, ...));
  extern void cp_warning_at	PARAMS ((const char *msgid, ...));
--- 3851,3879 ----
  extern tree build_expr_from_tree		PARAMS ((tree));
  extern tree build_offset_ref_call_from_tree     (tree, tree);
  extern tree build_call_from_tree                (tree, tree, bool);
! extern tree reparse_decl_as_expr (tree, tree);
! extern tree finish_decl_parsing (tree);
! extern void set_decl_namespace (tree, tree, bool);
  extern tree current_decl_namespace              PARAMS ((void));
  extern void push_decl_namespace                 PARAMS ((tree));
  extern void pop_decl_namespace                  PARAMS ((void));
  extern void push_scope				PARAMS ((tree));
  extern void pop_scope				PARAMS ((tree));
! extern void do_namespace_alias (tree, tree);
! extern void do_toplevel_using_decl (tree);
! extern void do_local_using_decl (tree);
! extern tree do_class_using_decl (tree);
! extern void do_using_directive (tree);
! extern void check_default_args (tree);
! extern void mark_used (tree);
! extern tree handle_class_head (enum tag_types, tree, tree, tree, bool, bool *);
! extern tree lookup_arg_dependent (tree, tree, tree);
! extern void finish_static_data_member_decl (tree, tree, tree, int);
! extern tree cp_build_parm_decl (tree, tree);
! extern tree build_artificial_parm (tree, tree);
! extern tree get_guard (tree);
! extern tree get_guard_cond (tree);
! extern tree set_guard (tree);
  
  extern void cp_error_at		PARAMS ((const char *msgid, ...));
  extern void cp_warning_at	PARAMS ((const char *msgid, ...));
*************** extern tree maybe_get_template_decl_from
*** 4065,4084 ****
  extern int processing_template_parmlist;
  
  /* in repo.c */
! extern void repo_template_used			PARAMS ((tree));
! extern void repo_template_instantiated		PARAMS ((tree, int));
! extern void init_repo				PARAMS ((const char *));
! extern void finish_repo				PARAMS ((void));
  
  /* in rtti.c */
! extern void init_rtti_processing		PARAMS((void));
! extern tree build_typeid			PARAMS((tree));
! extern tree get_tinfo_decl                      PARAMS((tree));
! extern tree get_typeid				PARAMS((tree));
! extern tree build_dynamic_cast			PARAMS((tree, tree));
! extern void emit_support_tinfos                 PARAMS((void));
! extern int unemitted_tinfo_decl_p    	        PARAMS((tree, void *));
! extern int emit_tinfo_decl                      PARAMS((tree *, void *));
  
  /* in search.c */
  extern tree lookup_base PARAMS ((tree, tree, base_access, base_kind *));
--- 4061,4080 ----
  extern int processing_template_parmlist;
  
  /* in repo.c */
! extern void repo_template_used (tree);
! extern void repo_template_instantiated (tree, bool);
! extern void init_repo (const char *);
! extern void finish_repo (void);
  
  /* in rtti.c */
! extern void init_rtti_processing (void);
! extern tree build_typeid (tree);
! extern tree get_tinfo_decl (tree);
! extern tree get_typeid (tree);
! extern tree build_dynamic_cast (tree, tree);
! extern void emit_support_tinfos (void);
! extern bool unemitted_tinfo_decl_p (tree, void *);
! extern bool emit_tinfo_decl (tree *, void *);
  
  /* in search.c */
  extern tree lookup_base PARAMS ((tree, tree, base_access, base_kind *));
Index: cp-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-lang.c,v
retrieving revision 1.44
diff -p -r1.44 cp-lang.c
*** cp-lang.c	16 Dec 2002 18:22:10 -0000	1.44
--- cp-lang.c	29 Dec 2002 14:51:18 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 30,40 ****
  #include "langhooks.h"
  #include "langhooks-def.h"
  
! static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree));
! static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
! static bool cxx_warn_unused_global_decl PARAMS ((tree));
! static tree cp_expr_size PARAMS ((tree));
! static bool cp_var_mod_type_p PARAMS ((tree));
  
  #undef LANG_HOOKS_NAME
  #define LANG_HOOKS_NAME "GNU C++"
--- 30,40 ----
  #include "langhooks.h"
  #include "langhooks-def.h"
  
! static HOST_WIDE_INT cxx_get_alias_set (tree);
! static bool ok_to_generate_alias_set_for_type (tree);
! static bool cxx_warn_unused_global_decl (tree);
! static tree cp_expr_size (tree);
! static bool cp_var_mod_type_p (tree);
  
  #undef LANG_HOOKS_NAME
  #define LANG_HOOKS_NAME "GNU C++"
*************** const char *const tree_code_name[] = {
*** 204,211 ****
     Return TRUE if T safe for aliasing FALSE otherwise.  */
  
  static bool
! ok_to_generate_alias_set_for_type (t)
!      tree t;
  {
    if (TYPE_PTRMEMFUNC_P (t))
      return true;
--- 204,210 ----
     Return TRUE if T safe for aliasing FALSE otherwise.  */
  
  static bool
! ok_to_generate_alias_set_for_type (tree t)
  {
    if (TYPE_PTRMEMFUNC_P (t))
      return true;
*************** ok_to_generate_alias_set_for_type (t)
*** 258,265 ****
  /* Special routine to get the alias set for C++.  */
  
  static HOST_WIDE_INT
! cxx_get_alias_set (t)
!      tree t;
  {
    /* It's not yet safe to use alias sets for classes in C++.  */
    if (!ok_to_generate_alias_set_for_type(t))
--- 257,263 ----
  /* Special routine to get the alias set for C++.  */
  
  static HOST_WIDE_INT
! cxx_get_alias_set (tree t)
  {
    /* It's not yet safe to use alias sets for classes in C++.  */
    if (!ok_to_generate_alias_set_for_type(t))
*************** cxx_get_alias_set (t)
*** 271,278 ****
  /* Called from check_global_declarations.  */
  
  static bool
! cxx_warn_unused_global_decl (decl)
!      tree decl;
  {
    if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
      return false;
--- 269,275 ----
  /* Called from check_global_declarations.  */
  
  static bool
! cxx_warn_unused_global_decl (tree decl)
  {
    if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
      return false;
*************** cxx_warn_unused_global_decl (decl)
*** 291,298 ****
     might have allocated something there.  */
  
  static tree
! cp_expr_size (exp)
!      tree exp;
  {
    if (CLASS_TYPE_P (TREE_TYPE (exp)))
      {
--- 288,294 ----
     might have allocated something there.  */
  
  static tree
! cp_expr_size (tree exp)
  {
    if (CLASS_TYPE_P (TREE_TYPE (exp)))
      {
Index: cxxfilt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cxxfilt.c,v
retrieving revision 1.3
diff -p -r1.3 cxxfilt.c
*** cxxfilt.c	16 Dec 2002 18:22:11 -0000	1.3
--- cxxfilt.c	29 Dec 2002 14:51:18 -0000
*************** Software Foundation, 59 Temple Place - S
*** 33,46 ****
  static const char *program_name;
  static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE;
  
! static void demangle_it PARAMS ((char *));
! static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN;
! static void fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN;
! static void print_demangler_list PARAMS ((FILE *));
  
  static void
! demangle_it (mangled_name)
!      char *mangled_name;
  {
    char *result;
  
--- 33,45 ----
  static const char *program_name;
  static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE;
  
! static void demangle_it (char *);
! static void usage (FILE *, int) ATTRIBUTE_NORETURN;
! static void fatal (const char *) ATTRIBUTE_NORETURN;
! static void print_demangler_list (FILE *);
  
  static void
! demangle_it (char *mangled_name)
  {
    char *result;
  
*************** demangle_it (mangled_name)
*** 58,65 ****
  }
  
  static void 
! print_demangler_list (stream)
!      FILE *stream;
  {
    const struct demangler_engine *demangler; 
  
--- 57,63 ----
  }
  
  static void 
! print_demangler_list (FILE *stream)
  {
    const struct demangler_engine *demangler; 
  
*************** print_demangler_list (stream)
*** 74,82 ****
  }
  
  static void
! usage (stream, status)
!      FILE *stream;
!      int status;
  {
    fprintf (stream, "\
  Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",
--- 72,78 ----
  }
  
  static void
! usage (FILE *stream, int status)
  {
    fprintf (stream, "\
  Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",
*************** Usage: %s [-_] [-n] [--strip-underscores
*** 100,106 ****
  #define MBUF_SIZE 32767
  char mbuffer[MBUF_SIZE];
  
! int strip_underscore = 0;
  
  static const struct option long_options[] = {
    {"strip-underscores", no_argument, 0, '_'},
--- 96,102 ----
  #define MBUF_SIZE 32767
  char mbuffer[MBUF_SIZE];
  
! bool strip_underscore = false;
  
  static const struct option long_options[] = {
    {"strip-underscores", no_argument, 0, '_'},
*************** static const struct option long_options[
*** 111,128 ****
    {0, no_argument, 0, 0}
  };
  
! static const char *
! standard_symbol_characters PARAMS ((void));
  
! static const char *
! hp_symbol_characters PARAMS ((void));
  
  /* Return the string of non-alnum characters that may occur 
     as a valid symbol component, in the standard assembler symbol
     syntax.  */
  
  static const char *
! standard_symbol_characters ()
  {
    return "_$.";
  }
--- 107,122 ----
    {0, no_argument, 0, 0}
  };
  
! static const char *standard_symbol_characters (void);
  
! static const char *hp_symbol_characters (void);
  
  /* Return the string of non-alnum characters that may occur 
     as a valid symbol component, in the standard assembler symbol
     syntax.  */
  
  static const char *
! standard_symbol_characters (void)
  {
    return "_$.";
  }
*************** standard_symbol_characters ()
*** 159,175 ****
  
     So have fun.  */
  static const char *
! hp_symbol_characters ()
  {
    return "_$.<>#,*&[]:(){}";
  }
  
! extern int main PARAMS ((int, char **));
  
  int
! main (argc, argv)
!      int argc;
!      char **argv;
  {
    char *result;
    int c;
--- 153,167 ----
  
     So have fun.  */
  static const char *
! hp_symbol_characters (void)
  {
    return "_$.<>#,*&[]:(){}";
  }
  
! extern int main (int, char **);
  
  int
! main (int argc, char **argv)
  {
    char *result;
    int c;
*************** main (argc, argv)
*** 190,203 ****
  	case 'h':
  	  usage (stdout, 0);
  	case 'n':
! 	  strip_underscore = 0;
  	  break;
  	case 'v':
  	  printf ("GNU %s (C++ demangler), version %s\n",
  		  program_name, version_string);
  	  return (0);
  	case '_':
! 	  strip_underscore = 1;
  	  break;
  	case 's':
  	  {
--- 182,195 ----
  	case 'h':
  	  usage (stdout, 0);
  	case 'n':
! 	  strip_underscore = false;
  	  break;
  	case 'v':
  	  printf ("GNU %s (C++ demangler), version %s\n",
  		  program_name, version_string);
  	  return (0);
  	case '_':
! 	  strip_underscore = true;
  	  break;
  	case 's':
  	  {
*************** main (argc, argv)
*** 296,303 ****
  }
  
  static void
! fatal (str)
!      const char *str;
  {
    fprintf (stderr, "%s: %s\n", program_name, str);
    exit (1);
--- 288,294 ----
  }
  
  static void
! fatal (const char *str)
  {
    fprintf (stderr, "%s: %s\n", program_name, str);
    exit (1);
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.972
diff -p -r1.972 decl.c
*** decl.c	28 Dec 2002 08:03:39 -0000	1.972
--- decl.c	29 Dec 2002 14:51:25 -0000
*************** walk_vtables_r (namespace, data)
*** 1805,1815 ****
  /* Walk the vtable declarations.  Whenever one is found for which P
     returns nonzero, call F with its address.  If any call to F
     returns a nonzero value, return a nonzero value.  */
! int
! walk_vtables (p, f, data)
!      walk_globals_pred p;
!      walk_globals_fn f;
!      void *data;
  {    
    struct walk_globals_data wgd;
    wgd.p = p;    
--- 1805,1812 ----
  /* Walk the vtable declarations.  Whenever one is found for which P
     returns nonzero, call F with its address.  If any call to F
     returns a nonzero value, return a nonzero value.  */
! bool
! walk_vtables (walk_globals_pred p, walk_globals_fn f, void *data)
  {    
    struct walk_globals_data wgd;
    wgd.p = p;    
*************** walk_globals_r (namespace, data)
*** 1885,1898 ****
  }
  
  /* Walk the global declarations.  Whenever one is found for which P
!    returns nonzero, call F with its address.  If any call to F
!    returns a nonzero value, return a nonzero value.  */
  
! int
! walk_globals (p, f, data)
!      walk_globals_pred p;
!      walk_globals_fn f;
!      void *data;
  {
    struct walk_globals_data wgd;
    wgd.p = p;
--- 1882,1892 ----
  }
  
  /* Walk the global declarations.  Whenever one is found for which P
!    returns true, call F with its address.  If any call to F
!    returns true, return true.  */
  
! bool
! walk_globals (walk_globals_pred p, walk_globals_fn f, void *data)
  {
    struct walk_globals_data wgd;
    wgd.p = p;
Index: decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.583
diff -p -r1.583 decl2.c
*** decl2.c	28 Dec 2002 14:38:37 -0000	1.583
--- decl2.c	29 Dec 2002 14:51:28 -0000
*************** typedef struct priority_info_s {
*** 60,96 ****
    int destructions_p;
  } *priority_info;
  
! static void mark_vtable_entries PARAMS ((tree));
! static void grok_function_init PARAMS ((tree, tree));
! static int maybe_emit_vtables (tree);
! static int is_namespace_ancestor PARAMS ((tree, tree));
! static void add_using_namespace PARAMS ((tree, tree, int));
! static tree ambiguous_decl PARAMS ((tree, tree, tree,int));
! static tree build_anon_union_vars PARAMS ((tree));
! static int acceptable_java_type PARAMS ((tree));
! static void output_vtable_inherit PARAMS ((tree));
! static tree start_objects PARAMS ((int, int));
! static void finish_objects PARAMS ((int, int, tree));
! static tree merge_functions PARAMS ((tree, tree));
! static tree decl_namespace PARAMS ((tree));
! static tree validate_nonmember_using_decl PARAMS ((tree, tree *, tree *));
! static void do_nonmember_using_decl PARAMS ((tree, tree, tree, tree,
! 					   tree *, tree *));
! static tree start_static_storage_duration_function PARAMS ((void));
! static void finish_static_storage_duration_function PARAMS ((tree));
! static priority_info get_priority_info PARAMS ((int));
! static void do_static_initialization PARAMS ((tree, tree));
! static void do_static_destruction PARAMS ((tree));
! static tree start_static_initialization_or_destruction PARAMS ((tree, int));
! static void finish_static_initialization_or_destruction PARAMS ((tree));
! static void generate_ctor_or_dtor_function PARAMS ((int, int));
! static int generate_ctor_and_dtor_functions_for_priority
!                                   PARAMS ((splay_tree_node, void *));
! static tree prune_vars_needing_no_initialization PARAMS ((tree));
! static void write_out_vars PARAMS ((tree));
! static void import_export_class	PARAMS ((tree));
! static tree key_method PARAMS ((tree));
! static tree get_guard_bits PARAMS ((tree));
  
  /* A list of static class variables.  This is needed, because a
     static class variable can be declared inside the class without
--- 60,95 ----
    int destructions_p;
  } *priority_info;
  
! static void mark_vtable_entries (tree);
! static void grok_function_init (tree, tree);
! static bool maybe_emit_vtables (tree);
! static bool is_namespace_ancestor (tree, tree);
! static void add_using_namespace (tree, tree, bool);
! static tree ambiguous_decl (tree, tree, tree,int);
! static tree build_anon_union_vars (tree);
! static bool acceptable_java_type (tree);
! static void output_vtable_inherit (tree);
! static tree start_objects (int, int);
! static void finish_objects (int, int, tree);
! static tree merge_functions (tree, tree);
! static tree decl_namespace (tree);
! static tree validate_nonmember_using_decl (tree, tree *, tree *);
! static void do_nonmember_using_decl (tree, tree, tree, tree, tree *, tree *);
! static tree start_static_storage_duration_function (void);
! static void finish_static_storage_duration_function (tree);
! static priority_info get_priority_info (int);
! static void do_static_initialization (tree, tree);
! static void do_static_destruction (tree);
! static tree start_static_initialization_or_destruction (tree, int);
! static void finish_static_initialization_or_destruction (tree);
! static void generate_ctor_or_dtor_function (bool, int);
! static int generate_ctor_and_dtor_functions_for_priority (splay_tree_node,
!                                                           void *);
! static tree prune_vars_needing_no_initialization (tree);
! static void write_out_vars (tree);
! static void import_export_class (tree);
! static tree key_method (tree); 
! static tree get_guard_bits (tree);
  
  /* A list of static class variables.  This is needed, because a
     static class variable can be declared inside the class without
*************** tree global_namespace;
*** 129,136 ****
     TYPE_UNQUALIFIED will be an extension.  */
  
  int
! grok_method_quals (ctype, function, quals)
!      tree ctype, function, quals;
  {
    tree fntype = TREE_TYPE (function);
    tree raises = TYPE_RAISES_EXCEPTIONS (fntype);
--- 128,134 ----
     TYPE_UNQUALIFIED will be an extension.  */
  
  int
! grok_method_quals (tree ctype, tree function, tree quals)
  {
    tree fntype = TREE_TYPE (function);
    tree raises = TYPE_RAISES_EXCEPTIONS (fntype);
*************** grok_method_quals (ctype, function, qual
*** 174,181 ****
     inform the user.  */
  
  void
! warn_if_unknown_interface (decl)
!      tree decl;
  {
    static int already_warned = 0;
    if (already_warned++)
--- 172,178 ----
     inform the user.  */
  
  void
! warn_if_unknown_interface (tree decl)
  {
    static int already_warned = 0;
    if (already_warned++)
*************** warn_if_unknown_interface (decl)
*** 205,212 ****
  /* A subroutine of the parser, to handle a component list.  */
  
  void
! grok_x_components (specs)
!      tree specs;
  {
    tree t;
  
--- 202,208 ----
  /* A subroutine of the parser, to handle a component list.  */
  
  void
! grok_x_components (tree specs)
  {
    tree t;
  
*************** grok_x_components (specs)
*** 228,236 ****
     appropriately.  */
  
  tree
! cp_build_parm_decl (name, type)
!      tree name;
!      tree type;
  {
    tree parm = build_decl (PARM_DECL, name, type);
    DECL_ARG_TYPE (parm) = type_passed_as (type);
--- 224,230 ----
     appropriately.  */
  
  tree
! cp_build_parm_decl (tree name, tree type)
  {
    tree parm = build_decl (PARM_DECL, name, type);
    DECL_ARG_TYPE (parm) = type_passed_as (type);
*************** cp_build_parm_decl (name, type)
*** 241,249 ****
     indicated NAME.  */
  
  tree
! build_artificial_parm (name, type)
!      tree name;
!      tree type;
  {
    tree parm = cp_build_parm_decl (name, type);
    DECL_ARTIFICIAL (parm) = 1;
--- 235,241 ----
     indicated NAME.  */
  
  tree
! build_artificial_parm (tree name, tree type)
  {
    tree parm = cp_build_parm_decl (name, type);
    DECL_ARTIFICIAL (parm) = 1;
*************** build_artificial_parm (name, type)
*** 267,274 ****
     VTT parm (if any), then the user-written parms.  */
  
  void
! maybe_retrofit_in_chrg (fn)
!      tree fn;
  {
    tree basetype, arg_types, parms, parm, fntype;
  
--- 259,265 ----
     VTT parm (if any), then the user-written parms.  */
  
  void
! maybe_retrofit_in_chrg (tree fn)
  {
    tree basetype, arg_types, parms, parm, fntype;
  
*************** maybe_retrofit_in_chrg (fn)
*** 351,360 ****
     QUALS are the qualifiers for the this pointer.  */
  
  void
! grokclassfn (ctype, function, flags, quals)
!      tree ctype, function;
!      enum overload_flags flags;
!      tree quals;
  {
    tree fn_name = DECL_NAME (function);
    int this_quals = TYPE_UNQUALIFIED;
--- 342,348 ----
     QUALS are the qualifiers for the this pointer.  */
  
  void
! grokclassfn (tree ctype, tree function, enum overload_flags flags, tree quals)
  {
    tree fn_name = DECL_NAME (function);
    int this_quals = TYPE_UNQUALIFIED;
*************** grokclassfn (ctype, function, flags, qua
*** 412,419 ****
     along the way.  */
  
  tree
! grok_array_decl (array_expr, index_exp)
!      tree array_expr, index_exp;
  {
    tree type = TREE_TYPE (array_expr);
    tree p1, p2, i1, i2;
--- 400,406 ----
     along the way.  */
  
  tree
! grok_array_decl (tree array_expr, tree index_exp)
  {
    tree type = TREE_TYPE (array_expr);
    tree p1, p2, i1, i2;
*************** grok_array_decl (array_expr, index_exp)
*** 487,495 ****
     Implements ARM $5.3.4.  This is called from the parser.  */
  
  tree
! delete_sanity (exp, size, doing_vec, use_global_delete)
!      tree exp, size;
!      int doing_vec, use_global_delete;
  {
    tree t, type;
    /* For a regular vector delete (aka, no size argument) we will pass
--- 474,480 ----
     Implements ARM $5.3.4.  This is called from the parser.  */
  
  tree
! delete_sanity (tree exp, tree size, int doing_vec, int use_global_delete)
  {
    tree t, type;
    /* For a regular vector delete (aka, no size argument) we will pass
*************** delete_sanity (exp, size, doing_vec, use
*** 566,573 ****
     sort of thing that should be a member template.  */
  
  void
! check_member_template (tmpl)
!      tree tmpl;
  {
    tree decl;
  
--- 551,557 ----
     sort of thing that should be a member template.  */
  
  void
! check_member_template (tree tmpl)
  {
    tree decl;
  
*************** check_member_template (tmpl)
*** 606,614 ****
  
  /* Return true iff TYPE is a valid Java parameter or return type.  */
  
! static int
! acceptable_java_type (type)
!      tree type;
  {
    if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type))
      return 1;
--- 590,597 ----
  
  /* Return true iff TYPE is a valid Java parameter or return type.  */
  
! static bool
! acceptable_java_type (tree type)
  {
    if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type))
      return 1;
*************** acceptable_java_type (type)
*** 619,627 ****
  	{
  	  tree args;  int i;
  	  if (! TYPE_FOR_JAVA (type))
! 	    return 0;
  	  if (! CLASSTYPE_TEMPLATE_INFO (type))
! 	    return 1;
  	  args = CLASSTYPE_TI_ARGS (type);
  	  i = TREE_VEC_LENGTH (args);
  	  while (--i >= 0)
--- 602,610 ----
  	{
  	  tree args;  int i;
  	  if (! TYPE_FOR_JAVA (type))
! 	    return false;
  	  if (! CLASSTYPE_TEMPLATE_INFO (type))
! 	    return true;
  	  args = CLASSTYPE_TI_ARGS (type);
  	  i = TREE_VEC_LENGTH (args);
  	  while (--i >= 0)
*************** acceptable_java_type (type)
*** 630,671 ****
  	      if (TREE_CODE (type) == POINTER_TYPE)
  		type = TREE_TYPE (type);
  	      if (! TYPE_FOR_JAVA (type))
! 		return 0;
  	    }
! 	  return 1;
  	}
      }
!   return 0;
  }
  
! /* For a METHOD in a Java class CTYPE, return 1 if
     the parameter and return types are valid Java types.
!    Otherwise, print appropriate error messages, and return 0.  */
  
! int
! check_java_method (method)
!      tree method;
  {
!   int jerr = 0;
    tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method));
    tree ret_type = TREE_TYPE (TREE_TYPE (method));
!   if (! acceptable_java_type (ret_type))
      {
        error ("Java method '%D' has non-Java return type `%T'",
  		method, ret_type);
!       jerr++;
      }
    for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types))
      {
        tree type = TREE_VALUE (arg_types);
!       if (! acceptable_java_type (type))
  	{
  	  error ("Java method '%D' has non-Java parameter type `%T'",
  		    method, type);
! 	  jerr++;
  	}
      }
!   return jerr ? 0 : 1;
  }
  
  /* Sanity check: report error if this function FUNCTION is not
--- 613,653 ----
  	      if (TREE_CODE (type) == POINTER_TYPE)
  		type = TREE_TYPE (type);
  	      if (! TYPE_FOR_JAVA (type))
! 		return false;
  	    }
! 	  return true;
  	}
      }
!   return false;
  }
  
! /* For a METHOD in a Java class CTYPE, return true if
     the parameter and return types are valid Java types.
!    Otherwise, print appropriate error messages, and return false.  */
  
! bool
! check_java_method (tree method)
  {
!   bool jerr = false;
    tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method));
    tree ret_type = TREE_TYPE (TREE_TYPE (method));
!   if (!acceptable_java_type (ret_type))
      {
        error ("Java method '%D' has non-Java return type `%T'",
  		method, ret_type);
!       jerr = true;
      }
    for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types))
      {
        tree type = TREE_VALUE (arg_types);
!       if (!acceptable_java_type (type))
  	{
  	  error ("Java method '%D' has non-Java parameter type `%T'",
  		    method, type);
! 	  jerr = true;
  	}
      }
!   return !jerr;
  }
  
  /* Sanity check: report error if this function FUNCTION is not
*************** check_java_method (method)
*** 673,680 ****
     CNAME is the same here as it is for grokclassfn above.  */
  
  tree
! check_classfn (ctype, function)
!      tree ctype, function;
  {
    int ix;
    
--- 655,661 ----
     CNAME is the same here as it is for grokclassfn above.  */
  
  tree
! check_classfn (tree ctype, tree function)
  {
    int ix;
    
*************** check_classfn (ctype, function)
*** 793,803 ****
     FLAGS is as for cp_finish_decl.  */
  
  void
! finish_static_data_member_decl (decl, init, asmspec_tree, flags)
!      tree decl;
!      tree init;
!      tree asmspec_tree;
!      int flags;
  {
    my_friendly_assert (TREE_PUBLIC (decl), 0);
  
--- 774,781 ----
     FLAGS is as for cp_finish_decl.  */
  
  void
! finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree,
!                                 int flags)
  {
    my_friendly_assert (TREE_PUBLIC (decl), 0);
  
*************** finish_static_data_member_decl (decl, in
*** 863,870 ****
     CHANGES TO CODE IN `start_method'.  */
  
  tree
! grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
!      tree declarator, declspecs, init, asmspec_tree, attrlist;
  {
    tree value;
    const char *asmspec = 0;
--- 841,848 ----
     CHANGES TO CODE IN `start_method'.  */
  
  tree
! grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree,
!            tree attrlist)
  {
    tree value;
    const char *asmspec = 0;
*************** grokfield (declarator, declspecs, init, 
*** 1071,1078 ****
     WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node.  */
  
  tree
! grokbitfield (declarator, declspecs, width)
!      tree declarator, declspecs, width;
  {
    register tree value = grokdeclarator (declarator, declspecs, BITFIELD,
  					0, NULL);
--- 1049,1055 ----
     WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node.  */
  
  tree
! grokbitfield (tree declarator, tree declspecs, tree width)
  {
    register tree value = grokdeclarator (declarator, declspecs, BITFIELD,
  					0, NULL);
*************** grokbitfield (declarator, declspecs, wid
*** 1129,1137 ****
     scope of the conversion operator, if explicit.  */
  
  tree
! grokoptypename (declspecs, declarator, scope)
!      tree declspecs, declarator;
!      tree scope;
  {
    tree t = grokdeclarator (declarator, declspecs, TYPENAME, 0, NULL);
  
--- 1106,1112 ----
     scope of the conversion operator, if explicit.  */
  
  tree
! grokoptypename (tree declspecs, tree declarator, tree scope)
  {
    tree t = grokdeclarator (declarator, declspecs, TYPENAME, 0, NULL);
  
*************** grokoptypename (declspecs, declarator, s
*** 1187,1195 ****
  */
  
  static void
! grok_function_init (decl, init)
!      tree decl;
!      tree init;
  {
    /* An initializer for a function tells how this function should
       be inherited.  */
--- 1162,1168 ----
  */
  
  static void
! grok_function_init (tree decl, tree init)
  {
    /* An initializer for a function tells how this function should
       be inherited.  */
*************** grok_function_init (decl, init)
*** 1204,1212 ****
  }
  
  void
! cplus_decl_attributes (decl, attributes, flags)
!      tree *decl, attributes;
!      int flags;
  {
    if (*decl == NULL_TREE || *decl == void_type_node)
      return;
--- 1177,1183 ----
  }
  
  void
! cplus_decl_attributes (tree *decl, tree attributes, int flags)
  {
    if (*decl == NULL_TREE || *decl == void_type_node)
      return;
*************** constructor_name_full (tree type)
*** 1240,1247 ****
     unspecialized name.  */
  
  tree
! constructor_name (type)
!      tree type;
  {
    tree name;
    name = constructor_name_full (type);
--- 1211,1217 ----
     unspecialized name.  */
  
  tree
! constructor_name (tree type)
  {
    tree name;
    name = constructor_name_full (type);
*************** constructor_name_p (tree name, tree type
*** 1263,1270 ****
  /* Defer the compilation of the FN until the end of compilation.  */
  
  void
! defer_fn (fn)
!      tree fn;
  {
    if (DECL_DEFERRED_FN (fn))
      return;
--- 1233,1239 ----
  /* Defer the compilation of the FN until the end of compilation.  */
  
  void
! defer_fn (tree fn)
  {
    if (DECL_DEFERRED_FN (fn))
      return;
*************** defer_fn (fn)
*** 1280,1287 ****
     the mangled name.  */
  
  static tree
! build_anon_union_vars (object)
!      tree object;
  {
    tree type = TREE_TYPE (object);
    tree main_decl = NULL_TREE;
--- 1249,1255 ----
     the mangled name.  */
  
  static tree
! build_anon_union_vars (tree object)
  {
    tree type = TREE_TYPE (object);
    tree main_decl = NULL_TREE;
*************** build_anon_union_vars (object)
*** 1341,1352 ****
     is nonzero if this union is not declared static.  */
  
  void
! finish_anon_union (anon_union_decl)
!      tree anon_union_decl;
  {
    tree type = TREE_TYPE (anon_union_decl);
    tree main_decl;
!   int public_p = TREE_PUBLIC (anon_union_decl);
  
    /* The VAR_DECL's context is the same as the TYPE's context.  */
    DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));
--- 1309,1319 ----
     is nonzero if this union is not declared static.  */
  
  void
! finish_anon_union (tree anon_union_decl)
  {
    tree type = TREE_TYPE (anon_union_decl);
    tree main_decl;
!   bool public_p = TREE_PUBLIC (anon_union_decl);
  
    /* The VAR_DECL's context is the same as the TYPE's context.  */
    DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));
*************** finish_anon_union (anon_union_decl)
*** 1390,1397 ****
     what compiler will be expecting.  */
  
  tree
! coerce_new_type (type)
!      tree type;
  {
    int e = 0;
    tree args = TYPE_ARG_TYPES (type);
--- 1357,1363 ----
     what compiler will be expecting.  */
  
  tree
! coerce_new_type (tree type)
  {
    int e = 0;
    tree args = TYPE_ARG_TYPES (type);
*************** coerce_new_type (type)
*** 1425,1432 ****
  }
  
  tree
! coerce_delete_type (type)
!      tree type;
  {
    int e = 0;
    tree args = TYPE_ARG_TYPES (type);
--- 1391,1397 ----
  }
  
  tree
! coerce_delete_type (tree type)
  {
    int e = 0;
    tree args = TYPE_ARG_TYPES (type);
*************** coerce_delete_type (type)
*** 1461,1468 ****
  }
  
  static void
! mark_vtable_entries (decl)
!      tree decl;
  {
    tree entries = CONSTRUCTOR_ELTS (DECL_INITIAL (decl));
  
--- 1426,1432 ----
  }
  
  static void
! mark_vtable_entries (tree decl)
  {
    tree entries = CONSTRUCTOR_ELTS (DECL_INITIAL (decl));
  
*************** mark_vtable_entries (decl)
*** 1493,1500 ****
     linkage available.  */
  
  void
! comdat_linkage (decl)
!      tree decl;
  {
    if (flag_weak)
      make_decl_one_only (decl);
--- 1457,1463 ----
     linkage available.  */
  
  void
! comdat_linkage (tree decl)
  {
    if (flag_weak)
      make_decl_one_only (decl);
*************** comdat_linkage (decl)
*** 1547,1554 ****
     instantiations; otherwise we get duplicate symbol errors.  */
  
  void
! maybe_make_one_only (decl)
!      tree decl;
  {
    /* We used to say that this was not necessary on targets that support weak
       symbols, because the implicit instantiations will defer to the explicit
--- 1510,1516 ----
     instantiations; otherwise we get duplicate symbol errors.  */
  
  void
! maybe_make_one_only (tree decl)
  {
    /* We used to say that this was not necessary on targets that support weak
       symbols, because the implicit instantiations will defer to the explicit
*************** maybe_make_one_only (decl)
*** 1578,1585 ****
     emitted, or NULL_TREE if that heuristic is not applicable to TYPE.  */
  
  static tree
! key_method (type)
!      tree type;
  {
    tree method;
  
--- 1540,1546 ----
     emitted, or NULL_TREE if that heuristic is not applicable to TYPE.  */
  
  static tree
! key_method (tree type)
  {
    tree method;
  
*************** key_method (type)
*** 1605,1613 ****
     it's public in this file or in another one.  */
  
  void
! import_export_vtable (decl, type, final)
!      tree decl, type;
!      int final;
  {
    if (DECL_INTERFACE_KNOWN (decl))
      return;
--- 1566,1572 ----
     it's public in this file or in another one.  */
  
  void
! import_export_vtable (tree decl, tree type, int final)
  {
    if (DECL_INTERFACE_KNOWN (decl))
      return;
*************** import_export_vtable (decl, type, final)
*** 1649,1656 ****
     using various heuristics.  */
  
  static void
! import_export_class (ctype)
!      tree ctype;
  {
    /* -1 for imported, 1 for exported.  */
    int import_export = 0;
--- 1608,1614 ----
     using various heuristics.  */
  
  static void
! import_export_class (tree ctype)
  {
    /* -1 for imported, 1 for exported.  */
    int import_export = 0;
*************** import_export_class (ctype)
*** 1711,1718 ****
     a vtable and the vtable of the parent class.  */
  
  static void
! output_vtable_inherit (vars)
!      tree vars;
  {
    tree parent;
    rtx child_rtx, parent_rtx;
--- 1669,1675 ----
     a vtable and the vtable of the parent class.  */
  
  static void
! output_vtable_inherit (tree vars)
  {
    tree parent;
    rtx child_rtx, parent_rtx;
*************** output_vtable_inherit (vars)
*** 1735,1743 ****
  }
  
  /* If necessary, write out the vtables for the dynamic class CTYPE.
!    Returns nonzero if any vtables were emitted.  */
  
! static int
  maybe_emit_vtables (tree ctype)
  {
    tree vtbl;
--- 1692,1700 ----
  }
  
  /* If necessary, write out the vtables for the dynamic class CTYPE.
!    Returns true if any vtables were emitted.  */
  
! static bool
  maybe_emit_vtables (tree ctype)
  {
    tree vtbl;
*************** maybe_emit_vtables (tree ctype)
*** 1747,1756 ****
       nothing more to do.  */
    primary_vtbl = CLASSTYPE_VTABLES (ctype);
    if (TREE_ASM_WRITTEN (primary_vtbl))
!     return 0;
    /* Ignore dummy vtables made by get_vtable_decl.  */
    if (TREE_TYPE (primary_vtbl) == void_type_node)
!     return 0;
  
    import_export_class (ctype);
    import_export_vtable (primary_vtbl, ctype, 1);
--- 1704,1713 ----
       nothing more to do.  */
    primary_vtbl = CLASSTYPE_VTABLES (ctype);
    if (TREE_ASM_WRITTEN (primary_vtbl))
!     return false;
    /* Ignore dummy vtables made by get_vtable_decl.  */
    if (TREE_TYPE (primary_vtbl) == void_type_node)
!     return false;
  
    import_export_class (ctype);
    import_export_vtable (primary_vtbl, ctype, 1);
*************** maybe_emit_vtables (tree ctype)
*** 1768,1774 ****
        if (DECL_COMDAT (primary_vtbl) 
  	  && CLASSTYPE_DEBUG_REQUESTED (ctype))
  	note_debug_info_needed (ctype);
!       return 0;
      }
  
    /* The ABI requires that we emit all of the vtables if we emit any
--- 1725,1731 ----
        if (DECL_COMDAT (primary_vtbl) 
  	  && CLASSTYPE_DEBUG_REQUESTED (ctype))
  	note_debug_info_needed (ctype);
!       return false;
      }
  
    /* The ABI requires that we emit all of the vtables if we emit any
*************** maybe_emit_vtables (tree ctype)
*** 1826,1840 ****
       info.  */
    note_debug_info_needed (ctype);
  
!   return 1;
  }
  
  /* Determines the proper settings of TREE_PUBLIC and DECL_EXTERNAL for an
     inline function or template instantiation at end-of-file.  */
  
  void
! import_export_decl (decl)
!      tree decl;
  {
    if (DECL_INTERFACE_KNOWN (decl))
      return;
--- 1783,1796 ----
       info.  */
    note_debug_info_needed (ctype);
  
!   return true;
  }
  
  /* Determines the proper settings of TREE_PUBLIC and DECL_EXTERNAL for an
     inline function or template instantiation at end-of-file.  */
  
  void
! import_export_decl (tree decl)
  {
    if (DECL_INTERFACE_KNOWN (decl))
      return;
*************** import_export_decl (decl)
*** 1900,1909 ****
     typeinfo for TYPE should be in the runtime library.  */
  
  void
! import_export_tinfo (decl, type, is_in_library)
!      tree decl;
!      tree type;
!      int is_in_library;
  {
    if (DECL_INTERFACE_KNOWN (decl))
      return;
--- 1856,1862 ----
     typeinfo for TYPE should be in the runtime library.  */
  
  void
! import_export_tinfo (tree decl, tree type, bool is_in_library)
  {
    if (DECL_INTERFACE_KNOWN (decl))
      return;
*************** import_export_tinfo (decl, type, is_in_l
*** 1937,1944 ****
  }
  
  tree
! build_cleanup (decl)
!      tree decl;
  {
    tree temp;
    tree type = TREE_TYPE (decl);
--- 1890,1896 ----
  }
  
  tree
! build_cleanup (tree decl)
  {
    tree temp;
    tree type = TREE_TYPE (decl);
*************** build_cleanup (decl)
*** 1960,1967 ****
     which has static storage duration.  */
  
  tree
! get_guard (decl)
!      tree decl;
  {
    tree sname;
    tree guard;
--- 1912,1918 ----
     which has static storage duration.  */
  
  tree
! get_guard (tree decl)
  {
    tree sname;
    tree guard;
*************** get_guard (decl)
*** 1997,2004 ****
     guarded entity is actually initialized.  */
  
  static tree
! get_guard_bits (guard)
!      tree guard;
  {
    /* We only set the first byte of the guard, in order to leave room
       for a mutex in the high-order bits.  */
--- 1948,1954 ----
     guarded entity is actually initialized.  */
  
  static tree
! get_guard_bits (tree guard)
  {
    /* We only set the first byte of the guard, in order to leave room
       for a mutex in the high-order bits.  */
*************** get_guard_bits (guard)
*** 2017,2024 ****
     variable has already been initialized.  */
  
  tree
! get_guard_cond (guard)
!      tree guard;
  {
    tree guard_value;
  
--- 1967,1973 ----
     variable has already been initialized.  */
  
  tree
! get_guard_cond (tree guard)
  {
    tree guard_value;
  
*************** get_guard_cond (guard)
*** 2034,2041 ****
     the variable being guarded has been initialized.  */
  
  tree
! set_guard (guard)
!      tree guard;
  {
    tree guard_init;
  
--- 1983,1989 ----
     the variable being guarded has been initialized.  */
  
  tree
! set_guard (tree guard)
  {
    tree guard_init;
  
*************** set_guard (guard)
*** 2051,2058 ****
     or destructors.  Subroutine of do_[cd]tors.  */
  
  static tree
! start_objects (method_type, initp)
!      int method_type, initp;
  {
    tree fnname;
    tree body;
--- 1999,2005 ----
     or destructors.  Subroutine of do_[cd]tors.  */
  
  static tree
! start_objects (int method_type, int initp)
  {
    tree fnname;
    tree body;
*************** start_objects (method_type, initp)
*** 2112,2120 ****
     or destructors.  Subroutine of do_[cd]tors.  */
  
  static void
! finish_objects (method_type, initp, body)
!      int method_type, initp;
!      tree body;
  {
    tree fn;
  
--- 2059,2065 ----
     or destructors.  Subroutine of do_[cd]tors.  */
  
  static void
! finish_objects (int method_type, int initp, tree body)
  {
    tree fn;
  
*************** static splay_tree priority_info_map;
*** 2180,2186 ****
     translation unit.  */
  
  static tree
! start_static_storage_duration_function ()
  {
    static unsigned ssdf_number;
  
--- 2125,2131 ----
     translation unit.  */
  
  static tree
! start_static_storage_duration_function (void)
  {
    static unsigned ssdf_number;
  
*************** start_static_storage_duration_function (
*** 2279,2286 ****
     this point, no more such objects can be created.  */
  
  static void
! finish_static_storage_duration_function (body)
!      tree body;
  {
    /* Close out the function.  */
    finish_compound_stmt (/*has_no_scope=*/0, body);
--- 2224,2230 ----
     this point, no more such objects can be created.  */
  
  static void
! finish_static_storage_duration_function (tree body)
  {
    /* Close out the function.  */
    finish_compound_stmt (/*has_no_scope=*/0, body);
*************** finish_static_storage_duration_function 
*** 2292,2299 ****
     appropriate prologue.  */
  
  static priority_info
! get_priority_info (priority)
!      int priority;
  {
    priority_info pi;
    splay_tree_node n;
--- 2236,2242 ----
     appropriate prologue.  */
  
  static priority_info
! get_priority_info (int priority)
  {
    priority_info pi;
    splay_tree_node n;
*************** get_priority_info (priority)
*** 2322,2330 ****
     are destroying it.  */
  
  static tree
! start_static_initialization_or_destruction (decl, initp)
!      tree decl;
!      int initp;
  {
    tree guard_if_stmt = NULL_TREE;
    int priority;
--- 2265,2271 ----
     are destroying it.  */
  
  static tree
! start_static_initialization_or_destruction (tree decl, int initp)
  {
    tree guard_if_stmt = NULL_TREE;
    int priority;
*************** start_static_initialization_or_destructi
*** 2446,2453 ****
     the initialization.  */
  
  static void
! finish_static_initialization_or_destruction (guard_if_stmt)
!      tree guard_if_stmt;
  {
    finish_then_clause (guard_if_stmt);
    finish_if_stmt ();
--- 2387,2393 ----
     the initialization.  */
  
  static void
! finish_static_initialization_or_destruction (tree guard_if_stmt)
  {
    finish_then_clause (guard_if_stmt);
    finish_if_stmt ();
*************** finish_static_initialization_or_destruct
*** 2462,2470 ****
     static storage duration.  The initialization is INIT.  */
  
  static void
! do_static_initialization (decl, init)
!      tree decl;
!      tree init;
  {
    tree guard_if_stmt;
  
--- 2402,2408 ----
     static storage duration.  The initialization is INIT.  */
  
  static void
! do_static_initialization (tree decl, tree init)
  {
    tree guard_if_stmt;
  
*************** do_static_initialization (decl, init)
*** 2492,2499 ****
     destruction.  */
  
  static void
! do_static_destruction (decl)
!      tree decl;
  {
    tree guard_if_stmt;
  
--- 2430,2436 ----
     destruction.  */
  
  static void
! do_static_destruction (tree decl)
  {
    tree guard_if_stmt;
  
*************** do_static_destruction (decl)
*** 2521,2528 ****
     i.e., the first variable should be initialized first.  */
  
  static tree
! prune_vars_needing_no_initialization (vars)
!      tree vars;
  {
    tree var;
    tree result;
--- 2458,2464 ----
     i.e., the first variable should be initialized first.  */
  
  static tree
! prune_vars_needing_no_initialization (tree vars)
  {
    tree var;
    tree result;
*************** prune_vars_needing_no_initialization (va
*** 2564,2571 ****
     VARS.  */
  
  static void
! write_out_vars (vars)
!      tree vars;
  {
    tree v;
  
--- 2500,2506 ----
     VARS.  */
  
  static void
! write_out_vars (tree vars)
  {
    tree v;
  
*************** write_out_vars (vars)
*** 2579,2587 ****
     storage duration having the indicated PRIORITY.  */
  
  static void
! generate_ctor_or_dtor_function (constructor_p, priority)
!      int constructor_p;
!      int priority;
  {
    char function_key;
    tree arguments;
--- 2514,2520 ----
     storage duration having the indicated PRIORITY.  */
  
  static void
! generate_ctor_or_dtor_function (bool constructor_p, int priority)
  {
    char function_key;
    tree arguments;
*************** generate_ctor_or_dtor_function (construc
*** 2631,2639 ****
     indicated by N.  */
  
  static int
! generate_ctor_and_dtor_functions_for_priority (n, data)
!      splay_tree_node n;
!      void *data ATTRIBUTE_UNUSED;
  {
    int priority = (int) n->key;
    priority_info pi = (priority_info) n->value;
--- 2564,2571 ----
     indicated by N.  */
  
  static int
! generate_ctor_and_dtor_functions_for_priority (splay_tree_node n,
!                                                void * data ATTRIBUTE_UNUSED)
  {
    int priority = (int) n->key;
    priority_info pi = (priority_info) n->value;
*************** generate_ctor_and_dtor_functions_for_pri
*** 2642,2653 ****
       needed.  */
    if (pi->initializations_p
        || (priority == DEFAULT_INIT_PRIORITY && static_ctors))
!     generate_ctor_or_dtor_function (/*constructor_p=*/1,
! 				    priority);
    if (pi->destructions_p
        || (priority == DEFAULT_INIT_PRIORITY && static_dtors))
!     generate_ctor_or_dtor_function (/*constructor_p=*/0,
! 				    priority);
  
    /* Keep iterating.  */
    return 0;
--- 2574,2583 ----
       needed.  */
    if (pi->initializations_p
        || (priority == DEFAULT_INIT_PRIORITY && static_ctors))
!     generate_ctor_or_dtor_function (/*constructor_p=*/true, priority);
    if (pi->destructions_p
        || (priority == DEFAULT_INIT_PRIORITY && static_dtors))
!     generate_ctor_or_dtor_function (/*constructor_p=*/false, priority);
  
    /* Keep iterating.  */
    return 0;
*************** void
*** 2662,2668 ****
  finish_file ()
  {
    tree vars;
!   int reconsider;
    size_t i;
  
    at_eof = 1;
--- 2592,2598 ----
  finish_file ()
  {
    tree vars;
!   bool reconsider;
    size_t i;
  
    at_eof = 1;
*************** finish_file ()
*** 2702,2708 ****
      {
        tree t;
  
!       reconsider = 0;
  
        /* If there are templates that we've put off instantiating, do
  	 them now.  */
--- 2632,2638 ----
      {
        tree t;
  
!       reconsider = false;
  
        /* If there are templates that we've put off instantiating, do
  	 them now.  */
*************** finish_file ()
*** 2713,2724 ****
  	 instantiation of members of that class.  */
        for (t = dynamic_classes; t; t = TREE_CHAIN (t))
  	if (maybe_emit_vtables (TREE_VALUE (t)))
! 	  reconsider = 1;
        
        /* Write out needed type info variables. Writing out one variable
           might cause others to be needed.  */
        if (walk_globals (unemitted_tinfo_decl_p, emit_tinfo_decl, /*data=*/0))
! 	reconsider = 1;
  
        /* The list of objects with static storage duration is built up
  	 in reverse order.  We clear STATIC_AGGREGATES so that any new
--- 2643,2654 ----
  	 instantiation of members of that class.  */
        for (t = dynamic_classes; t; t = TREE_CHAIN (t))
  	if (maybe_emit_vtables (TREE_VALUE (t)))
! 	  reconsider = true;
        
        /* Write out needed type info variables. Writing out one variable
           might cause others to be needed.  */
        if (walk_globals (unemitted_tinfo_decl_p, emit_tinfo_decl, /*data=*/0))
! 	reconsider = true;
  
        /* The list of objects with static storage duration is built up
  	 in reverse order.  We clear STATIC_AGGREGATES so that any new
*************** finish_file ()
*** 2771,2777 ****
  	  /* All those initializations and finalizations might cause
  	     us to need more inline functions, more template
  	     instantiations, etc.  */
! 	  reconsider = 1;
  	}
        
        for (i = 0; i < deferred_fns_used; ++i)
--- 2701,2707 ----
  	  /* All those initializations and finalizations might cause
  	     us to need more inline functions, more template
  	     instantiations, etc.  */
! 	  reconsider = true;
  	}
        
        for (i = 0; i < deferred_fns_used; ++i)
*************** finish_file ()
*** 2793,2799 ****
  	      push_to_top_level ();
  	      synthesize_method (decl);
  	      pop_from_top_level ();
! 	      reconsider = 1;
  	    }
  
  	  /* We lie to the back-end, pretending that some functions
--- 2723,2729 ----
  	      push_to_top_level ();
  	      synthesize_method (decl);
  	      pop_from_top_level ();
! 	      reconsider = true;
  	    }
  
  	  /* We lie to the back-end, pretending that some functions
*************** finish_file ()
*** 2837,2852 ****
  		 expand it again.  */
  	      if (flag_syntax_only)
  		TREE_ASM_WRITTEN (decl) = 1;
! 	      reconsider = 1;
  	    }
  	}
  
        if (deferred_fns_used
  	  && wrapup_global_declarations (&VARRAY_TREE (deferred_fns, 0),
  					 deferred_fns_used))
! 	reconsider = 1;
        if (walk_namespaces (wrapup_globals_for_namespace, /*data=*/0))
! 	reconsider = 1;
  
        /* Static data members are just like namespace-scope globals.  */
        for (i = 0; i < pending_statics_used; ++i) 
--- 2767,2782 ----
  		 expand it again.  */
  	      if (flag_syntax_only)
  		TREE_ASM_WRITTEN (decl) = 1;
! 	      reconsider = true;
  	    }
  	}
  
        if (deferred_fns_used
  	  && wrapup_global_declarations (&VARRAY_TREE (deferred_fns, 0),
  					 deferred_fns_used))
! 	reconsider = true;
        if (walk_namespaces (wrapup_globals_for_namespace, /*data=*/0))
! 	reconsider = true;
  
        /* Static data members are just like namespace-scope globals.  */
        for (i = 0; i < pending_statics_used; ++i) 
*************** finish_file ()
*** 2861,2867 ****
        if (pending_statics
  	  && wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0),
  					 pending_statics_used))
! 	reconsider = 1;
      } 
    while (reconsider);
  
--- 2791,2797 ----
        if (pending_statics
  	  && wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0),
  					 pending_statics_used))
! 	reconsider = true;
      } 
    while (reconsider);
  
*************** build_call_from_tree (tree fn, tree args
*** 3517,3524 ****
     In the above example, TYPE is `int' and DECL is `*a'.  */
  
  tree
! reparse_decl_as_expr (type, decl)
!      tree type, decl;
  {
    decl = build_expr_from_tree (decl);
    if (type)
--- 3447,3453 ----
     In the above example, TYPE is `int' and DECL is `*a'.  */
  
  tree
! reparse_decl_as_expr (tree type, tree decl)
  {
    decl = build_expr_from_tree (decl);
    if (type)
*************** reparse_decl_as_expr (type, decl)
*** 3532,3539 ****
     checking that make_{pointer,reference}_declarator do.  */
  
  tree
! finish_decl_parsing (decl)
!      tree decl;
  {
    switch (TREE_CODE (decl))
      {
--- 3461,3467 ----
     checking that make_{pointer,reference}_declarator do.  */
  
  tree
! finish_decl_parsing (tree decl)
  {
    switch (TREE_CODE (decl))
      {
*************** finish_decl_parsing (decl)
*** 3569,3584 ****
  
  /* Return 1 if root encloses child.  */
  
! static int
! is_namespace_ancestor (root, child)
!      tree root, child;
  {
    if (root == child)
!     return 1;
    if (root == global_namespace)
!     return 1;
    if (child == global_namespace)
!     return 0;
    return is_namespace_ancestor (root, CP_DECL_CONTEXT (child));
  }
    
--- 3497,3511 ----
  
  /* Return 1 if root encloses child.  */
  
! static bool
! is_namespace_ancestor (tree root, tree child)
  {
    if (root == child)
!     return true;
    if (root == global_namespace)
!     return true;
    if (child == global_namespace)
!     return false;
    return is_namespace_ancestor (root, CP_DECL_CONTEXT (child));
  }
    
*************** is_namespace_ancestor (root, child)
*** 3587,3608 ****
     of two given namespaces.  */
  
  tree
! namespace_ancestor (ns1, ns2)
!      tree ns1, ns2;
  {
    if (is_namespace_ancestor (ns1, ns2))
      return ns1;
    return namespace_ancestor (CP_DECL_CONTEXT (ns1), ns2);
  }
  
! /* Insert used into the using list of user. Set indirect_flag if this
     directive is not directly from the source. Also find the common
     ancestor and let our users know about the new namespace */
  static void 
! add_using_namespace (user, used, indirect)
!      tree user;
!      tree used;
!      int indirect;
  {
    tree t;
    /* Using oneself is a no-op.  */
--- 3514,3531 ----
     of two given namespaces.  */
  
  tree
! namespace_ancestor (tree ns1, tree ns2)
  {
    if (is_namespace_ancestor (ns1, ns2))
      return ns1;
    return namespace_ancestor (CP_DECL_CONTEXT (ns1), ns2);
  }
  
! /* Insert USED into the using list of USER. Set INDIRECT_flag if this
     directive is not directly from the source. Also find the common
     ancestor and let our users know about the new namespace */
  static void 
! add_using_namespace (tree user, tree used, bool indirect)
  {
    tree t;
    /* Using oneself is a no-op.  */
*************** add_using_namespace (user, used, indirec
*** 3649,3657 ****
     necessary.  */
  
  static tree
! merge_functions (s1, s2)
!      tree s1;
!      tree s2;
  {
    for (; s2; s2 = OVL_NEXT (s2))
      {
--- 3572,3578 ----
     necessary.  */
  
  static tree
! merge_functions (tree s1, tree s2)
  {
    for (; s2; s2 = OVL_NEXT (s2))
      {
*************** merge_functions (s1, s2)
*** 3688,3698 ****
     XXX I don't want to repeat the entire duplicate_decls here */
  
  static tree
! ambiguous_decl (name, old, new, flags)
!      tree name;
!      tree old;
!      tree new;
!      int flags;
  {
    tree val, type;
    my_friendly_assert (old != NULL_TREE, 393);
--- 3609,3615 ----
     XXX I don't want to repeat the entire duplicate_decls here */
  
  static tree
! ambiguous_decl (tree name, tree old, tree new, int flags)
  {
    tree val, type;
    my_friendly_assert (old != NULL_TREE, 393);
*************** ambiguous_decl (name, old, new, flags)
*** 3778,3790 ****
     We are currently looking for names in namespace SCOPE, so we
     look through USINGS for using-directives of namespaces
     which have SCOPE as a common ancestor with the current scope.
!    Returns zero on errors.  */
  
! int
! lookup_using_namespace (name, val, usings, scope, flags, spacesp)
!      tree name, val, usings, scope;
!      int flags;
!      tree *spacesp;
  {
    tree iter;
    tree val1;
--- 3695,3705 ----
     We are currently looking for names in namespace SCOPE, so we
     look through USINGS for using-directives of namespaces
     which have SCOPE as a common ancestor with the current scope.
!    Returns false on errors.  */
  
! bool
! lookup_using_namespace (tree name, tree val, tree usings, tree scope,
!                         int flags, tree *spacesp)
  {
    tree iter;
    tree val1;
*************** lookup_using_namespace (name, val, using
*** 3806,3819 ****
  /* [namespace.qual]
     Accepts the NAME to lookup and its qualifying SCOPE.
     Returns the name/type pair found into the CPLUS_BINDING RESULT,
!    or 0 on error.  */
  
! int
! qualified_lookup_using_namespace (name, scope, result, flags)
!      tree name;
!      tree scope;
!      tree result;
!      int flags;
  {
    /* Maintain a list of namespaces visited...  */
    tree seen = NULL_TREE;
--- 3721,3731 ----
  /* [namespace.qual]
     Accepts the NAME to lookup and its qualifying SCOPE.
     Returns the name/type pair found into the CPLUS_BINDING RESULT,
!    or false on error.  */
  
! bool
! qualified_lookup_using_namespace (tree name, tree scope, tree result,
!                                   int flags)
  {
    /* Maintain a list of namespaces visited...  */
    tree seen = NULL_TREE;
*************** qualified_lookup_using_namespace (name, 
*** 3852,3861 ****
     outside scope.  */
  
  void
! set_decl_namespace (decl, scope, friendp)
!      tree decl;
!      tree scope;
!      int friendp;
  {
    tree old;
    
--- 3764,3770 ----
     outside scope.  */
  
  void
! set_decl_namespace (tree decl, tree scope, bool friendp)
  {
    tree old;
    
*************** set_decl_namespace (decl, scope, friendp
*** 3911,3918 ****
  /* Compute the namespace where a declaration is defined.  */
  
  static tree
! decl_namespace (decl)
!      tree decl;
  {
    if (TYPE_P (decl))
      decl = TYPE_STUB_DECL (decl);
--- 3820,3826 ----
  /* Compute the namespace where a declaration is defined.  */
  
  static tree
! decl_namespace (tree decl)
  {
    if (TYPE_P (decl))
      decl = TYPE_STUB_DECL (decl);
*************** decl_namespace (decl)
*** 3932,3938 ****
  /* Return the namespace where the current declaration is declared.  */
  
  tree
! current_decl_namespace ()
  {
    tree result;
    /* If we have been pushed into a different namespace, use it.  */
--- 3840,3846 ----
  /* Return the namespace where the current declaration is declared.  */
  
  tree
! current_decl_namespace (void)
  {
    tree result;
    /* If we have been pushed into a different namespace, use it.  */
*************** current_decl_namespace ()
*** 3951,3958 ****
  /* Temporarily set the namespace for the current declaration.  */
  
  void
! push_decl_namespace (decl)
!      tree decl;
  {
    if (TREE_CODE (decl) != NAMESPACE_DECL)
      decl = decl_namespace (decl);
--- 3859,3865 ----
  /* Temporarily set the namespace for the current declaration.  */
  
  void
! push_decl_namespace (tree decl)
  {
    if (TREE_CODE (decl) != NAMESPACE_DECL)
      decl = decl_namespace (decl);
*************** push_decl_namespace (decl)
*** 3961,3967 ****
  }
  
  void
! pop_decl_namespace ()
  {
    decl_namespace_list = TREE_CHAIN (decl_namespace_list);
  }
--- 3868,3874 ----
  }
  
  void
! pop_decl_namespace (void)
  {
    decl_namespace_list = TREE_CHAIN (decl_namespace_list);
  }
*************** pop_decl_namespace ()
*** 3969,3976 ****
  /* Enter a class or namespace scope.  */
  
  void
! push_scope (t)
!      tree t;
  {
    if (TREE_CODE (t) == NAMESPACE_DECL)
      push_decl_namespace (t);
--- 3876,3882 ----
  /* Enter a class or namespace scope.  */
  
  void
! push_scope (tree t)
  {
    if (TREE_CODE (t) == NAMESPACE_DECL)
      push_decl_namespace (t);
*************** push_scope (t)
*** 3981,3988 ****
  /* Leave scope pushed by push_scope.  */
  
  void
! pop_scope (t)
!      tree t;
  {
    if (TREE_CODE (t) == NAMESPACE_DECL)
      pop_decl_namespace ();
--- 3887,3893 ----
  /* Leave scope pushed by push_scope.  */
  
  void
! pop_scope (tree t)
  {
    if (TREE_CODE (t) == NAMESPACE_DECL)
      pop_decl_namespace ();
*************** struct arg_lookup
*** 4001,4021 ****
    tree functions;
  };
  
! static int arg_assoc         PARAMS ((struct arg_lookup*, tree));
! static int arg_assoc_args    PARAMS ((struct arg_lookup*, tree));
! static int arg_assoc_type    PARAMS ((struct arg_lookup*, tree));
! static int add_function      PARAMS ((struct arg_lookup *, tree));
! static int arg_assoc_namespace PARAMS ((struct arg_lookup *, tree));
! static int arg_assoc_class   PARAMS ((struct arg_lookup *, tree));
! static int arg_assoc_template_arg PARAMS ((struct arg_lookup*, tree));
  
  /* Add a function to the lookup structure.
!    Returns 1 on error.  */
  
! static int
! add_function (k, fn)
!      struct arg_lookup *k;
!      tree fn;
  {
    /* We used to check here to see if the function was already in the list,
       but that's O(n^2), which is just too expensive for function lookup.
--- 3906,3924 ----
    tree functions;
  };
  
! static bool arg_assoc (struct arg_lookup*, tree);
! static bool arg_assoc_args (struct arg_lookup*, tree);
! static bool arg_assoc_type (struct arg_lookup*, tree);
! static bool add_function (struct arg_lookup *, tree);
! static bool arg_assoc_namespace (struct arg_lookup *, tree);
! static bool arg_assoc_class (struct arg_lookup *, tree);
! static bool arg_assoc_template_arg (struct arg_lookup*, tree);
  
  /* Add a function to the lookup structure.
!    Returns true on error.  */
  
! static bool
! add_function (struct arg_lookup *k, tree fn)
  {
    /* We used to check here to see if the function was already in the list,
       but that's O(n^2), which is just too expensive for function lookup.
*************** add_function (k, fn)
*** 4040,4058 ****
        cp_error_at ("`%D' is not a function,", f1);
        cp_error_at ("  conflict with `%D'", f2);
        error ("  in call to `%D'", k->name);
!       return 1;
      }
  
!   return 0;
  }
  
  /* Add functions of a namespace to the lookup structure.
!    Returns 1 on error.  */
  
! static int
! arg_assoc_namespace (k, scope)
!      struct arg_lookup *k;
!      tree scope;
  {
    tree value;
  
--- 3943,3959 ----
        cp_error_at ("`%D' is not a function,", f1);
        cp_error_at ("  conflict with `%D'", f2);
        error ("  in call to `%D'", k->name);
!       return true;
      }
  
!   return false;
  }
  
  /* Add functions of a namespace to the lookup structure.
!    Returns true on error.  */
  
! static bool
! arg_assoc_namespace (struct arg_lookup *k, tree scope)
  {
    tree value;
  
*************** arg_assoc_namespace (k, scope)
*** 4062,4083 ****
    
    value = namespace_binding (k->name, scope);
    if (!value)
!     return 0;
  
    for (; value; value = OVL_NEXT (value))
      if (add_function (k, OVL_CURRENT (value)))
!       return 1;
    
!   return 0;
  }
  
  /* Adds everything associated with a template argument to the lookup
!    structure.  Returns 1 on error.  */
  
! static int
! arg_assoc_template_arg (k, arg)
!      struct arg_lookup* k;
!      tree arg;
  {
    /* [basic.lookup.koenig]
  
--- 3963,3982 ----
    
    value = namespace_binding (k->name, scope);
    if (!value)
!     return false;
  
    for (; value; value = OVL_NEXT (value))
      if (add_function (k, OVL_CURRENT (value)))
!       return true;
    
!   return false;
  }
  
  /* Adds everything associated with a template argument to the lookup
!    structure.  Returns true on error.  */
  
! static bool
! arg_assoc_template_arg (struct arg_lookup *k, tree arg)
  {
    /* [basic.lookup.koenig]
  
*************** arg_assoc_template_arg (k, arg)
*** 4093,4099 ****
    /* Consider first template template arguments.  */
    if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
        || TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE)
!     return 0;
    else if (TREE_CODE (arg) == TEMPLATE_DECL)
      {
        tree ctx = CP_DECL_CONTEXT (arg);
--- 3992,3998 ----
    /* Consider first template template arguments.  */
    if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
        || TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE)
!     return false;
    else if (TREE_CODE (arg) == TEMPLATE_DECL)
      {
        tree ctx = CP_DECL_CONTEXT (arg);
*************** arg_assoc_template_arg (k, arg)
*** 4111,4126 ****
      return arg_assoc_type (k, arg);
    /* It's a non-type template argument.  */
    else
!     return 0;
  }
  
  /* Adds everything associated with class to the lookup structure.
!    Returns 1 on error.  */
  
! static int
! arg_assoc_class (k, type)
!      struct arg_lookup* k;
!      tree type;
  {
    tree list, friends, context;
    int i;
--- 4010,4023 ----
      return arg_assoc_type (k, arg);
    /* It's a non-type template argument.  */
    else
!     return false;
  }
  
  /* Adds everything associated with class to the lookup structure.
!    Returns true on error.  */
  
! static bool
! arg_assoc_class (struct arg_lookup *k, tree type)
  {
    tree list, friends, context;
    int i;
*************** arg_assoc_class (k, type)
*** 4128,4147 ****
    /* Backend build structures, such as __builtin_va_list, aren't
       affected by all this.  */
    if (!CLASS_TYPE_P (type))
!     return 0;
  
    if (purpose_member (type, k->classes))
!     return 0;
    k->classes = tree_cons (type, NULL_TREE, k->classes);
    
    context = decl_namespace (TYPE_MAIN_DECL (type));
    if (arg_assoc_namespace (k, context))
!     return 1;
    
    /* Process baseclasses.  */
    for (i = 0; i < CLASSTYPE_N_BASECLASSES (type); i++)
      if (arg_assoc_class (k, TYPE_BINFO_BASETYPE (type, i)))
!       return 1;
    
    /* Process friends.  */
    for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list; 
--- 4025,4044 ----
    /* Backend build structures, such as __builtin_va_list, aren't
       affected by all this.  */
    if (!CLASS_TYPE_P (type))
!     return false;
  
    if (purpose_member (type, k->classes))
!     return false;
    k->classes = tree_cons (type, NULL_TREE, k->classes);
    
    context = decl_namespace (TYPE_MAIN_DECL (type));
    if (arg_assoc_namespace (k, context))
!     return true;
    
    /* Process baseclasses.  */
    for (i = 0; i < CLASSTYPE_N_BASECLASSES (type); i++)
      if (arg_assoc_class (k, TYPE_BINFO_BASETYPE (type, i)))
!       return true;
    
    /* Process friends.  */
    for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list; 
*************** arg_assoc_class (k, type)
*** 4154,4160 ****
  	if (TREE_PURPOSE (friends) == error_mark_node && TREE_VALUE (friends)
  	    && decl_namespace (TREE_VALUE (friends)) == context)
  	  if (add_function (k, TREE_VALUE (friends)))
! 	    return 1;
  
    /* Process template arguments.  */
    if (CLASSTYPE_TEMPLATE_INFO (type))
--- 4051,4057 ----
  	if (TREE_PURPOSE (friends) == error_mark_node && TREE_VALUE (friends)
  	    && decl_namespace (TREE_VALUE (friends)) == context)
  	  if (add_function (k, TREE_VALUE (friends)))
! 	    return true;
  
    /* Process template arguments.  */
    if (CLASSTYPE_TEMPLATE_INFO (type))
*************** arg_assoc_class (k, type)
*** 4164,4179 ****
          arg_assoc_template_arg (k, TREE_VEC_ELT (list, i));
      }
  
!   return 0;
  }
  
  /* Adds everything associated with a given type.
     Returns 1 on error.  */
  
! static int
! arg_assoc_type (k, type)
!      struct arg_lookup *k;
!      tree type;
  {
    switch (TREE_CODE (type))
      {
--- 4061,4074 ----
          arg_assoc_template_arg (k, TREE_VEC_ELT (list, i));
      }
  
!   return false;
  }
  
  /* Adds everything associated with a given type.
     Returns 1 on error.  */
  
! static bool
! arg_assoc_type (struct arg_lookup *k, tree type)
  {
    switch (TREE_CODE (type))
      {
*************** arg_assoc_type (k, type)
*** 4184,4190 ****
      case VECTOR_TYPE:
      case CHAR_TYPE:
      case BOOLEAN_TYPE:
!       return 0;
      case RECORD_TYPE:
        if (TYPE_PTRMEMFUNC_P (type))
  	return arg_assoc_type (k, TYPE_PTRMEMFUNC_FN_TYPE (type));
--- 4079,4085 ----
      case VECTOR_TYPE:
      case CHAR_TYPE:
      case BOOLEAN_TYPE:
!       return false;
      case RECORD_TYPE:
        if (TYPE_PTRMEMFUNC_P (type))
  	return arg_assoc_type (k, TYPE_PTRMEMFUNC_FN_TYPE (type));
*************** arg_assoc_type (k, type)
*** 4199,4205 ****
      case OFFSET_TYPE:
        /* Pointer to member: associate class type and value type.  */
        if (arg_assoc_type (k, TYPE_OFFSET_BASETYPE (type)))
! 	return 1;
        return arg_assoc_type (k, TREE_TYPE (type));
      case METHOD_TYPE:
        /* The basetype is referenced in the first arg type, so just
--- 4094,4100 ----
      case OFFSET_TYPE:
        /* Pointer to member: associate class type and value type.  */
        if (arg_assoc_type (k, TYPE_OFFSET_BASETYPE (type)))
! 	return true;
        return arg_assoc_type (k, TREE_TYPE (type));
      case METHOD_TYPE:
        /* The basetype is referenced in the first arg type, so just
*************** arg_assoc_type (k, type)
*** 4207,4252 ****
      case FUNCTION_TYPE:
        /* Associate the parameter types.  */
        if (arg_assoc_args (k, TYPE_ARG_TYPES (type)))
! 	return 1;
        /* Associate the return type.  */
        return arg_assoc_type (k, TREE_TYPE (type));
      case TEMPLATE_TYPE_PARM:
      case BOUND_TEMPLATE_TEMPLATE_PARM:
!       return 0;
      case TYPENAME_TYPE:
!       return 0;
      case LANG_TYPE:
        if (type == unknown_type_node)
! 	return 0;
        /* else fall through */
      default:
        abort ();
      }
!   return 0;
  }
  
! /* Adds everything associated with arguments.  Returns 1 on error.  */
  
! static int
! arg_assoc_args (k, args)
!      struct arg_lookup* k;
!      tree args;
  {
    for (; args; args = TREE_CHAIN (args))
      if (arg_assoc (k, TREE_VALUE (args)))
!       return 1;
!   return 0;
  }
  
  /* Adds everything associated with a given tree_node.  Returns 1 on error.  */
  
! static int
! arg_assoc (k, n)
!      struct arg_lookup* k;
!      tree n;
  {
    if (n == error_mark_node)
!     return 0;
  
    if (TYPE_P (n))
      return arg_assoc_type (k, n);
--- 4102,4143 ----
      case FUNCTION_TYPE:
        /* Associate the parameter types.  */
        if (arg_assoc_args (k, TYPE_ARG_TYPES (type)))
! 	return true;
        /* Associate the return type.  */
        return arg_assoc_type (k, TREE_TYPE (type));
      case TEMPLATE_TYPE_PARM:
      case BOUND_TEMPLATE_TEMPLATE_PARM:
!       return false;
      case TYPENAME_TYPE:
!       return false;
      case LANG_TYPE:
        if (type == unknown_type_node)
! 	return false;
        /* else fall through */
      default:
        abort ();
      }
!   return false;
  }
  
! /* Adds everything associated with arguments.  Returns true on error.  */
  
! static bool
! arg_assoc_args (struct arg_lookup *k, tree args)
  {
    for (; args; args = TREE_CHAIN (args))
      if (arg_assoc (k, TREE_VALUE (args)))
!       return true;
!   return false;
  }
  
  /* Adds everything associated with a given tree_node.  Returns 1 on error.  */
  
! static bool
! arg_assoc (struct arg_lookup *k, tree n)
  {
    if (n == error_mark_node)
!     return false;
  
    if (TYPE_P (n))
      return arg_assoc_type (k, n);
*************** arg_assoc (k, n)
*** 4293,4308 ****
        if (TREE_CODE (ctx) == NAMESPACE_DECL)
  	{
  	  if (arg_assoc_namespace (k, ctx) == 1)
! 	    return 1;
  	}
        /* It must be a member template.  */
        else if (arg_assoc_class (k, ctx) == 1)
! 	return 1;
  
        /* Now the arguments.  */
        for (arg = args; arg != NULL_TREE; arg = TREE_CHAIN (arg))
  	if (arg_assoc_template_arg (k, TREE_VALUE (arg)) == 1)
! 	  return 1;
      }
    else
      {
--- 4184,4199 ----
        if (TREE_CODE (ctx) == NAMESPACE_DECL)
  	{
  	  if (arg_assoc_namespace (k, ctx) == 1)
! 	    return true;
  	}
        /* It must be a member template.  */
        else if (arg_assoc_class (k, ctx) == 1)
! 	return true;
  
        /* Now the arguments.  */
        for (arg = args; arg != NULL_TREE; arg = TREE_CHAIN (arg))
  	if (arg_assoc_template_arg (k, TREE_VALUE (arg)) == 1)
! 	  return true;
      }
    else
      {
*************** arg_assoc (k, n)
*** 4310,4329 ****
        
        for (; n; n = OVL_CHAIN (n))
  	if (arg_assoc_type (k, TREE_TYPE (OVL_FUNCTION (n))))
! 	  return 1;
      }
  
!   return 0;
  }
  
  /* Performs Koenig lookup depending on arguments, where fns
     are the functions found in normal lookup.  */
  
  tree
! lookup_arg_dependent (name, fns, args)
!      tree name;
!      tree fns;
!      tree args;
  {
    struct arg_lookup k;
    tree fn = NULL_TREE;
--- 4201,4217 ----
        
        for (; n; n = OVL_CHAIN (n))
  	if (arg_assoc_type (k, TREE_TYPE (OVL_FUNCTION (n))))
! 	  return true;
      }
  
!   return false;
  }
  
  /* Performs Koenig lookup depending on arguments, where fns
     are the functions found in normal lookup.  */
  
  tree
! lookup_arg_dependent (tree name, tree fns, tree args)
  {
    struct arg_lookup k;
    tree fn = NULL_TREE;
*************** lookup_arg_dependent (name, fns, args)
*** 4348,4355 ****
  /* Process a namespace-alias declaration.  */
  
  void
! do_namespace_alias (alias, namespace)
!      tree alias, namespace;
  {
    if (TREE_CODE (namespace) != NAMESPACE_DECL)
      {
--- 4236,4242 ----
  /* Process a namespace-alias declaration.  */
  
  void
! do_namespace_alias (tree alias, tree namespace)
  {
    if (TREE_CODE (namespace) != NAMESPACE_DECL)
      {
*************** do_namespace_alias (alias, namespace)
*** 4370,4379 ****
     being used, and the USING_DECL, or NULL_TREE on failure.  */
  
  static tree
! validate_nonmember_using_decl (decl, scope, name)
!      tree decl;
!      tree *scope;
!      tree *name;
  {
    *scope = global_namespace;
    *name = NULL_TREE;
--- 4257,4263 ----
     being used, and the USING_DECL, or NULL_TREE on failure.  */
  
  static tree
! validate_nonmember_using_decl (tree decl, tree *scope, tree *name)
  {
    *scope = global_namespace;
    *name = NULL_TREE;
*************** validate_nonmember_using_decl (decl, sco
*** 4422,4431 ****
  /* Process local and global using-declarations.  */
  
  static void
! do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
!      tree scope, name;
!      tree oldval, oldtype;
!      tree *newval, *newtype;
  {
    tree decls;
  
--- 4306,4313 ----
  /* Process local and global using-declarations.  */
  
  static void
! do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
!                          tree *newval, tree *newtype)
  {
    tree decls;
  
*************** do_nonmember_using_decl (scope, name, ol
*** 4524,4531 ****
  /* Process a using-declaration not appearing in class or local scope.  */
  
  void
! do_toplevel_using_decl (decl)
!      tree decl;
  {
    tree scope, name, binding;
    tree oldval, oldtype, newval, newtype;
--- 4406,4412 ----
  /* Process a using-declaration not appearing in class or local scope.  */
  
  void
! do_toplevel_using_decl (tree decl)
  {
    tree scope, name, binding;
    tree oldval, oldtype, newval, newtype;
*************** do_toplevel_using_decl (decl)
*** 4552,4559 ****
  /* Process a using-declaration at function scope.  */
  
  void
! do_local_using_decl (decl)
!      tree decl;
  {
    tree scope, name;
    tree oldval, oldtype, newval, newtype;
--- 4433,4439 ----
  /* Process a using-declaration at function scope.  */
  
  void
! do_local_using_decl (tree decl)
  {
    tree scope, name;
    tree oldval, oldtype, newval, newtype;
*************** do_local_using_decl (decl)
*** 4598,4605 ****
  }
  
  tree
! do_class_using_decl (decl)
!      tree decl;
  {
    tree name, value;
  
--- 4478,4484 ----
  }
  
  tree
! do_class_using_decl (tree decl)
  {
    tree name, value;
  
*************** do_class_using_decl (decl)
*** 4659,4666 ****
  /* Process a using-directive.  */
  
  void
! do_using_directive (namespace)
!      tree namespace;
  {
    if (building_stmt_tree ())
      add_stmt (build_stmt (USING_STMT, namespace));
--- 4538,4544 ----
  /* Process a using-directive.  */
  
  void
! do_using_directive (tree namespace)
  {
    if (building_stmt_tree ())
      add_stmt (build_stmt (USING_STMT, namespace));
*************** do_using_directive (namespace)
*** 4690,4704 ****
  }
  
  void
! check_default_args (x)
!      tree x;
  {
    tree arg = TYPE_ARG_TYPES (TREE_TYPE (x));
!   int saw_def = 0, i = 0 - (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE);
    for (; arg && arg != void_list_node; arg = TREE_CHAIN (arg), ++i)
      {
        if (TREE_PURPOSE (arg))
! 	saw_def = 1;
        else if (saw_def)
  	{
  	  cp_error_at ("default argument missing for parameter %P of `%+#D'",
--- 4568,4582 ----
  }
  
  void
! check_default_args (tree x)
  {
    tree arg = TYPE_ARG_TYPES (TREE_TYPE (x));
!   bool saw_def = false;
!   int i = 0 - (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE);
    for (; arg && arg != void_list_node; arg = TREE_CHAIN (arg), ++i)
      {
        if (TREE_PURPOSE (arg))
! 	saw_def = true;
        else if (saw_def)
  	{
  	  cp_error_at ("default argument missing for parameter %P of `%+#D'",
*************** check_default_args (x)
*** 4709,4716 ****
  }
  
  void
! mark_used (decl)
!      tree decl;
  {
    TREE_USED (decl) = 1;
    if (processing_template_decl)
--- 4587,4593 ----
  }
  
  void
! mark_used (tree decl)
  {
    TREE_USED (decl) = 1;
    if (processing_template_decl)
*************** mark_used (decl)
*** 4759,4769 ****
     Return a TYPE_DECL for the type declared by ID in SCOPE.  */
  
  tree
! handle_class_head (tag_kind, scope, id, attributes, defn_p, new_type_p)
!      enum tag_types tag_kind;
!      tree scope, id, attributes;
!      int defn_p;
!      int *new_type_p;
  {
    tree decl = NULL_TREE;
    tree current = current_scope ();
--- 4636,4643 ----
     Return a TYPE_DECL for the type declared by ID in SCOPE.  */
  
  tree
! handle_class_head (enum tag_types tag_kind, tree scope, tree id,
!                    tree attributes, bool defn_p, bool *new_type_p)
  {
    tree decl = NULL_TREE;
    tree current = current_scope ();
*************** handle_class_head (tag_kind, scope, id, 
*** 4772,4778 ****
    if (current == NULL_TREE)
      current = current_namespace;
  
!   *new_type_p = 0;
    
    if (scope)
      {
--- 4646,4652 ----
    if (current == NULL_TREE)
      current = current_namespace;
  
!   *new_type_p = false;
    
    if (scope)
      {
Index: parser.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/parser.c,v
retrieving revision 1.3
diff -p -r1.3 parser.c
*** parser.c	28 Dec 2002 14:38:38 -0000	1.3
--- parser.c	29 Dec 2002 14:51:34 -0000
*************** cp_parser_class_head (parser, 
*** 11755,11761 ****
      }
    else
      {
!       int new_type_p;
        tree class_type;
  
        /* Given:
--- 11755,11761 ----
      }
    else
      {
!       bool new_type_p;
        tree class_type;
  
        /* Given:
*************** cp_parser_class_head (parser, 
*** 11779,11785 ****
  					   nested_name_specifier,
  					   type,
  					   attributes,
! 					   /*defn_p=*/1,
  					   &new_type_p));
        if (type != error_mark_node)
  	{
--- 11779,11785 ----
  					   nested_name_specifier,
  					   type,
  					   attributes,
! 					   /*defn_p=*/true,
  					   &new_type_p));
        if (type != error_mark_node)
  	{
Index: ptree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/ptree.c,v
retrieving revision 1.29
diff -p -r1.29 ptree.c
*** ptree.c	16 Dec 2002 18:22:19 -0000	1.29
--- ptree.c	29 Dec 2002 14:51:34 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 29,38 ****
  #include "cp-tree.h"
  
  void
! cxx_print_decl (file, node, indent)
!      FILE *file;
!      tree node;
!      int indent;
  {
    if (TREE_CODE (node) == FIELD_DECL)
      {
--- 29,35 ----
  #include "cp-tree.h"
  
  void
! cxx_print_decl (FILE *file, tree node, int indent)
  {
    if (TREE_CODE (node) == FIELD_DECL)
      {
*************** cxx_print_decl (file, node, indent)
*** 68,77 ****
  }
  
  void
! cxx_print_type (file, node, indent)
!      FILE *file;
!      register tree node;
!      int indent;
  {
    switch (TREE_CODE (node))
      {
--- 65,71 ----
  }
  
  void
! cxx_print_type (FILE *file, tree node, int indent)
  {
    switch (TREE_CODE (node))
      {
*************** cxx_print_type (file, node, indent)
*** 160,169 ****
  }
  
  void
! cxx_print_identifier (file, node, indent)
!      FILE *file;
!      tree node;
!      int indent;
  {
    print_node (file, "bindings", IDENTIFIER_NAMESPACE_BINDINGS (node), indent + 4);
    print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4);
--- 154,160 ----
  }
  
  void
! cxx_print_identifier (FILE *file, tree node, int indent)
  {
    print_node (file, "bindings", IDENTIFIER_NAMESPACE_BINDINGS (node), indent + 4);
    print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4);
*************** cxx_print_identifier (file, node, indent
*** 175,184 ****
  }
  
  void
! cxx_print_xnode (file, node, indent)
!      FILE *file;
!      tree node;
!      int indent;
  {
    switch (TREE_CODE (node))
      {
--- 166,172 ----
  }
  
  void
! cxx_print_xnode (FILE *file, tree node, int indent)
  {
    switch (TREE_CODE (node))
      {
Index: repo.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/repo.c,v
retrieving revision 1.43
diff -p -r1.43 repo.c
*** repo.c	16 Dec 2002 18:22:19 -0000	1.43
--- repo.c	29 Dec 2002 14:51:34 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 37,48 ****
  #include "ggc.h"
  #include "diagnostic.h"
  
! static tree repo_get_id PARAMS ((tree));
! static char *extract_string PARAMS ((char **));
! static const char *get_base_filename PARAMS ((const char *));
! static void open_repo_file PARAMS ((const char *));
! static char *afgets PARAMS ((FILE *));
! static void reopen_repo_file_for_write PARAMS ((void));
  
  static GTY(()) tree pending_repo;
  static GTY(()) tree original_repo;
--- 37,48 ----
  #include "ggc.h"
  #include "diagnostic.h"
  
! static tree repo_get_id (tree);
! static char *extract_string (char **);
! static const char *get_base_filename (const char *);
! static void open_repo_file (const char *);
! static char *afgets (FILE *);
! static void reopen_repo_file_for_write (void);
  
  static GTY(()) tree pending_repo;
  static GTY(()) tree original_repo;
*************** static struct obstack temporary_obstack;
*** 60,68 ****
  /* Record the flags used to compile this translation unit.  */
  
  void
! repo_compile_flags (argc, argv)
!      int argc;
!      char **argv;
  {
  }
  
--- 60,66 ----
  /* Record the flags used to compile this translation unit.  */
  
  void
! repo_compile_flags (int argc, char **argv)
  {
  }
  
*************** repo_compile_flags (argc, argv)
*** 71,100 ****
     definition at link time.  */
  
  void
! repo_template_declared (t)
!      tree t;
  {}
  
  /* Note where the definition of a template lives so that instantiations can
     be generated later.  */
  
  void
! repo_template_defined (t)
!      tree t;
  {}
  
  /* Note where the definition of a class lives to that template
     instantiations can use it.  */
  
  void
! repo_class_defined (t)
!      tree t;
  {}
  #endif
  
  static tree
! repo_get_id (t)
!      tree t;
  {
    if (TYPE_P (t))
      {
--- 69,94 ----
     definition at link time.  */
  
  void
! repo_template_declared (tree t)
  {}
  
  /* Note where the definition of a template lives so that instantiations can
     be generated later.  */
  
  void
! repo_template_defined (tree t)
  {}
  
  /* Note where the definition of a class lives to that template
     instantiations can use it.  */
  
  void
! repo_class_defined (tree t)
  {}
  #endif
  
  static tree
! repo_get_id (tree t)
  {
    if (TYPE_P (t))
      {
*************** repo_get_id (t)
*** 119,126 ****
     to emit it.  */
  
  void
! repo_template_used (t)
!      tree t;
  {
    tree id;
  
--- 113,119 ----
     to emit it.  */
  
  void
! repo_template_used (tree t)
  {
    tree id;
  
*************** repo_template_used (t)
*** 161,168 ****
  /* Note that the vtable for a class has been used, and offer to emit it.  */
  
  static void
! repo_vtable_used (t)
!      tree t;
  {
    if (! flag_use_repository)
      return;
--- 154,160 ----
  /* Note that the vtable for a class has been used, and offer to emit it.  */
  
  static void
! repo_vtable_used (tree t)
  {
    if (! flag_use_repository)
      return;
*************** repo_vtable_used (t)
*** 174,181 ****
     emit it.  */
  
  void
! repo_inline_used (fn)
!      tree fn;
  {
    if (! flag_use_repository)
      return;
--- 166,172 ----
     emit it.  */
  
  void
! repo_inline_used (tree fn)
  {
    if (! flag_use_repository)
      return;
*************** repo_inline_used (fn)
*** 195,210 ****
     emit it.  */
  
  void
! repo_tinfo_used (ti)
!      tree ti;
  {
  }
  #endif
  
  void
! repo_template_instantiated (t, extern_p)
!      tree t;
!      int extern_p;
  {
    if (! extern_p)
      {
--- 186,198 ----
     emit it.  */
  
  void
! repo_tinfo_used (tree ti)
  {
  }
  #endif
  
  void
! repo_template_instantiated (tree t, bool extern_p)
  {
    if (! extern_p)
      {
*************** repo_template_instantiated (t, extern_p)
*** 217,224 ****
  /* Parse a reasonable subset of shell quoting syntax.  */
  
  static char *
! extract_string (pp)
!      char **pp;
  {
    char *p = *pp;
    int backquote = 0;
--- 205,211 ----
  /* Parse a reasonable subset of shell quoting syntax.  */
  
  static char *
! extract_string (char **pp)
  {
    char *p = *pp;
    int backquote = 0;
*************** extract_string (pp)
*** 248,255 ****
  }
  
  const char *
! get_base_filename (filename)
!      const char *filename;
  {
    char *p = getenv ("COLLECT_GCC_OPTIONS");
    char *output = NULL;
--- 235,241 ----
  }
  
  const char *
! get_base_filename (const char *filename)
  {
    char *p = getenv ("COLLECT_GCC_OPTIONS");
    char *output = NULL;
*************** get_base_filename (filename)
*** 279,286 ****
  }        
  
  static void
! open_repo_file (filename)
!      const char *filename;
  {
    register const char *p;
    const char *s = get_base_filename (filename);
--- 265,271 ----
  }        
  
  static void
! open_repo_file (const char *filename)
  {
    register const char *p;
    const char *s = get_base_filename (filename);
*************** open_repo_file (filename)
*** 301,308 ****
  }
  
  static char *
! afgets (stream)
!      FILE *stream;
  {
    int c;
    while ((c = getc (stream)) != EOF && c != '\n')
--- 286,292 ----
  }
  
  static char *
! afgets (FILE *stream)
  {
    int c;
    while ((c = getc (stream)) != EOF && c != '\n')
*************** afgets (stream)
*** 314,321 ****
  }
  
  void
! init_repo (filename)
!      const char *filename;
  {
    char *buf;
  
--- 298,304 ----
  }
  
  void
! init_repo (const char *filename)
  {
    char *buf;
  
*************** init_repo (filename)
*** 367,373 ****
  }
  
  static void
! reopen_repo_file_for_write ()
  {
    if (repo_file)
      fclose (repo_file);
--- 350,356 ----
  }
  
  static void
! reopen_repo_file_for_write (void)
  {
    if (repo_file)
      fclose (repo_file);
*************** reopen_repo_file_for_write ()
*** 383,395 ****
  /* Emit any pending repos.  */
  
  void
! finish_repo ()
  {
    tree t;
!   int repo_changed = 0;
    char *dir, *args;
  
!   if (! flag_use_repository)
      return;
  
    /* Do we have to write out a new info file?  */
--- 366,378 ----
  /* Emit any pending repos.  */
  
  void
! finish_repo (void)
  {
    tree t;
!   bool repo_changed = false;
    char *dir, *args;
  
!   if (!flag_use_repository)
      return;
  
    /* Do we have to write out a new info file?  */
*************** finish_repo ()
*** 399,408 ****
    
    for (t = original_repo; t; t = TREE_CHAIN (t))
      {
!       if (! IDENTIFIER_REPO_USED (TREE_VALUE (t))
! 	  || (! TREE_PURPOSE (t) && IDENTIFIER_REPO_CHOSEN (TREE_VALUE (t))))
  	{
! 	  repo_changed = 1;
  	  break;
  	}
        IDENTIFIER_REPO_USED (TREE_VALUE (t)) = 0;
--- 382,391 ----
    
    for (t = original_repo; t; t = TREE_CHAIN (t))
      {
!       if (!IDENTIFIER_REPO_USED (TREE_VALUE (t))
! 	  || (!TREE_PURPOSE (t) && IDENTIFIER_REPO_CHOSEN (TREE_VALUE (t))))
  	{
! 	  repo_changed = true;
  	  break;
  	}
        IDENTIFIER_REPO_USED (TREE_VALUE (t)) = 0;
*************** finish_repo ()
*** 410,421 ****
  
    /* Are there any templates that are newly used?  */
    
!   if (! repo_changed)
      for (t = pending_repo; t; t = TREE_CHAIN (t))
        {
  	if (IDENTIFIER_REPO_USED (TREE_VALUE (t)))
  	  {
! 	    repo_changed = 1;
  	    break;
  	  }
        }
--- 393,404 ----
  
    /* Are there any templates that are newly used?  */
    
!   if (!repo_changed)
      for (t = pending_repo; t; t = TREE_CHAIN (t))
        {
  	if (IDENTIFIER_REPO_USED (TREE_VALUE (t)))
  	  {
! 	    repo_changed = true;
  	    break;
  	  }
        }
*************** finish_repo ()
*** 423,436 ****
    dir = getpwd ();
    args = getenv ("COLLECT_GCC_OPTIONS");
  
!   if (! repo_changed && pending_repo)
      if (strcmp (old_main, main_input_filename) != 0
  	|| strcmp (old_dir, dir) != 0
  	|| (args == NULL) != (old_args == NULL)
  	|| (args && strcmp (old_args, args) != 0))
!       repo_changed = 1;
  
!   if (! repo_changed || errorcount || sorrycount)
      goto out;
  
    reopen_repo_file_for_write ();
--- 406,419 ----
    dir = getpwd ();
    args = getenv ("COLLECT_GCC_OPTIONS");
  
!   if (!repo_changed && pending_repo)
      if (strcmp (old_main, main_input_filename) != 0
  	|| strcmp (old_dir, dir) != 0
  	|| (args == NULL) != (old_args == NULL)
  	|| (args && strcmp (old_args, args) != 0))
!       repo_changed = true;
  
!   if (!repo_changed || errorcount || sorrycount)
      goto out;
  
    reopen_repo_file_for_write ();
Index: rtti.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/rtti.c,v
retrieving revision 1.149
diff -p -r1.149 rtti.c
*** rtti.c	28 Dec 2002 08:03:42 -0000	1.149
--- rtti.c	29 Dec 2002 14:51:34 -0000
*************** static tree get_tinfo_decl_dynamic PARAM
*** 83,102 ****
  static tree get_tinfo_ptr PARAMS((tree));
  static bool typeid_ok_p PARAMS((void));
  static int qualifier_flags PARAMS((tree));
! static int target_incomplete_p PARAMS((tree));
  static tree tinfo_base_init PARAMS((tree, tree));
  static tree generic_initializer PARAMS((tree, tree));
! static tree ptr_initializer PARAMS((tree, tree, int *));
! static tree ptm_initializer PARAMS((tree, tree, int *));
  static tree dfs_class_hint_mark PARAMS ((tree, void *));
  static tree dfs_class_hint_unmark PARAMS ((tree, void *));
  static int class_hint_flags PARAMS((tree));
  static tree class_initializer PARAMS((tree, tree, tree));
  static tree create_pseudo_type_info PARAMS((const char *, int, ...));
! static tree get_pseudo_ti_init PARAMS ((tree, tree, int *));
  static tree get_pseudo_ti_desc PARAMS((tree));
  static void create_tinfo_types PARAMS((void));
! static int typeinfo_in_lib_p PARAMS((tree));
  
  static int doing_runtime = 0;
  
--- 83,102 ----
  static tree get_tinfo_ptr PARAMS((tree));
  static bool typeid_ok_p PARAMS((void));
  static int qualifier_flags PARAMS((tree));
! static bool target_incomplete_p (tree);
  static tree tinfo_base_init PARAMS((tree, tree));
  static tree generic_initializer PARAMS((tree, tree));
! static tree ptr_initializer (tree, tree, bool *);
! static tree ptm_initializer (tree, tree, bool *);
  static tree dfs_class_hint_mark PARAMS ((tree, void *));
  static tree dfs_class_hint_unmark PARAMS ((tree, void *));
  static int class_hint_flags PARAMS((tree));
  static tree class_initializer PARAMS((tree, tree, tree));
  static tree create_pseudo_type_info PARAMS((const char *, int, ...));
! static tree get_pseudo_ti_init PARAMS ((tree, tree, bool *));
  static tree get_pseudo_ti_desc PARAMS((tree));
  static void create_tinfo_types PARAMS((void));
! static bool typeinfo_in_lib_p (tree);
  
  static int doing_runtime = 0;
  
*************** static int doing_runtime = 0;
*** 108,114 ****
     the internal versions of the ABI types.  */
  
  void
! init_rtti_processing ()
  {
    tree const_type_info_type;
  
--- 108,114 ----
     the internal versions of the ABI types.  */
  
  void
! init_rtti_processing (void)
  {
    tree const_type_info_type;
  
*************** init_rtti_processing ()
*** 131,138 ****
     expression.  */
  
  static tree
! build_headof (exp)
!      tree exp;
  {
    tree type = TREE_TYPE (exp);
    tree offset;
--- 131,137 ----
     expression.  */
  
  static tree
! build_headof (tree exp)
  {
    tree type = TREE_TYPE (exp);
    tree offset;
*************** build_headof (exp)
*** 163,169 ****
     See libstdc++/exception.cc for __throw_bad_cast */
  
  static tree
! throw_bad_cast ()
  {
    tree fn = get_identifier ("__cxa_bad_cast");
    if (IDENTIFIER_GLOBAL_VALUE (fn))
--- 162,168 ----
     See libstdc++/exception.cc for __throw_bad_cast */
  
  static tree
! throw_bad_cast (void)
  {
    tree fn = get_identifier ("__cxa_bad_cast");
    if (IDENTIFIER_GLOBAL_VALUE (fn))
*************** throw_bad_cast ()
*** 176,182 ****
  }
  
  static tree
! throw_bad_typeid ()
  {
    tree fn = get_identifier ("__cxa_bad_typeid");
    if (IDENTIFIER_GLOBAL_VALUE (fn))
--- 175,181 ----
  }
  
  static tree
! throw_bad_typeid (void)
  {
    tree fn = get_identifier ("__cxa_bad_typeid");
    if (IDENTIFIER_GLOBAL_VALUE (fn))
*************** throw_bad_typeid ()
*** 196,203 ****
     otherwise return the static type of the expression.  */
  
  static tree
! get_tinfo_decl_dynamic (exp)
!      tree exp;
  {
    tree type;
    
--- 195,201 ----
     otherwise return the static type of the expression.  */
  
  static tree
! get_tinfo_decl_dynamic (tree exp)
  {
    tree type;
    
*************** get_tinfo_decl_dynamic (exp)
*** 238,244 ****
  }
  
  static bool
! typeid_ok_p ()
  {
    if (! flag_rtti)
      {
--- 236,242 ----
  }
  
  static bool
! typeid_ok_p (void)
  {
    if (! flag_rtti)
      {
*************** typeid_ok_p ()
*** 256,263 ****
  }
  
  tree
! build_typeid (exp)
!      tree exp;
  {
    tree cond = NULL_TREE;
    int nonnull = 0;
--- 254,260 ----
  }
  
  tree
! build_typeid (tree exp)
  {
    tree cond = NULL_TREE;
    int nonnull = 0;
*************** build_typeid (exp)
*** 297,304 ****
  
  /* Generate the NTBS name of a type.  */
  static tree
! tinfo_name (type)
!      tree type;
  {
    const char *name;
    tree name_string;
--- 294,300 ----
  
  /* Generate the NTBS name of a type.  */
  static tree
! tinfo_name (tree type)
  {
    const char *name;
    tree name_string;
*************** tinfo_name (type)
*** 313,320 ****
     it --- decls in vtables are only used if the vtable is output.  */ 
  
  tree
! get_tinfo_decl (type)
!      tree type;
  {
    tree name;
    tree d;
--- 309,315 ----
     it --- decls in vtables are only used if the vtable is output.  */ 
  
  tree
! get_tinfo_decl (tree type)
  {
    tree name;
    tree d;
*************** get_tinfo_decl (type)
*** 375,382 ****
     cast to the language defined type.  */
  
  static tree
! get_tinfo_ptr (type)
!      tree type;
  {
    tree exp = get_tinfo_decl (type);
    
--- 370,376 ----
     cast to the language defined type.  */
  
  static tree
! get_tinfo_ptr (tree type)
  {
    tree exp = get_tinfo_decl (type);
    
*************** get_tinfo_ptr (type)
*** 390,397 ****
  /* Return the type_info object for TYPE.  */
  
  tree
! get_typeid (type)
!      tree type;
  {
    if (type == error_mark_node || !typeid_ok_p ())
      return error_mark_node;
--- 384,390 ----
  /* Return the type_info object for TYPE.  */
  
  tree
! get_typeid (tree type)
  {
    if (type == error_mark_node || !typeid_ok_p ())
      return error_mark_node;
*************** get_typeid (type)
*** 422,429 ****
     RESULT, it must have previously had a save_expr applied to it.  */
  
  static tree
! ifnonnull (test, result)
!      tree test, result;
  {
    return build (COND_EXPR, TREE_TYPE (result),
  		build (EQ_EXPR, boolean_type_node, test, integer_zero_node),
--- 415,421 ----
     RESULT, it must have previously had a save_expr applied to it.  */
  
  static tree
! ifnonnull (tree test, tree result)
  {
    return build (COND_EXPR, TREE_TYPE (result),
  		build (EQ_EXPR, boolean_type_node, test, integer_zero_node),
*************** ifnonnull (test, result)
*** 435,442 ****
     paper.  */
  
  static tree
! build_dynamic_cast_1 (type, expr)
!      tree type, expr;
  {
    enum tree_code tc = TREE_CODE (type);
    tree exprtype = TREE_TYPE (expr);
--- 427,433 ----
     paper.  */
  
  static tree
! build_dynamic_cast_1 (tree type, tree expr)
  {
    enum tree_code tc = TREE_CODE (type);
    tree exprtype = TREE_TYPE (expr);
*************** build_dynamic_cast_1 (type, expr)
*** 683,690 ****
  }
  
  tree
! build_dynamic_cast (type, expr)
!      tree type, expr;
  {
    if (type == error_mark_node || expr == error_mark_node)
      return error_mark_node;
--- 674,680 ----
  }
  
  tree
! build_dynamic_cast (tree type, tree expr)
  {
    if (type == error_mark_node || expr == error_mark_node)
      return error_mark_node;
*************** build_dynamic_cast (type, expr)
*** 698,705 ****
  /* Return the runtime bit mask encoding the qualifiers of TYPE.  */
  
  static int
! qualifier_flags (type)
!      tree type;
  {
    int flags = 0;
    int quals = cp_type_quals (type);
--- 688,694 ----
  /* Return the runtime bit mask encoding the qualifiers of TYPE.  */
  
  static int
! qualifier_flags (tree type)
  {
    int flags = 0;
    int quals = cp_type_quals (type);
*************** qualifier_flags (type)
*** 713,738 ****
    return flags;
  }
  
! /* Return nonzero, if the pointer chain TYPE ends at an incomplete type, or
     contains a pointer to member of an incomplete class.  */
  
! static int
! target_incomplete_p (type)
!      tree type;
  {
    while (TREE_CODE (type) == POINTER_TYPE)
      if (TYPE_PTRMEM_P (type))
        {
          if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
!           return 1;
          type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
        }
      else
        type = TREE_TYPE (type);
    if (!COMPLETE_OR_VOID_TYPE_P (type))
!     return 1;
    
!   return 0;
  }
  
  /* Return a CONSTRUCTOR for the common part of the type_info objects. This
--- 702,726 ----
    return flags;
  }
  
! /* Return true, if the pointer chain TYPE ends at an incomplete type, or
     contains a pointer to member of an incomplete class.  */
  
! static bool
! target_incomplete_p (tree type)
  {
    while (TREE_CODE (type) == POINTER_TYPE)
      if (TYPE_PTRMEM_P (type))
        {
          if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
!           return true;
          type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
        }
      else
        type = TREE_TYPE (type);
    if (!COMPLETE_OR_VOID_TYPE_P (type))
!     return true;
    
!   return false;
  }
  
  /* Return a CONSTRUCTOR for the common part of the type_info objects. This
*************** target_incomplete_p (type)
*** 742,750 ****
     as comdat, because of pointers to incomplete.) */
  
  static tree
! tinfo_base_init (desc, target)
!      tree desc;
!      tree target;
  {
    tree init = NULL_TREE;
    tree name_decl;
--- 730,736 ----
     as comdat, because of pointers to incomplete.) */
  
  static tree
! tinfo_base_init (tree desc, tree target)
  {
    tree init = NULL_TREE;
    tree name_decl;
*************** tinfo_base_init (desc, target)
*** 826,834 ****
     additional fields to the type_info base.  */
  
  static tree
! generic_initializer (desc, target)
!      tree desc;
!      tree target;
  {
    tree init = tinfo_base_init (desc, target);
    
--- 812,818 ----
     additional fields to the type_info base.  */
  
  static tree
! generic_initializer (tree desc, tree target)
  {
    tree init = tinfo_base_init (desc, target);
    
*************** generic_initializer (desc, target)
*** 842,861 ****
     which adds target type and qualifier flags members to the type_info base.  */
  
  static tree
! ptr_initializer (desc, target, non_public_ptr)
!      tree desc;
!      tree target;
!      int *non_public_ptr;
  {
    tree init = tinfo_base_init (desc, target);
    tree to = TREE_TYPE (target);
    int flags = qualifier_flags (to);
!   int incomplete = target_incomplete_p (to);
    
    if (incomplete)
      {
        flags |= 8;
!       *non_public_ptr = 1;
      }
    init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init);
    init = tree_cons (NULL_TREE,
--- 826,842 ----
     which adds target type and qualifier flags members to the type_info base.  */
  
  static tree
! ptr_initializer (tree desc, tree target, bool *non_public_ptr)
  {
    tree init = tinfo_base_init (desc, target);
    tree to = TREE_TYPE (target);
    int flags = qualifier_flags (to);
!   bool incomplete = target_incomplete_p (to);
    
    if (incomplete)
      {
        flags |= 8;
!       *non_public_ptr = true;
      }
    init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init);
    init = tree_cons (NULL_TREE,
*************** ptr_initializer (desc, target, non_publi
*** 873,898 ****
     base.  */
  
  static tree
! ptm_initializer (desc, target, non_public_ptr)
!      tree desc;
!      tree target;
!      int *non_public_ptr;
  {
    tree init = tinfo_base_init (desc, target);
    tree to = TYPE_PTRMEM_POINTED_TO_TYPE (target);
    tree klass = TYPE_PTRMEM_CLASS_TYPE (target);
    int flags = qualifier_flags (to);
!   int incomplete = target_incomplete_p (to);
    
    if (incomplete)
      {
        flags |= 0x8;
!       *non_public_ptr = 1;
      }
    if (!COMPLETE_TYPE_P (klass))
      {
        flags |= 0x10;
!       *non_public_ptr = 1;
      }
    init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init);
    init = tree_cons (NULL_TREE,
--- 854,876 ----
     base.  */
  
  static tree
! ptm_initializer (tree desc, tree target, bool *non_public_ptr)
  {
    tree init = tinfo_base_init (desc, target);
    tree to = TYPE_PTRMEM_POINTED_TO_TYPE (target);
    tree klass = TYPE_PTRMEM_CLASS_TYPE (target);
    int flags = qualifier_flags (to);
!   bool incomplete = target_incomplete_p (to);
    
    if (incomplete)
      {
        flags |= 0x8;
!       *non_public_ptr = true;
      }
    if (!COMPLETE_TYPE_P (klass))
      {
        flags |= 0x10;
!       *non_public_ptr = true;
      }
    init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init);
    init = tree_cons (NULL_TREE,
*************** ptm_initializer (desc, target, non_publi
*** 913,921 ****
     possible for a type to be both a virtual and non-virtual base.  */
  
  static tree
! dfs_class_hint_mark (binfo, data)
!      tree binfo;
!      void *data;
  {
    tree basetype = BINFO_TYPE (binfo);
    int *hint = (int *) data;
--- 891,897 ----
     possible for a type to be both a virtual and non-virtual base.  */
  
  static tree
! dfs_class_hint_mark (tree binfo, void *data)
  {
    tree basetype = BINFO_TYPE (binfo);
    int *hint = (int *) data;
*************** dfs_class_hint_mark (binfo, data)
*** 942,950 ****
  /* Clear the base's dfs marks, after searching for duplicate bases.  */
  
  static tree
! dfs_class_hint_unmark (binfo, data)
!      tree binfo;
!      void *data ATTRIBUTE_UNUSED;
  {
    tree basetype = BINFO_TYPE (binfo);
    
--- 918,924 ----
  /* Clear the base's dfs marks, after searching for duplicate bases.  */
  
  static tree
! dfs_class_hint_unmark (tree binfo, void *data ATTRIBUTE_UNUSED)
  {
    tree basetype = BINFO_TYPE (binfo);
    
*************** dfs_class_hint_unmark (binfo, data)
*** 956,963 ****
  /* Determine the hint flags describing the features of a class's hierarchy.  */
  
  static int
! class_hint_flags (type)
!      tree type;
  {
    int hint_flags = 0;
    int i;
--- 930,936 ----
  /* Determine the hint flags describing the features of a class's hierarchy.  */
  
  static int
! class_hint_flags (tree type)
  {
    int hint_flags = 0;
    int i;
*************** class_hint_flags (type)
*** 980,989 ****
     which adds hint flags and TRAIL initializers to the type_info base.  */
  
  static tree
! class_initializer (desc, target, trail)
!      tree desc;
!      tree target;
!      tree trail;
  {
    tree init = tinfo_base_init (desc, target);
    
--- 953,959 ----
     which adds hint flags and TRAIL initializers to the type_info base.  */
  
  static tree
! class_initializer (tree desc, tree target, tree trail)
  {
    tree init = tinfo_base_init (desc, target);
    
*************** class_initializer (desc, target, trail)
*** 993,1004 ****
    return init;  
  }
  
! /* Returns nonzero if the typeinfo for type should be placed in
     the runtime library.  */
  
! static int
! typeinfo_in_lib_p (type)
!      tree type;
  {
    /* The typeinfo objects for `T*' and `const T*' are in the runtime
       library for simple types T.  */
--- 963,973 ----
    return init;  
  }
  
! /* Returns true if the typeinfo for type should be placed in
     the runtime library.  */
  
! static bool
! typeinfo_in_lib_p (tree type)
  {
    /* The typeinfo objects for `T*' and `const T*' are in the runtime
       library for simple types T.  */
*************** typeinfo_in_lib_p (type)
*** 1014,1023 ****
      case CHAR_TYPE:
      case REAL_TYPE:
      case VOID_TYPE:
!       return 1;
      
      default:
!       return 0;
      }
  }
  
--- 983,992 ----
      case CHAR_TYPE:
      case REAL_TYPE:
      case VOID_TYPE:
!       return true;
      
      default:
!       return false;
      }
  }
  
*************** typeinfo_in_lib_p (type)
*** 1028,1037 ****
     types will be completed.  */
  
  static tree
! get_pseudo_ti_init (type, var_desc, non_public_p)
!      tree type;
!      tree var_desc;
!      int *non_public_p;
  {
    my_friendly_assert (at_eof, 20021120);
    switch (TREE_CODE (type))
--- 997,1003 ----
     types will be completed.  */
  
  static tree
! get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
  {
    my_friendly_assert (at_eof, 20021120);
    switch (TREE_CODE (type))
*************** get_pseudo_ti_init (type, var_desc, non_
*** 1059,1065 ****
          {
  	  if (!COMPLETE_TYPE_P (type))
  	    /* Emit a non-public class_type_info.  */
! 	    *non_public_p = 1;
  	  return class_initializer (var_desc, type, NULL_TREE);
          }
        else if (var_desc == si_class_desc_type_node)
--- 1025,1031 ----
          {
  	  if (!COMPLETE_TYPE_P (type))
  	    /* Emit a non-public class_type_info.  */
! 	    *non_public_p = true;
  	  return class_initializer (var_desc, type, NULL_TREE);
          }
        else if (var_desc == si_class_desc_type_node)
*************** get_pseudo_ti_init (type, var_desc, non_
*** 1151,1157 ****
     NULL.  */
  
  static tree
! create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
  {
    tree pseudo_type;
    char *pseudo_name;
--- 1117,1123 ----
     NULL.  */
  
  static tree
! create_pseudo_type_info (const char *real_name, int ident, ...)
  {
    tree pseudo_type;
    char *pseudo_name;
*************** create_pseudo_type_info VPARAMS((const c
*** 1199,1206 ****
     translation unit.  */
  
  static tree
! get_pseudo_ti_desc (type)
!      tree type;
  {
    switch (TREE_CODE (type))
      {
--- 1165,1171 ----
     translation unit.  */
  
  static tree
! get_pseudo_ti_desc (tree type)
  {
    switch (TREE_CODE (type))
      {
*************** get_pseudo_ti_desc (type)
*** 1283,1289 ****
     varable definitions.  */
  
  static void
! create_tinfo_types ()
  {
    my_friendly_assert (!ti_desc_type_node, 20020609);
  
--- 1248,1254 ----
     varable definitions.  */
  
  static void
! create_tinfo_types (void)
  {
    my_friendly_assert (!ti_desc_type_node, 20020609);
  
*************** create_tinfo_types ()
*** 1385,1391 ****
     destructor is defined, then the runtime is being built.  */
  
  void
! emit_support_tinfos ()
  {
    static tree *const fundamentals[] =
    {
--- 1350,1356 ----
     destructor is defined, then the runtime is being built.  */
  
  void
! emit_support_tinfos (void)
  {
    static tree *const fundamentals[] =
    {
*************** emit_support_tinfos ()
*** 1437,1449 ****
      }
  }
  
! /* Return nonzero, iff T is a type_info variable which has not had a
     definition emitted for it.  */
  
! int
! unemitted_tinfo_decl_p (t, data)
!      tree t;
!      void *data ATTRIBUTE_UNUSED;
  {
    if (/* It's a var decl */
        TREE_CODE (t) == VAR_DECL
--- 1402,1412 ----
      }
  }
  
! /* Return true, iff T is a type_info variable which has not had a
     definition emitted for it.  */
  
! bool
! unemitted_tinfo_decl_p (tree t, void *data ATTRIBUTE_UNUSED)
  {
    if (/* It's a var decl */
        TREE_CODE (t) == VAR_DECL
*************** unemitted_tinfo_decl_p (t, data)
*** 1459,1491 ****
        && TYPE_FIELDS (TREE_TYPE (t))
        /* which is our pseudo type info */
        && TREE_TYPE (TYPE_FIELDS (TREE_TYPE (t))) == ti_desc_type_node)
!     return 1;
!   return 0;
  }
  
  /* Finish a type info decl. DECL_PTR is a pointer to an unemitted
     tinfo decl.  Determine whether it needs emitting, and if so
     generate the initializer.  */
  
! int
! emit_tinfo_decl (decl_ptr, data)
!      tree *decl_ptr;
!      void *data ATTRIBUTE_UNUSED;
  {
    tree decl = *decl_ptr;
    tree type = TREE_TYPE (DECL_NAME (decl));
!   int non_public;
    int in_library = typeinfo_in_lib_p (type);
    tree var_desc, var_init;
    
    import_export_tinfo (decl, type, in_library);
    if (DECL_REALLY_EXTERN (decl) || !DECL_NEEDED_P (decl))
!     return 0;
  
    if (!doing_runtime && in_library)
!     return 0;
  
!   non_public = 0;
    var_desc = get_pseudo_ti_desc (type);
    var_init = get_pseudo_ti_init (type, var_desc, &non_public);
    
--- 1422,1452 ----
        && TYPE_FIELDS (TREE_TYPE (t))
        /* which is our pseudo type info */
        && TREE_TYPE (TYPE_FIELDS (TREE_TYPE (t))) == ti_desc_type_node)
!     return true;
!   return false;
  }
  
  /* Finish a type info decl. DECL_PTR is a pointer to an unemitted
     tinfo decl.  Determine whether it needs emitting, and if so
     generate the initializer.  */
  
! bool
! emit_tinfo_decl (tree *decl_ptr, void *data ATTRIBUTE_UNUSED)
  {
    tree decl = *decl_ptr;
    tree type = TREE_TYPE (DECL_NAME (decl));
!   bool non_public;
    int in_library = typeinfo_in_lib_p (type);
    tree var_desc, var_init;
    
    import_export_tinfo (decl, type, in_library);
    if (DECL_REALLY_EXTERN (decl) || !DECL_NEEDED_P (decl))
!     return false;
  
    if (!doing_runtime && in_library)
!     return false;
  
!   non_public = false;
    var_desc = get_pseudo_ti_desc (type);
    var_init = get_pseudo_ti_init (type, var_desc, &non_public);
    
*************** emit_tinfo_decl (decl_ptr, data)
*** 1501,1505 ****
    /* Say we've dealt with it.  */
    TREE_TYPE (DECL_NAME (decl)) = NULL_TREE;
  
!   return 1;
  }
--- 1462,1466 ----
    /* Say we've dealt with it.  */
    TREE_TYPE (DECL_NAME (decl)) = NULL_TREE;
  
!   return true;
  }



More information about the Gcc-patches mailing list