1999-12-31 Mark Mitchell * cp-tree.h (VF_NORMAL_VALUE): Remove. * class.c (struct base_info): Remove vfield, vfields, and rtti. (set_primary_base): New function, split out from ... (finish_base_struct): ... here. Rename to ... (determine_primary_base): ... this. Simplify. (create_vtable_ptr): Tweak accordingly. (finish_struct_1): Simplify. * cp-tree.h (CLASSTYPE_VBASECLASSES): Update documentation. (CLASSTYPE_N_BASECLASSES): Likewise. (BINFO_FOR_VBASE): New macro. (get_vbase_types): Change prototype. * class.c (build_vbase_path): Use BINFO_FOR_VBASE. (prepare_fresh_vtable): Likewise. (finish_vtbls): Likewise. (get_class_offset_1): Likewise. (modify_all_indirect_vtables): Likewise. (build_vbase_pointer_fields): Likewise. * decl.c (xref_basetypes): Don't set CLASSTYPE_VBASECLASSES here. * init.c (sort_base_init): Use BINFO_FOR_VBASE. (expand_member_init): Likewise. * search.c (get_base_distance): Likewise. (lookup_field_queue_p): Likewise. (virtual_context): Likewise. (get_vbase_types): Don't return a value. Set CLASSTYPE_VBASECLASSES here. * typeck.c (get_delta_difference): Use BINFO_FOR_VBASE. 1999-12-30 Mark Mitchell * class.c (fixup_inline_methods): Clear CLASSTYPE_INLINE_FRIENDS. 1999-12-29 Mark Mitchell * class.c (create_vtable_ptr): Put the vtable at the beginning of the class, not the end, in the new ABI. * tree.c (propagate_binfo_offsets): Do the right thing for the new ABI. 1999-12-29 Mark Mitchell * cp-tree.h (lang_type): Add nearly_empty_p. Adjust dummy. (CLASSTYPE_NEARLY_EMPTY_P): New macro. * class.c (check_bases): Update CLASSTYPE_NEARLY_EMPTY_P. (check_field_decls): Likewise. (check_bases_and_members): Likewise. 1999-12-28 Mark Mitchell * cp-tree.h (do_inline_function_hair): Remove. * class.c (layout_class_type): New function, split out from finish_struct_1. (fixup_pending_inline): Likewise. (fixup_inline_methods): New function. * method.c (fixup_pending_inline): Remove. (do_inline_function_hair): Likewise. * decl.c (BOOL_TYPE_SIZE): Bools always have size `1' under the new ABI. * cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals. (CLASSTYPE_ABSTRACT_VIRTUALS): Rename to ... (CLASSTYPE_PURE_VIRTUALS): ... this. (lang_decl_flags): Replace abstract_virtual with pure_virtual. (DECL_ABSTRACT_VIRTUAL_P): Rename to ... (DECL_PURE_VIRTUAL_P): ... this. (get_abstract_virtuals): Rename to ... (get_pure_virtuals): ... this. * call.c (build_new_method_call): Replace DECL_PURE_VIRTUAL_P with DECL_ABSTRACT_VIRTUAL_P. Replace CLASSTYPE_ABSTRACT_VIRTUALS with CLASSTYPE_PURE_VIRTUALS. * class.c (build_vtable_entry): Likewise. (finish_struct_bits): Likewise. Call get_pure_virtuals, not get_abstract_virtuals. (build_vtbl_initializer): Likewise. (override_one_vtable): Likewise. (check_methods): Likewise. * decl.c (duplicate_decls): Likewise. (redeclaration_error_message): Likewise. (lang_mark_tree): Likewise. * decl2.c (grok_function_init): Likewise. (import_export_vtable): Likewise. (import_expor_class): Likewise. * typeck2.c (abstract_virtuals_error): Likewise. * xref.c (GNU_xref_member): Likewise. * search.c (get_abstract_virtuals): Rename to get_pure_virtuals. 1999-12-26 Zack Weinberg * cp-tree.h: Replace ENABLE_CHECKING with ENABLE_TREE_CHECKING throughout. 1999-12-26 Mark Mitchell * decl.c (store_return_init): Use mode of old RTL generated for DECL_RESULT, not the mode of DECL_RESULT itself. * semantics.c (finish_named_return_value): Set DECL_UNINLINABLE for functions that used named return values. 1999-12-24 Mark Mitchell * semantics.c (expand_body): Use note_deferral_of_defined_inline_function. 1999-12-22 Mark Mitchell * dump.c (dequeue_and_dump): Handle CTOR_STMTs. 1999-12-22 Alexandre Oliva * error.c (dump_decl): Support named return values. 1999-12-20 Mark Mitchell * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Update comments. (CLASSTYPE_HAS_PRIMARY_BASE_P): New macro. (CLASSTYPE_PRIMARY_BINFO): Likewise. * class.c (check_methods): Don't set TYPE_HAS_COMPLEX_INIT_REF, TYPE_NEEDS_CONSTRUCTING, and CLASSTYPE_NON_AGGREGATE here. (check_bases_and_members): Set them here instead. (create_vtable_ptr): New function, split out from ... (finish_struct_1): ... here. Use it. Tidy. Use CLASSTYPE_HAS_PRIMARY_BASE_P and CLASSTYPE_PRIMARY_BINFO. * search.c (dfs_init_vbase_pointers): Handle seeing TYPE_VFIELD as the first field in the class. * tree.c (layout_basetypes): Use CLASSTYPE_N_BASECLASSES. Handle seeing TYPE_VFIELD as the first field in the class. * cp-tree.h (TYPE_VIRTUAL_P): Rename to ... (TYPE_POLYMORPHIC_P): ... this. (TYPE_USES_COMPLEX_INHERITANCE): Rename to ... (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): ... this. (TREE_CALLS_NEW): Remove. (TREE_MANGLED): Likewise. * call.c (build_vfield_ref): Use TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, and TYPE_POLYMORPHIC_P. * class.c (check_bases): Likewise. (finish_base_struct): Likewise. (finish_struct_bits): Likewise. (check_for_override): Likewise. (finish_struct_1): Likewise. (get_vfield_name): Likewise. * decl.c (xref_basetypes): Likewise. * decl2.c (import_export_class): Likewise. (import_export_decl): Likewise. * error.c (dump_function_decl): Likewise. * pt.c (instantiate_class_template): Likewise. * repo.c (repo_inline_used): Likewise. * rtti.c (build_headof): Likewise. (get_tinfo_fn_dynamic): Likewise. (build_x_typeid): Likewise. (get_tinfo_var): Likewise. (build_dynamic_cast_1): Likewise. (synthesize_tinfo_fn): Likewise. * search.c (lookup_field_1): Likewise. (dfs_debug_mark): Likewise. (maybe_suppress_debug_info): Likewise. * typeck.c (build_component_ref): Likewise. (build_component_addr): Likewise. * typeck2.c (process_init_constructor): Likewise. 1999-12-20 Nathan Sidwell * typeck.c (strip_all_pointer_quals): New static function. (build_static_cast): Use it. Don't use at_least_as_qualified_p. 1999-12-16 Mark Mitchell * cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE. (dso_handle_node): New macro. (flag_use_cxa_atexit): New variable. (declare_global_var): New function. (start_anon_func): Remove declaration. (end_anon_func): Likewise. * decl.c (get_atexit_node): New function, split out from destroy_local_static. Handle flag_use_cxa_atexit. (get_dso_handle_node): Likewise. (start_cleanup_fn): Renamed from start_anon_func. Moved here from except.c. Handle flag_use_cxa_atexit. (end_cleanup_fn): Renamed from end_anon_func. Moved here from except.c. (declare_global_var): New variable. (destroy_local_static): Handle flag_use_cxa_atexit. * decl2.c (flag_use_cxa_atexit): New variable. (lang_f_options): Likewise. * except.c (start_anon_func): Remove. (end_anon_func): Liekwise. * lang-options.h: Add -fuse-cxa-atexit and -fno-use-cxa-atexit. * rtti.c (get_tinfo_var): Use declare_global_var. 1999-12-16 Mark Mitchell * class.c (check_field_decls): Don't return a value. (avoid_overlap): Moved here from tree.c. (build_base_fields): Likewise. (check_bases): New function, split out from finish_base_struct. (check_bases_and_members): New function, split out from finish_struct_1. (struct base_info): Remove cant_have_default_ctor, cant_have_const_ctor, cant_have_asn_ref. (finish_base_struct): Split semantic analysis into check_bases. (finish_struct_methods): Fix bogus assertion. (check_field_decls): Call finish_struct_anon here. (build_vbase_pointer_fields): Use CLASSTYPE_N_BASECLASSES. (finish_struct_1): Use check_bases_and_members. Reorganize. * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation. (build_base_fields): Don't declare. * tree.c (avoid_overlap): Remove. (build_base_fields): Likewise. * optimize.c (struct inline_data): Remove scope_stmt. (remap_block): Don't use insert_block_after_note. Don't update scope_stmt. (expand_call_inline): Don't update scope_stmt. (optimize_function): Don't initialize scope_stmt. * semantics.c (expand_stmt): Set NOTE_BLOCK for newly emitted NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END notes. 1999-12-15 Mark Mitchell * class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS out of the class, rather than taking them as parameters. (build_vbase_pointer_fields): Move here from tree.c. (build_vtbl_or_vbase_field): New function. (check_methods): Likewise. (remove_zero_width_bitfields): Likewise. (add_virtual_function): Use tree_cons instead of temp_tree_cons. (delete_duplicate_fields_1): Tidy. Don't delete duplicate USING_DECLs here. (finish_struct_methods): Handle the case where there are no methods here. (get_basefndecls): Use tree_cons instead of temp_tree_cons. (check_field_decls): Call delete_duplicate_fields here. (finish_struct_1): Tidy. Use check_methods and remove_zero_width_bitfields. * cp-tree.h (build_vbase_pointer_fields): Remove. * decl.c (grokdeclarator): Use tree_cons instead of temp_tree_cons. * decl2.c (qualified_lookup_using_namespace): Use tree_cons instead of temp_tree_cons. * lex.c (cons_up_default_function): Remove dead code. * method.c (fixup_pending_inline): New function, split out from ... (do_inline_function_hair): ... here. * tree.c (build_vbase_pointer_fields): Remove. 1999-12-15 Jason Merrill * tree.c (walk_tree): Walk operand subtrees in forward order. * optimize.c (expand_call_inline): Likewise. (optimize_function): Initialize id->scope_stmt to something useful. (remap_block): Assume id->scope_stmt has a useful value. 1999-12-15 Nathan Sidwell * typeck.c (build_c_cast): Expand warning message. Move pointer alignment warning to after the cast. Don't warn about pointer alignment when given a pointer to incomplete. 1999-12-15 Richard Henderson * cp-tree.h (make_aggr_type): Declare. * lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE. (make_aggr_type): New. * decl.c (build_typename_type, init_decl_processing): Use it. (build_ptrmemfunc_type, xref_tag): Likewise. * except.c (call_eh_info): Likewise. * init.c (init_init_processing): Likewise. * pt.c (process_template_parm, lookup_template_class): Likewise. * rtti.c (expand_class_desc): Likewise. * semantics.c (begin_class_definition, finish_typeof): Likewise. * tree.c (copy_template_template_parm): Likewise. 1999-12-15 Jason Merrill * cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using sizeof (struct tree_common). 1999-12-14 Jason Merrill * optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the outermost block to point to the inlined function decl. * error.c (dump_decl): operator==, not operator ==. (op_to_string): Likewise. * decl.c (compute_array_index_type): Handle null name. * decl2.c (ambiguous_decl): Fix to match comment. (lookup_using_namespace): Adjust. * decl2.c (import_export_class): Don't ignore dllimport. 1999-12-14 Mark Mitchell * class.c (check_field_decls): Split out from ... (finish_struct_1): ... here. Use it. Tidy. * cp-tree.h (remap_save_expr): Add walk_subtrees parameter. * optimize.c (copy_body_r): Pass it. * tree.c (remap_save_expr): Clear walk_subtrees for an already-handled SAVE_EXPR. (cp_unsave_r): Pass walk_subtrees to remap_save_expr. * dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS. * ir.texi (DECL_NAMESPACE_ALIAS): Document it. * error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION. 1999-12-14 Mumit Khan * class.c (finish_base_struct): Allow multiple COM base classes as well as non-COM bases as long as it's not the leftmost. 1999-12-13 Mumit Khan * lex.c (saving_parse_to_obstack): New global. (reinit_parse_for_block): Use. (reinit_parse_for_expr): Use. (check_newline): Use. 1999-12-13 Mark Mitchell * optimize.c (initialize_inlined_parameters): Take FN to which the parameters belong as an argument. (expand_call_inline): Expand calls into the parameter initializations before pushing the function onto the list of functions we are presently expanding. 1999-12-11 Kaveh R. Ghazi * class.c (get_vtable_name): Use a literal format string and VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT. (prepare_fresh_vtable): Likewise. * cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of VTABLE_NAME_FORMAT. * decl.c (make_rtl_for_local_static): Remove unused variable `type'. * init.c (build_vec_init): Initialize variable `try_body'. * lex.c (yyerror): Don't call a variadic function with a non-literal format string. * optimize.c (optimize_function): Call memset, not bzero. * pt.c (for_each_template_parm_r): Add static prototype. 1999-12-09 Andreas Jaeger * except.c (expand_throw): Add static attribute to match prototype. * Makefile.in (semantics.o): Add dependency on output.h. * semantics.c: Include output.h for declaration of make_function_rtl. 1999-12-09 Mark Mitchell * decl.c (init_decl_processing): Reenable inlining on trees. (finish_function): Likewise. * expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here. * semantics.c (simplify_aggr_init_exprs): New function. (expand_body): Use it. * tree.c (walk_tree): Special-case TARGET_EXPRs since they sometimes present the same sub-tree twice. * dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not `csl'. * semantics.c (finish_switch_cond): Do conversions here, not ... * typeck.c (c_expand_start_case): Here. * semantics.c (do_poplevel): Remove unused variable. 1999-12-06 Mark Mitchell * tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE unless we're declaring the variable in question. 1999-12-06 Mark Mitchell * decl.c (init_decl_processing): #if 0 last patch. (finish_function): Likewise. 1999-12-05 Mark Mitchell * decl.c (init_decl_processing): Set flag_inline_trees if !flag_no_inline. * cp-tree.h (calls_setjmp_p): Declare. * decl.c (finish_function): Mark functions that call setjmp as uninlinable. * optimize.c (calls_setjmp_r): New function. (calls_setjmp_p): Likewise. 1999-12-04 Mark Mitchell * optimize.c (expand_call_inline): Wrap the expanded call in an EXPR_WITH_FILE_LOCATION node to get correct line numbers for inlined functions. * optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add in_target_cleanup_p. (remap_decl): New function. (remap_block): Likewise. (copy_scope_stmt): Likewise. (copy_body_r): Use remap_decl and copy_scope_stmt. (copy_body): Use VARRAY_TOP_TREE. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (inlinable_function_p): Check flag_inline_trees. (expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the parameters of the inlined function. (optimize_function): Prevent recursion into partially complete functions. * cp-tree.def (SCOPE_STMT): Take one operand. * cp-tree.h (SCOPE_STMT_BLOCK): New macro. (SCOPE_NULLIFIED_P): Redefine. (SCOPE_NO_CLEANUPS_P): New macro. (add_scope_stmt): Change prototype. * decl.c (poplevel): Tidy. Warn about unused variables here. Record SCOPE_STMT_BLOCKs. (finish_function): Keep DECL_INITIAL for functions that might be inlined. * ir.texi: Document SCOPE_NO_CLEANUPS_P. * semantics.c: Include rtl.h. (add_scope_stmt): Return the new scope statement and, for an end-of-scope statement, its matching begin statement. Don't set SCOPE_NULLIFIED_P. (do_pushlevel): Simplify, now that we are always function-at-a-time. (do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs. (expand_stmt): Don't call expand_start_bindings or expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set. * tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting SCOPE_NULLIFIED_P. * Makefile.in (semantics.o): Depend on RTL_H. * decl2.c (pending_statics_used): Make it a macro. (saved_inlines_used): Likewise. (finish_static_data_member_decl): Use VARRAY_PUSH_TREE. (mark_inline_for_output): Likewise. (ssdf_decls_used): Remove. (start_static_storage_duration_function): Use VARRAY_PUSH_TREE. (generate_ctor_or_dtor_function): Adjust accordingly. 1999-11-24 Geoffrey Keating Greg McGary * decl.c (duplicate_decls): Merge DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK. 1999-12-02 Mike Stump * init.c (perform_member_init): Handle parse errors better. 1999-12-01 Mark Mitchell * cp-tree.h (min_tree_cons): Remove. (scratch_ovl_cons): Likewise. * decl.c (saveable_obstack): Don't declare. (duplicate_decls): Tweak error-message. (initialize_local_var): Explicitly mark the definition as static. (finish_function): Call permanent_allocation, just so that the middle-end sees the obstacks it expects. (mark_cp_function_context): Likewise. * init.c (build_new): Don't use min_tree_cons. * lex.c (permanent_obstack): Don't declare. (current_obstack, saveable_obstack): Likewise. * spew.c (current_obstack, saveable_obstack): Likewise. * tree.c (current_obstack, saveable_obstack): Likewise. (scratch_ovl_cons): Remove. (build_min_nt): Don't mess with obstacks. (build_min): Likewise. (min_tree_cons): Remove * typeck.c (build_component_ref): Don't use scratch_ovl_cons. (build_x_function_call): Likewise. (build_c_cast): Don't use min_tree_cons. 1999-11-29 Mark Mitchell * pt.c (tsubst_decl): Robustify. 1999-11-27 Mark Mitchell * decl2.c (finish_file): Call expand_body for inline functions that will be written out but that do not yet have RTL. * semantics.c (expand_body): Do not generate RTL For inline functions that do not yet need to be written out. 1999-11-25 Mark Mitchell * Make-lang.in (CXX_SRCS): Add optimize.c. * Makefile.in (CXX_OBJS): Add optimize.o. (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H). (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust. (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise. (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise. (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise. (dump.o): Likewise. (optimize.o): New target. * class.c: Don't include splay-tree.h. * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT. * cp-tree.h: Include splay-tree.h. (DECL_UNINLINABLE): New macro. (CTOR_BEGIN_P, CTOR_END_P): New macros. (flag_inline_trees): New variable. (local_variable_p): New function. (nonstatic_local_decl_p): Likewise. (optimize_function): Likewise. (cplus_unsave_expr_now): Remove. (copy_tree_r): Declare. (remap_save_expr): Likewise. * decl.c (local_variable_p): Don't make it static. (local_variable_p_walkfn): New function. (make_rtl_for_local_static): Remove code to try to avoid writing out static constants. (emit_local_var): Fix indentation. (nonstatic_local_decl_p): New function. (check_default_argument): Use local_variable_p_walkfn, not local_variable_p, when walking the tree. (start_function): Set the DECL_CONTEXT for automatically generated labels. (finish_constructor_body): Use CTOR_STMT to mark the end of a constructor. * decl2.c: Don't include splay-tree.h. (flag_inline_trees): Define. * dump.c: Don't include splay-tree.h. * except.c (expand_end_catch_block): Fix comment formatting. (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables. (expand_throw): Tidy comment. * init.c (build_vec_delete_1): Use create_temporary_var. * lex.c (cplus_tree_code_type): Make it static. (cplus_tree_code_length): Likewise. (cplus_tree_code_name): Likewise. * optimize.c: New file. * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions with computed gotos. (setup_vtbl_ptr): Mark the beginnings of constructors with CTOR_STMT. (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE. (expand_body): Call optimize_function. Save bodies if we're doing inlining on trees. * tree.c: Don't include splay-tree.h. Include insn-config.h and integrate.h. (copy_tree_r): Make it public. (statement_code_p): New function. (mark_local_for_remap_r): Likewise. (cp_usave_r): Likewise. (cp_unsave): Likewise. (build_cplus_new): Set DECL_CONTEXT for temporary variables. (walk_tree): Walk into `s' class nodes. Walk statement chains. (copy_tree_r): Handle 's' class nodes. Restore chains for statements. Nullify scopes. Don't copy types. (init_tree): Set lang_unsave to cp_unsave. (remap_save_expr): Define. * ir.texi: Document CTOR_STMT. 1999-11-24 Jason Merrill * search.c (note_debug_info_needed): Do perform this optimization for dwarf2. (maybe_suppress_debug_info): Likewise. Start by clearing TYPE_DECL_SUPPRESS_DEBUG. 1999-11-24 Mark Mitchell * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs. * decl2.c (finish_vtable_vardecl): Don't prune vtables here. 1999-11-23 Kaveh R. Ghazi * decl.c (pushdecl, grokdeclarator): Don't call a variadic function with a non-literal format string. * lex.c (do_identifier): Likewise. * typeck.c (build_unary_op): Likewise. 1999-11-23 Mark Mitchell * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation. 1999-11-22 Mark Mitchell * cp-tree.def (CTOR_COMPLETE): New tree node. * decl.c (finish_constructor_body): Add it, to mark the end of the constructor. (finish_function): Don't call end_protect_partials here. * ir.texi (CTOR_COMPLETE): Document it. * semantics.c (expand_stmt): Handle it. * cp-tree.def (FUNCTION_NAME): New tree node. * cp-tree.h (current_function_name_declared): Tweak documentation. (lang_decl_flags): Add pretty_function_p, adjust dummy. (DECL_PRETTY_FUNCTION_P): New macro. * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__, etc., in a template function. Use at_function_scope_p instead of expanding it inline. * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations specially. (tsubst): Handle FUNCTION_NAME. (tsubst_copy): Likewise. (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__, etc. in instantiation. * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc., even in template functions. (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the conditional scope at the top of a destructor. * error.c (dump_function_decl): Use `[ with ... ]' syntax for specializations too. 1999-11-22 Nathan Sidwell * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT when actually negative. * typeck.c (convert_for_assignment): Expand comment about strange NULL check, moved from ... (convert_for_initialization): ... here. Remove unneeded code. 1999-11-21 Alexandre Oliva * cp-tree.h (build_vec_delete): Remove `auto_delete' argument. * init.c (build_vec_delete, build_vec_delete_1): Likewise. Always destruct virtual bases of array components, but never delete them. (build_vec_init): Adjust invocations. (build_delete): Likewise. * decl2.c (delete_sanity): Likewise. 1999-11-19 Nathan Sidwell * cp-tree.h (grok_method_quals): Return this pointer qualifiers. * decl.c (grokdeclarator): Adjust calls to grok_method_quals. * decl2.c (grok_method_quals): Accept `restrict' as applying to the object pointer. Return such qualifiers. (grokclassfn): Apply this pointer qualifiers. Cleanup unused variables. 1999-11-18 Mark Mitchell * except.c (expand_end_catch_block): Fix typo. (expand_exception_blocks): Simplify. Don't call expand_leftover_cleanups. 1999-11-15 Jason Merrill * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic. * pt.c (tsubst, case INTEGER_TYPE): Call it. Check uses_template_parms. * class.c (finish_struct): If we're a local class in a template function, add a TAG_DEFN. * pt.c (lookup_template_class): If this is a local class in a template function, call pushtag. (tsubst_expr, case TAG_DEFN): Handle classes, too. Emit debug info with the vtable. * search.c (maybe_suppress_debug_info): New function... * class.c (finish_struct_1): ...split out from here. * cp-tree.h: Declare it. * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG if we're writing out the vtable. * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p, note_debug_info_needed): #if 0 out. 1999-11-14 Mark Mitchell * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro. * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not TREE_PERMANENT. * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P. * decl2.c (lookup_arg_dependent): Use it. * cp-tree.h (cp_finish_decl): Change prototype. (finish_static_data_member_decl): Likewise. (push_permanent_obstack): Remove declaration. (push_expression_obstack): Likewise. (push_scratch_obstack): Likewise. (DECL_TEMPLATE_PARM_P): Robustify. (SET_DECL_TEMPLATE_PARM_P): New macro. * class.c (add_method): Don't manipulate obstacks. (finish_vtbls): Likewise. * cvt.c (build_up_reference): Adjust calls to cp_finish_decl. * decl.c (binding_for_name): Don't manipulate obstacks. (maybe_push_to_top_level): Likewise. (pop_from_top_level): Likewise. (duplicate_decls): Likewise. (pushdecl): Likewise. (implicitly_declare): Likewise. (build_typename_type): Likewise. (start_decl): Likewise. (cp_finish_decl): Likewise. (finish_decl): Likewise. (destroy_local_static): Likewise. (expand_static_init): Likewise. (complete_array_type): Likewise. (grokvardecl): Likewise. (build_ptrmemfnc_type): Likewise. (grokdeclarator): Likewise. (xref_tag): Likewise. (xref_basetypes): Likewise. (start_enum): Likewise. (finish_enum): Likewise. (start_function): Likewise. (finish_function): Likewise. (start_method): Adjust call to cp_finish_decl. * decl2.c (finish_static_data_member_decl): Don't manipulate obstacks. (grokfield): Likewise. (grokbitfield): Likewise. (get_temp_name): Likewise. (get_sentry): Likewise. (fnish_file): Likewise. (lookup_arg_dependent): Likewise. * except.c (call_eh_info): Likewise. (push_eh_info): Likewise. (do_pop_exception): Likewise. (initialize_handler_parm): Likewise. (expand_end_eh_spec): Likewise. (alloc_eh_object): Likewise. (expand_throw): Likewise. * expr.c (extract_scalar_init): Likewise. * init.c (build_java_class_ref): Likewise. * lex.c (get_time_identifier): Likewise. (snarf_defarg): Likewise. (add_defarg_fn): Likewise. (is_global): Simplify. (do_identifier): Don't check TREE_PERMANENT. * method.c (emit_thunk): Don't manipulate obstacks. * parse.y (condition): Adjust call to cp_finish_decl. (primary): Likewise. (initdcl): Likewise. (initdcl0_innards): Likewise. (nomods_initdcl0): Likewise. * pt.c (push_inline_template_parms_recursive): Use SET_DECL_TEMPLATE_PARM_P. (process_template_parm): Likewise. (lookup_template_class): Don't manipulate obstacks. (instantiate_class_template): Adjust call to finish_static_data_member_decl. (tsubst_decl): Don't manipulate obstacks. (tsubst_expr): Likewise. (instantiate_template): Likewise. (instantiate_decl): Adjust calls to cp_finish_decl. * rtti.c (call_void_fn): Don't manipulate obstacks. (get_tinfo_var): Likewise. (get_tinfo_fn_unused): Likewise. (build_dynamic_cast_1): Likewise. (expand_si_desc): Likewise. (expand_class_desc): Likewise. (expand_ptr_desc): Likewise. (expand_attr_desc): Likewise. (expand_generic_desc): Likewise. (synthesize_tinfo_fn): Likewise. * search.c (expand_upcast_fixups): Likewise. * semantics.c (finish_asm_stmt): Likewise. (finish_named_return_value): Likewise. (begin_class_definition): Likewise. (finish_class_definition): Likewise. (finish_typeof): Likewise. * tree.c (build_cplus_method_type): Likewise. (reverse_path): Likewise. (copy_template_template_parm): Likewise. (build_expr_ptr_wrapper): Likewise. (push_expression_obstack): Remove. (push_permanent_obstack): Likewise. * typeck.c (mark_addressable): Likewise. 1999-11-13 Mark Mitchell * call.c (build_conditional_expr): Use build_target_expr_with_type. (convert_like): Likewise. (build_over_call): Likewise. * cp-tree.h (build_target_expr): Remove. (build_target_expr_with_type): New function. * cvt.c (build_up_reference): Use get_target_expr. * decl.c (build_target_expr): Move to ... * tree.c (build_target_expr): Here. Make it static. (build_target_expr_with_type): New function. Set DECL_CONTEXT on the temporary VAR_DECLs. (get_target_expr): Use it. 1999-11-13 Jason Merrill * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT. * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT. * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn. * class.c (set_rtti_entry): Use it. 1999-11-12 Mark Mitchell * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups here. * semantics.c (finish_expr_stmt): Call it here instead. Move default_conversion logic to semantic-analysis time. 1999-11-12 Jason Merrill * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT. Fri Nov 12 12:56:32 MST 1999 Diego Novillo * init.c (init_init_processing): Re-instated Nov 11 patch after approval. Fri Nov 12 10:42:02 MST 1999 Diego Novillo * init.c (init_init_processing): Undo patch from Nov 11, 1999. Patch had not been approved yet. 1999-11-12 Mark Mitchell * decl.c (compute_array_index_type): New function, split out from grokdeclarator. (create_array_type_for_decl): Likewise. (grokdeclarator): Use them. * semantics.c (expand_stmt): Don't suspend_momentary or resume_momentary. Thu Nov 11 12:42:11 MST 1999 Diego Novillo * init.c (init_init_processing): Header information for arrays allocated via `new' should have the same alignment used by malloc. 1999-11-10 Mark Mitchell * error.c (dump_function_name): Don't crash if given a friend pseudo-instantiation. * cp-tree.h (build_enumerator): Change prototype. * decl.c (enum_next_value): Remove. (enum_overflow): Likewise. (init_decl_processing): Don't register enum_next_value as a root. (start_enum): Clear TYPE_VALUES for a redefined enum. (finish_enum): Reset the type of enumeration constants. (build_enumerator): Fix indentation. Don't copy CONST_DECLs when we don't need to. Maintain the TYPE_VALUES list and look there for the previously defined enumeration constant. Let enumeration constants have the type of their values until the enumeration type is complete. * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value. (structsp): Adjust. * parse.c: Regenerated. * pt.c (tsubst_enum): Adjust according to build_enumerator changes. Wed Nov 10 12:43:21 1999 Philippe De Muyter Kaveh R. Ghazi * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. 1999-11-09 Mark Mitchell * cp-tree.h (language_function): Remove x_last_dtor_insn and x_last_parm_cleanup_insn. * decl.c (last_dtor_insn): Remove. (last_parm_cleanup_insn): Likewise. (expand_start_early_try_stmts): Don't set them. (store_parm_decls): Likewise. (save_function_data): Or save them. (mark_lang_function): Or mark them. 1999-11-08 Mark Mitchell * decl.c (store_parm_decls): Generate cleanup code at semantic-analysis time. Destroy objects in the correct order. 1999-11-07 Mark Mitchell * cp-tree.h (begin_new_placement): Remove. (finish_new_placement): Likewise. * class.c (finish_struct_1): Don't suspend_momentary or resume_momentary. * decl.c (grokdeclarator): Likewise. (maybe_build_cleanup_1): Likewise. * except.c (push_eh_cleanup): Likewise. (build_terminate_handler): Likewise. * init.c (build_new_1): Likewise. * parse.y (parse_decl): Change prototype. (initdecls, notype_initdecls, initdcl): Don't return int. (initdcl0, notype_initdcl0, initdcl0_innards): Likewise. (.begin_new_placement): Remove. (.finish_new_placement): Likewise. (nonmomentary_expr): Likewise. (suspend_mom): Likewise. (condition): Don't suspend_momentary, resume_momentary, or keep track of need to resume. (unary_expr): Likewise. (new_placement): Likewise. (decl): Likewise. (structsp): Likewise. (new_type_id): Likewise. (maybe_parmlist): Likewise. (direct_after_type_declaration): Likewise. (direct_new_declarator): Likewise. (direct_abstract_declaration): Likewise. * parse.c: Regenerated. * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary. * semantics.c (begin_new_placement): Remove. (finish_new_placement): Likewise. 1999-11-05 Martin v. Löwis * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. (DECL_TEMPLATE_INFO): Use it. * decl.c (warn_extern_redeclared_static): Do nothing for TEMPLATE_DECLs. * decl2.c (mark_used): Explicitly check for function or variable. * semantics.c (finish_unary_op_expr): Check whether result is also an INTEGER_CST. 1999-11-05 Mark Mitchell * Makefile.in (typeck2.o): Depend on output.h. * typeck2.c: Include output.h. * decl.c (flag_ansi): Remove declaration. * pt.c (tinst_level_tick): Make it static. (last_template_error_tick): Likewise. * cp-tree.h (mapcar): Remove declaration. (search_tree): Likewise. (walk_tree_fn): New typedef. (walk_tree): New function. * tree.c (bot_manip): Change prototype. Adjust to be called via walk_tree. (bot_replace): Likewise. (no_linkage_helper): Likewise. (copy_tree_r): New function. (search_tree): Rename, and adjust, to become ... (walk_tree): New function. (mapcar): Remove. (target_remap): Remove. (target_remap_count): Likewise. (break_out_target_exprs): Use walk_tree. * decl.c (local_variable_p): Change prototype. (check_default_argument): Use walk_tree. * pt.c (for_each_template_parm_r): New function, split out from ... (for_each_template_parm): Here. Use it, via walk_tree. 1999-11-03 Mark Mitchell * class.c (check_bitfield_decl): New function, split out from finish_stuct_1. (check_field_decl): Likewise. Recursively examine members of anonymous structs. (finish_struct_1): Use them. * cp-tree.h (ANON_UNION_TYPE_P): New macro. 1999-11-02 Mark Mitchell * decl.c (grokfndecl): Remove dead code. * dump.c (dequeue_and_dump): Fix thinko for catch-clauses. 1999-11-02 Scott Snyder * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and IMAGPART_EXPR. * pt.c (tsubst_copy): Likewise. 1999-11-01 Jason Merrill * decl2.c (maybe_make_one_only): Always make things comdat on ELF targets, too. 1999-10-31 Mark Mitchell * decl.c (finish_function): Call free_after_parsing for functions we are not immediately turning into RTL. 1999-10-31 Brendan Kehoe * cp-tree.h (flag_dump_translation_unit): Add decl. Sat Oct 30 22:42:50 1999 Stephen L Moshier * lex.c (yylex): Accept 'f' in mantissa of hex float constant. 1999-10-30 Mark Mitchell * decl.c (pop_cp_function_context): Don't call free on a NULL pointer. * semantics.c: Include ggc.h. (expand_body): Do garbage-collection after processing a template function. Clear DECL_SAVED_TREE after generating RTL for a function. * Makefile.in (semantics.o): Depend on ggc.h. 1999-10-29 Mark Mitchell * cp-tree.h (make_typename_type): Change prototype. * decl.c (make_typename_type): Only complain if so requested. * parse.y (nested_name_specifier): Adjust calls. (typename_sub0): Likewise. (typename_sub1): Likewise. * parse.c: Regenerated. * pt.c (convert_template_argument): Pass complain to make_typename_type. (tsubst): Likewise. 1999-10-28 Mark Mitchell * semantics.c (finish_handler): End the scope of the handler before attaching it to the statement-tree. 1999-10-28 Ian Lance Taylor * rtti.c (build_dynamic_cast_1): Give a better error message for an attempt to dynamic_cast from a non-polymorphic type. 1999-10-27 Mark Mitchell * cp-tree.h (make_temp_vec): Remove. (make_scratch_vec): Likewise. * call.c (add_function_candidate): Use make_tree_vec. (add_conv_candidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Likewise. * class.c (resolve_address_of_overloaded_function): Likewise. * decl.c (start_function): Don't fool with the momentary obstack. (finish_function): Likewise. * init.c (expand_direct_vtbls_init): Likewise. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. * pt.c (add_to_template_args): Use make_tree_vec. (check_explicit_specialization): Likewise. (coerce_template_parms): Likewise. (lookup_template_class): Don't fool with the momentary obstack. (instantiate_class_template): Likewise. (tsubst_template_arg_vector): Use make_tree_vec. (tsubst_aggr_type): Don't fool with the momentary obstack. (tsubst_decl): Likewise. Use make_tree_vec. (try_one_overload): Likewise. (try_class_unification): Don't fool with the momentary obstack. (get_bindings_real): Use make_tree_vec. (set_mangled_name_for_template_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack. * semantics.c (finish_expr_stmt): Likewise. (finish_do_stmt): Likewise. (finish_for_expr): Likewise. (finish_switch_cond): Likewise. (do_pushlevel): Likewise. (do_poplevel): Likewise. * tree.c (make_temp_vec): Remove. * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump CLEANUP_P for a TRY_BLOCK. * ir.texi: Document SAVE_EXPR. Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com) * call.c (build_over_call): Check that the built-in function is of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS. * typeck.c (build_function_call_real): Similarly. 1999-10-26 Mark Mitchell * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call remember_end_note. 1999-10-24 Mark Mitchell * decl.c (push_overloaded_decl_1): Use pushdecl. * decl.c (auto_function): Replace #ifdef'd __inline with just plain inline. * lex.c (my_get_run_time): Likeise. (yyprint): Likewise. (identifier_type): Likewise. * method.c (start_squangling): Likewise. (end_squangling): Likewise. (icat): Likewise. (old_backref_index): Likewise. (flush_repeats): Likewise. (issue_ktype): Likewise. * parse.y (empty_parms): Likewise. * parse.c: Regenerated. 1999-10-21 Mark Mitchell * dump.c (dequeue_and_dump): Replace several uses of queue_and_dump_index with dump_child. 1999-10-21 Kaveh R. Ghazi * expr.c: Include tm_p.h. 1999-10-21 Mark Mitchell * cp-tree.h (SCOPE_PARTIAL_P): New macro. (pushlevel_temporary): Remove. (add_scope_stmt): New function. * decl.c (pushlevel_temporary): Remove. (poplevel): Use add_scope_stmt. (start_decl_1): Likewise. * semantics.c (add_scope_stmt): New function. (do_pushlevel): Use it. (do_poplevel): Use it. (expand_stmt): Check SCOPE_PARTIAL_P. * cp-tree.def (EMPTY_CLASS_EXPR): New tree node. * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR. * expr.c (cplus_expand_expr): Expand it. * ir.texi: Document EMPTY_CLASS_EXPR. 1999-10-20 Mark Mitchell * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template parameters as having namespace scope. 1999-10-19 Mark Mitchell * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove. (mangling_flags): New type. (build_overload_int): Change prototype. (build_overload_value): Likewise. (numeric_output_need_bar): Improve comment. (mangle_expression): New function, broken out from ... (build_overload_int): Here. (build_overload_value): Adjust for use of mangling flags. Don't warn about real-valued template parameters here. Do handle complex expressions involving real-valued template parameters. (build_template_parm_names): Encase non-type template parameters in underscores, if necessary. (process_overload_item): Remove conditional on PARM_CAN_BE_ARRAY_TYPE. 1999-10-17 Mark Mitchell * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR. * ir.texi: Clean up documentation of RETURN_INIT. 1999-10-15 Greg McGary * lex.c (lang_init_options): Set flag_bounds_check as "unspecified". (lang_init): Set default for flag_bounds_check if still "unspecified". 1999-10-13 Andrew Haley * class.c (finish_struct_1): Force alignment of non-bitfields to BITS_PER_UNIT. Wed Oct 13 22:01:35 1999 J"orn Rennecke * typeck2.c (process_init_constructor): Handle empty constructors. 1999-10-13 Jason Merrill * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL. * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size array error. 1999-10-13 Mark Mitchell * decl.c (make_rtl_for_local_static): Don't create register RTL for addressable constants. 1999-10-13 Nathan Sidwell * cp-tree.h (build_x_va_arg): Prototype new function. * call.c (build_x_va_arg): Define it. * parse.y (unary_expr): Call build_x_va_arg. * cp-tree.h (convert_type_from_ellipsis): Prototype new function. * call.c (convert_type_from_ellipsis): Define it. * decl.c (init_decl_processing): Set lang_type_promotes_to. * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates. 1999-10-11 Jason Merrill * class.c (fixed_type_or_null): Always set *nonnull. 1999-10-10 Kaveh R. Ghazi * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing __GNUC__ and __GNUC_MINOR__. 1999-10-09 Mark Mitchell * cp-tree.h (make_rtl_for_local_static): New function. * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for local statics ... (make_rtl_for_local_static): Here. * semantics.c (expand_stmt): Use make_rtl_for_local_static. 1999-10-08 Kaveh R. Ghazi * method.c: Include tm_p.h. 1999-10-7 Franz Sirl * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type. * lex.c (cp_make_lake_type): Likewise. * tree.c (init_tree): Init make_lang_type_fn. 1999-10-07 Mark Mitchell * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch parameter. * semantics.c (expand_stmt): Don't pretend to have asmspecs for local statics if we don't really have them. * ir.texi: Improve documentation for STMT_EXPR. Describe CLEANUP_POINT_EXPR. 1999-10-07 Jason Merrill * class.c (build_vtable_entry_ref): Use finish_asm_stmt. 1999-10-07 Greg McGary * class.c (finish_struct_1): Use simpler method of removing elements of a singly-linked list which doesn't lose for classes without data members. 1999-10-07 Mark Mitchell * friend.c (make_friend_class): Robustify. * semantics.c (finish_object_call_expr): Reject calls to template types. 1999-10-06 Mark Mitchell * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR. * cp-tree.h (CLASSTYPE_VFIELD): Remove. * call.c (build_vfield_ref): Use TYPE_VFIELD, not CLASSTYPE_VFIELD. * class.c (get_vfield_offset): Likewise. (finish_base_struct): Likewise. (modify_one_vtable): Likewise. (fixup_vtable_deltas): Likewise. (finish_struct_1): Likewise. * init.c (expand_virtual_init): Likewise. * search.c (lookup_field_1): Likewise. (expand_upcast_fixups): Likewise. * typeck.c (build_component_ref): Likewise. (build_binary_op_nodefault): Likewise. * dump.c (dqueue_and_dump): Dump TYPE_VFIELD. * ir.texi: Document TYPE_VFIELD. 1999-10-06 Brendan Kehoe * decl.c (grokdeclarator): Only warn about nonzero arrays if !in_system_header (linux socketbits.h can give this for __cmsg_data, which is using a GNU extension). 1999-10-05 Mark Mitchell * decl2.c (start_static_storage_duration_function): Push the function declaration so it ends up in namespace scope. * dump.c (DUMP_CHILDREN): Remove. (DUMP_BINFO): Adjust. (struct dump_node_info): Remove dump_children_p. (queue_and_dump_type): Remove dump_children_p parameter. (queue): Don't set dump_children_p. (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to queue_and_dump_index. (dequeue_and_dump): Unconditionally print children. Adjust calls to functions mentioned above. (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue. * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR. * dump.c (dequeue_and_dump): Dump them. * method.c (synthesize_method): Call setup_vtbl_ptr for destructors. * decl.c (start_function): Set current_in_charge_parm for constructors, too, where appropriate. * search.c (fixup_all_virtual_upcast_offsets): New function. (expand_indirect_vtbls_init): Use it. 1999-10-04 Nathan Sidwell * decl2.c (grok_alignof): Don't decay lvalues. * init.c (build_new): Remove unused variable. 1999-10-04 Mark Mitchell * cp-tree.h (struct language_function): Remove static_labelno. (static_labelno): Remove macro. * method.c (build_overload_nested_name): Make static_labelno static here. * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL, to decide whether or not a function is defined. * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for situations where make_node will do it automatically. * decl.c (grok_reference_init): Likewise. (expand_static_init): Likewise. (do_static_initialization): Likewise. * init.c (perform_member_init): Likewise. (expand_aggr_init_1): Likewise. (build_new_1): Likewise. * method.c (do_build_copy_constructor): Likewise. (do_build_assign_ref): Likewise. * search.c (expand_upcast_fixups): Likewise. * semantics.c (finish_stmt_expr): Likewise. * typeck.c (build_unary_op): Likewise. (check_return_expr): Likewise. 1999-10-04 Jason Merrill * init.c (build_vec_delete_1): Fold COND_EXPRs. 1999-10-03 Mark Mitchell * cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.h (struct stmt_tree): New type. (struct saved_scope): Remove firstobj. Add x_saved_tree, x_stmt_tree. (class_cache_firstobj): Remove. (struct language_function): Remove stmts_are_full_exprs_p, x_last_tree, and x_last_expr_type. Add x_stmt_tree. (current_stmt_tree): New macro. (last_tree): Adjust. (last_expr_type): Likewise. (doing_semantic_analysis_p): Simplify. (stmts_are_full_exprs_p): Adjust. (begin_tree): Remove prototype. (end_tree): Likewise. (begin_stmt_tree): Change prototype. (finish_stmt_tree): Likewise. (building_stmt_tree): Simplify. * decl.c (mark_stmt_tree): New function. (mark_saved_scope): Use it. (start_function): Rearrange slightly to call begin_stmt_tree earlier. (save_function_data): Tweak. (finish_function): Adjust call to finish_stmt_tree. (mark_lang_function): Use mark_stmt_tree. * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR. * init.c (build_new_1): Remove creation of VEC_INIT_EXPR. (build_vec_init): Remove creation of stand-in initializer. * pt.c (begin_tree): Remove. (end_tree): Likewise. * semantics.c (SET_LAST_STMT): New macro. Use it throughout. (begin_compound_stmt): Handle a compound-statement outside of a function. (begin_stmt_expr): Handle a statement-expression outsidef of a function. (finish_stmt_expr): Likewise. (begin_class_definition): Don't call begin_tree. (finish_inline_definitions): Don't call end_tree. (begin_stmt_tree): Take a pointer to tree, not a function as input. (finish_stmt_tree): Likewise. * tree.c (search_tree): Don't handle VEC_INIT_EXPR. (mapcar): Likewise. * parse.y (simple_stmt): Don't call finish_stmt unnecessarily. * parse.c: Regenerated. * dump.c (dqueue_and_dump): Dump bitfieldness. * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for bitfields, rather than DECL_BIT_FIELD. * ir.texi: Document how to tell whether or not a field is a bitfield. * lex.c (make_lang_type): Fix typo in comment. 1999-10-01 Jason Merrill * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. 1999-10-01 Mark Mitchell * pt.c (tsubst_decl): If the type of a template instantiation is bogus, so is the whole instantiation. 1999-09-30 Mark Mitchell * decl.c (initialize_local_var): Handle static variables here. (cp_finish_decl): Tweak handling of function-scope static variables. * semantics.c (expand_stmt): Handle DECL_STMTs for static variables. * method.c (emit_thunk): Don't crash when -fsyntax-only. * cp-tree.h (lang_decl_flags): Add global_ctor_p and global_dtor_p. Add init_priority. (DECL_ACCESS): Adjust accordingly. (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros. (GLOBAL_INIT_PRIORITY): Likewise. * decl.c (lang_mark_tree): Adjust accordingly. (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P, and GLOBAL_INIT_PRIORITY. * dump.c (dequeue_and_dump): Print them. * ir.texi: Document them. * decl2.c (struct priority_info_s): Remove initialization_sequence and destruction_sequence. (start_static_storage_duration_function): Return the body of the function. Convert for function-at-a-time mode. (generate_inits_for_priority): Remove. (finish_static_storage_duration_function): Change prototype. Adjust for function-at-a-time mode. (do_static_initialization): Likewise. (do_static_destruction): Likewise. (do_static_initialization_and_destruction): Remove. (start_static_initialization_or_destruction): New function. (finish_static_initialization_or_destruction): Likewise. (get_priority_info): Don't manipulation initialization_sequence or destruction_sequence. (prune_vars_needing_no_initialization): New function. (write_out_vars): Likewise. (finish_file): Use the various new functions instead of the old. Thu Sep 30 00:13:27 1999 Dirk Zoller * cp-tree.h (warn_float_equal): Declare. * decl2.c (warn_float_equal): Define. (lang_decode_option): Recognize -W[no-]float-equal. * typeck.c (build_binary_op_nodefault): Conditionally warn about equality tests of floating point types. 1999-09-29 Jason Merrill Support normal type_info-based EH mechanisms with -fno-rtti. * except.c (build_eh_type_type): Remove special -fno-rtti handling. (build_eh_type_type_ref): Likewise. (build_eh_type): Remove. (expand_throw): Call build_eh_type_type, not build_eh_type. * decl2.c (import_export_decl): Don't associate the tinfo fn with the vtable if -fno-rtti. * decl.c (init_decl_processing): Always init_rtti_processing. * rtti.c (get_typeid): Don't complain about -fno-rtti. * class.c (class_cache_obstack, class_obstack): Remove. (init_class_processing): Don't initialize class_obstack. (push_cache_obstack): Remove. (pushclass): Don't call it. * cp-tree.h: Remove prototype for push_cache_obstack. * decl.c (decl_obstack, decl_stack, push_decl_level): Remove. (pushlevel_class): Don't push_decl_level. (poplevel_class): Don't pop_stack_level. (push_class_level_binding): Don't push_cache_obstack. (init_decl_processing): Don't initialize decl_obstack. * search.c (push_class_decls): Don't push_cache_obstack. * tree.c (list_hash_add): Put hash node on permanent_obstack. (hash_tree_cons): Don't mess with obstacks. (print_lang_statistics): Don't print stats for class_obstack and decl_obstack. 1999-09-29 Mark Mitchell * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL. * ir.texi: Document DECL_EXTERNAL. * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs. * ir.texi: Document THUNK_DECLs. * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c. (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise. (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise. * error.c (dump_template_bindings): Remove unused parameter. Handle multiple levels of template parameters. (dump_template_decl): Use `parms', not `args', for template parameters. Fix thinko. (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass flags to dump_template_bindings. * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h. (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise. (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise. (tsubst_copy): Clarify variable name. (most_general_template): Robustify. 1999-09-29 Nathan Sidwell * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME to change primary template rendering. 1999-09-29 Mark Mitchell * cp-tree.h (UPT_TEMPLATE): Remove. (UPT_PARMS): Likewise. (DECL_NEEDED_P): New macro. * decl2.c (finish_vtable_vardecl): Use it. (finish_objects): Don't crash with -fsyntax-only. (finish_file): Use DECL_NEEDED_P. Don't prune vtables when -fsyntax-only. * pt.c (tsubst_friend_function): Remove FIXME that talks about obstacks. (tsubst_expr): Correct handling of function try-blocks. * semantics.c: Include flags.h. (expand_body): Don't do RTL generation if -fsyntax-only. * Makefile.in (semantics.o): Depends on flags.h. 1999-09-28 Gabriel Dos Reis * pt.c (most_general_template): Adjust declaration. * cp-tree.h: (most_general_template): Declare. * error.c (dump_template_value): Rename to ... (dump_template_argument): This. (dump_template_argument_list): New function. (dump_type): Use it. (dump_template_parameter): New function. (dump_template_decl): Use it. (dump_template_bindings): New function. (dump_function_decl): Use it. Pretty print function template instantiations. 1999-09-28 Nathan Sidwell * decl.c (grokdeclarator): Distinguish parameter context for diagnostics. Tidy up missing type diagnostic. Diagnose `explicit' in one place. Diagnose `mutable' in one place. 1999-09-28 Mark Mitchell * ir.texi: Improve documentation for TARGET_EXPR. 1999-09-27 Nathan Sidwell Augment stringification of trees. * cp-tree.h (tree_string_flags): New error stringifying enumeration. (fndecl_as_string, type_as_string_real, args_as_string, code_as_string, language_as_string, parm_as_string, op_as_string, assop_as_string, cv_as_string): Remove. (type_as_string, decl_as_string, expr_as_string): Adjust prototype. (context_as_string): Declare new function. * error.c (cp_printers): Move definition. (OB_UNPUT): Remove. (OB_END_TEMPLATE_ID): Adjust. (interesting_scope_p): Remove. (dump_scope): New static function. (dump_qualifiers): Adjust prototype, reimplement. (dump_template_value): Use tree_string_flags. (dump_type_real): Move back to dump_type. (dump_type): Adjust prototype. Use tree_string_flags. (dump_aggr_type): Likewise. Use dump_template_parms. (dump_type_prefix): Adjust prototype. Use tree_string_flags. Return pad flag. (dump_type_suffix): Adjust prototype. Use tree_string_flags. (dump_simple_decl): Likewise. (dump_decl): Likewise. Use dump_template_decl. (dump_template_decl): New static function broken out of dump_decl. (dump_function_decl): Adjust prototype. Use tree_string_flags. (dump_parameters): Likewise. Prefix space. (dump_exception_spec): Adjust prototype. Use tree_string_flags. (dump_function_name): Likewise. Use dump_template_parms. (dump_template_parms): New static function broken out of dump_function_name. (dump_expr_list): Adjust prototype. Use tree_string_flags. (dump_expr): Likewise. (fndecl_as_string): Removed (type_as_string_real): Removed (dump_binary_op): Adjust prototype. Use tree_string_flags. (dump_unary_op): Likewise. (type_as_string): Likewise. (expr_as_string): Likewise. (decl_as_string): Likewise. (context_as_string): New function. (lang_decl_name): Adjust. (decl_to_string): New static print callback. (expr_to_string): Likewise. (fndecl_to_string): Likewise. (code_as_string): Renamed to ... (code_to_string): ... here. Adjust. (language_as_string): Renamed to ... (language_to_string): ... here. Adjust. (parm_as_string): Renamed to ... (parm_to_string): ... here. (op_as_string): Renamed to ... (op_to_string): ... here. (assop_as_string): Renamed to ... (assop_to_string): ... here. (type_to_string): New static print callback. (args_as_string): Renamed to ... (args_to_string): ... here. Adjust. (cv_as_string): Renamed to ... (cv_to_string): ... here. Adjust. * pt.c (mangle_class_name_for_template): Use tree_string_flags. (print_template_context): Likewise. 1999-09-26 Mark Mitchell * cp-tree.h (expand_throw): Remove prototype. * except.c (expand_throw): Make it static. Use tree-generation functions, rather than RTL-generation functions. (build_throw): Use it. * expr.c: Include except.h. (cplus_expand_expr): Don't call expand_throw here. * Makefile.in (expr.o): Depend on except.h. * ir.texi: Update documentation for THROW_EXPR. * decl.c (start_function): Set x_dont_save_pending_sizes rather than calling get_pending_sizes. * init.c (build_new): Don't save and restore immediate_size_expand; instead, assert that it has the expected value already. 1999-09-26 Kaveh R. Ghazi * lex.c (compiler_error): Add missing call to va_end(). 1999-09-25 Mark Mitchell * dump.c (dequeue_and_dump): Handle RESULT_DECL. * ir.texi: Document RESULT_DECL and DECL_RESULT. * cp-tree.h (check_return_expr): New function. * decl.c (finish_constructor_body): New function. (pushdecl): Put global friend functions in namespace binding level, not the class binding level. (finish_destructor_body): Make sure the dtor_label is always defined. Fix typo in comment. (finish_function): Move generation of constructor-termination code to semantic-analysis time. Move generation of implicit `main' return value to semantic-analysis time. * semantics.c (finish_return_stmt): Generate goto's to ctor_label/dtor_label here. Use check_return_expr to do semantic analysis on the returned expression. * typeck.c (maybe_warn_about_returning_address_of_local): New function split out from c_expand_return. (check_return_expr): Likewise. (c_expand_return): Just generate the RTL for the return. 1999-09-24 Mark Mitchell * cp-tree.h (CPTI_CLEANUP_TYPE): New macro. (cleanup_type): Likewise. (search_tree): Change prototype. * decl.c (local_variable_p): Adjust for new interface to search_tree. (check_default_argument): Likewise. * error.c (dump_expr): Handle INIT_EXPR. * except.c (expand_throw): Don't make cleanup_type a local static. * expr.c (cplus_expand_expr): Don't handle NEW_EXPR. * init.c (build_new): Call build_new_1 directly, rather than building a NEW_EXPR. (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when processing file-scope initializers. * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR. * tree.c: Include splay-tree.h (no_linkage_helper): Adjust for new interface to search_tree. (search_tree): Pass around pointers to tree nodes, rather than the nodes themselves. Handle VEC_INIT_EXPR. (no_linkage_check): Adjust for new interface to search_tree. (mapcar): Handle VEC_INIT_EXPR. (target_remap): New variable. (bot_manip): Use it. (bot_replace): New function. (break_out_target_exprs): Use it to remap all variables used in a default argument expression. * typeck.c (build_modify_expr): Don't crash when outside a function and presented with an INIT_EXPR assignment * Makefile.in (tree.o): Depend on splay-tree.h. Fri Sep 24 10:48:10 1999 Bernd Schmidt * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than DECL_BUILT_IN. (builtin_function): New arg CLASS. Arg CODE now of type int. All callers changed. Set the builtin's DECL_BUILT_IN_CLASS. 1999-09-24 Mark Mitchell * decl.c (pushdecl): Don't make local declarations of extern variables give the variable a DECL_CONTEXT for the function. (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify. Don't accidentally make RTL for local declarations. (emit_local_var): Handle declarations with asm-specifiers here. 1999-09-23 Mark Mitchell * ir.texi: Improve documentation for TARGET_EXPRs. Discuss STMT_IS_FULL_EXPR_P. * cp-tree.h (language_function): Add cannot_inline. * decl.c (start_function): Restore current_function_cannot_inline from the saved value. (save_function_data): Save current_function_cannot_inline. * decl2.c (start_objects): Change prototype. Build the function in function-at-a-time mode. (finish_objects): Likewise. (generate_ctor_or_dtor_function): Adjust accordingly. * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro. * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS. Don't call expand_anon_union_decl here * semantics.c (exapnd_stmt): Call it here, instead. * typeck.c (mark_addressable): Addressed variables are implicitly used. 1999-09-23 Martin v. Löwis * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise. (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK. * cp-tree.h: Add tree checking macros to various tree access macros. * ptree.c (print_lang_decl): Test for function or variable before accessing template info. 1999-09-23 Jason Merrill * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node. * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__. * decl2.c (lang_f_options): Add -fshort-wchar. * cp-tree.h: Declare flag_short_wchar. * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned int' for wchar_t. 1999-09-23 Martin v. Löwis * ir.texi: Fix formatting errors and typos. 1999-09-22 Mark Mitchell * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT. * decl.c (pushdecl): Do create a binding for extern "C" functions, but not for their DECL_ASSEMBLER_NAMEs. (lookup_name_current_level): Fix formatting. (xref_tag): Likewise. * decl2.c (start_objects): Mark static constructors and destructors as used. 1999-09-22 Jason Merrill * decl.c (define_case_label): Don't crash if we're not in a switch. * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags. * lang-options.h: Restore -fthis-is-variable. Remove help strings for unsupported flags. 1999-09-21 Jason Merrill * decl2.c (lang_decode_option): Accept and ignore -finit-priority. Accept and warn about -fthis-is-variable. 1999-09-21 Mark Mitchell * dump.c (dequeue_and_dump): Handle START_CATCH_STMT, CLEANUP_STMT, and SCOPE_STMT. * decl2.c (lang_decode_option): Adjust, in the wake of recent changes to option processing. 1999-09-21 Martin v. Löwis * typeck.c (get_member_function_from_ptrfunc): Allow extraction of function pointer from pmfs with no object given. (convert_for_assignment): Do not return error when converting pmfs. 1999-09-21 Alex Samuel * lex.c (internal_filename): New variable. (INTERNAL_FILENAME): New macro. (init_parse): Allocate internal_filename and mark as root. Use it instead of a string constant. 1999-09-21 Nathan Sidwell Reimplement dynamic cast and catch matching. * cp-tree.h (get_dynamic_cast_base_type): Prototype new function * search.c (dynamic_cast_base_recurse): New function. (get_dynamic_cast_base_type): New function for dynamic cast. * rtti.c (build_dynamic_cast_1): Determine source and target class relationship. Call __dynamic_cast_2. * tinfo.h (__user_type_info::upcast): New catch dispatcher. (__user_type_info::dyncast): New dynamic cast dispatcher. (__user_type_info::sub_kind): New nested enumeration. (__user_type_info::contained_p): sub_kind predicate. (__user_type_info::contained_public_p): Likewise. (__user_type_info::contained_nonpublic_p): Likewise. (__user_type_info::contained_nonvirtual_p: Likewise. (__user_type_info::upcast_result): New nested struct. (__user_type_info::dyncast_result): New nested struct. (*::do_upcast): New catch function. (*::do_dyncast): New dynamic cast function. (__user_type_info::find_public_subobj): New dynamic cast helper dispatcher. (*::do_find_public_subobj): New dynamic cast helper function. * tinfo.cc (__user_type_info::upcast): Define catch dispatcher. (__user_type_info::dyncast): Define dynamic cast dispatcher. (*::do_upcast): Define catch function. (*::do_dyncast): Define dynamic cast function. (*::do_find_public_subobj): Define dynamic cast helper function. * tinfo2.cc (__throw_type_match_rtti_2): Use upcast. (__dynamic_cast): Backwards compatibility wrapper. Use dyncast. (__dynamic_cast_2): New dynamic cast runtime. 1999-09-20 Mark Mitchell * cp-tree.h (finish_stmt_expr): Change prototype. * expr.c (cplus_expand_expr): Adjust call accordingly. * init.c (finish_init_stmts): Likewise. * parse.y (primary): Likewise. * pt.c (tsubst_copy): Likewise. * semantics.c (finish_stmt_expr): Don't take two parameters. Don't remove generated BLOCKs from the block-tree. Remove support for assigning to `this'. * NEWS: Note that fact. * class.c (build_vbase_path): Don't check flag_this_is_variable. * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove. (language_function): Remove assigns_this, just_assigned_this, and x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p. (base_init_expr): Remove. (current_vcalls_possible_p): New macro. (vtbls_set_up_p): Likewise. (emit_base_init): Change prototype. * decl.c (finish_destructor_body): New function, split out from finish_function. (current_function_assigns_this): Remove. (current_function_just_assigned_this): Likewise. (start_function): Don't set them. (finish_function): Don't check them. Don't emit base-initialization code here. Generate code for destructors when doing semantic analysis. (finish_stmt): Don't check current_function_just_assigned_this. * decl2.c (lang_f_options): Remove this-is-variable. (lang_decode_option): Likewise. (grokclassfn): Don't check flag_this_is_variable. * init.c (emit_base_init): Return the expression generated. (construct_virtual_bases): Don't push/pop obstacks. Fix typo. (build_new_1): Don't check flag_this_is_variable. (get_temp_regvar): Don't set DECL_REGISTER. (build_vec_init): Don't call use_variable. * lang-options.h: Remove "-fthis-is-variable" and "-fno-this-is-variable". * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS. * search.c (expand_upcast_fixups): Use finish_expr_stmt, not expand_expr_stmt. * semantics.c (finish_expr_stmt_real): Rename to ... (finish_expr_stmt): This. Remove assigned_this parameter. (begin_if_stmt): Call do_pushlevel before starting the statement. (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less blocks. (setup_vtbl_ptr): Emit initialization code for bases and members at semantic-analysis time. Emit code to initialize vtables in destructors here. (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real. Don't handle CTOR_INITIALIZER any more. * typeck.c (build_modify_expr): Don't check for assignments to this. (c_expand_return): Don't suggest assigning to `this'. * Makefile.in (decl.o): Depend on RTL_H. (decl2.o): Likewise. (class.o): Likewise. (call.o): Likewise. (method.o): Likewise. (search.o): Likewise. (tree.o): Likewise. (pt.o): Likewise. * decl.c (duplicate_decls): When a builtin function is redeclared as static, make sure it is mangled correctly. * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add detail about the statement-tree. 1999-09-20 Nathan Sidwell * parse.y (primary): Use build_functional_cast for CV_QUALIFIER. 1999-09-20 Nick Clifton * decl2.c (lang_decode_option): Extend comment. Mon Sep 20 10:49:05 1999 Bernd Schmidt * typeck.c: Include "tm_p.h". 1999-09-19 Mark Mitchell * ir.texi: New file. 1999-09-19 Paul Burchard * semantics.c (expand_stmt): Initialize return value. 1999-09-18 Paul Burchard * gxxint.texi: G++ now implements namespaces. 1999-09-18 Mark Mitchell * decl.c (pop_label): Don't warn about unused labels more than once. * semantics.c (finish_goto_stmt): Always marked used labels as used. * decl.c (layout_var_decl): Change prototype. Call layout_decl even when the declaration is external. (cp_finish_decl): Adjust call to layout_var_decl. * pt.c (tsubst_expr): Make sure to initialize stmt before using it. 1999-09-18 Martin von Loewis * typeck.c (get_member_function_from_ptrfunc): Always consider virtuality inside member pointer. 1999-09-17 Mark Mitchell Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. * cp-tree.h (language_function): Add x_eh_spec_try_block. Add x_scope_stmt_stack. Add x_in_charge_parm. (current_eh_spec_try_block): New macro. (current_scope_stmt_stack): Likewise. (current_in_charge_parm): Likewise. * decl.c (start_function): Initialize current_in_charge_parm. (finish_function): Use current_in_charge_parm rather than looking up __in_chrg. * search.c (expand_indirect_vtbls_init): Likewise. * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps. (TRY_BLOCK): Likewise. (HANDLER): Likewise. (START_CATCH_STMT): New tree node. (SCOPE_STMT): Likewise. * cp-tree.h (SCOPE_BEGIN_P): New macro. (SCOPE_NULLIFIED_P): Likewise. (struct lang_decl_flags): Add pending_inline_p. Adjust dummy. (struct lang_decl): Add saved_language_function. (DECL_PENDING_INLINE_INFO): Adjust documentation. (DECL_PENDING_INLINE_P): New macro. (TYPE_TI_ARGS): Fix typo in comment. (DECL_SAVED_TREE): Add to documentation. (DECL_SAVED_FUNCTION_DATA): New macro. (START_CATCH_TYPE): Likewise. (SCOPE_END_P): New macro. (declare_parm_level): Don't declare. * decl.c (mark_lang_function): New function, split out from mark_cp_function_context. (save_function_data): New function. (declare_parm_level): Remove. (finish_function): Use save_function_data to squirrel away important stuff for later use. (mark_cp_function_context): Use mark_function_data. (lang_mark_tree): Likewise. * lex.c (begin_definition_of_inclass_inline): Set DECL_PENDING_INLINE_P. (store_pending_inline): Clear it. * pt.c (tsubst_decl): Likewise. 1999-09-17 Nathan Sidwell * call.c (perform_implicit_conversion): Deal with error_mark_node. 1999-09-17 Mark Mitchell * decl.c (warn_extern_redeclared_static): Don't get confused by static member functions. (duplicate_decls): Merge DECL_THIS_STATIC. * decl.c (expand_static_init): Make sure assignments to local statics actually occur. 1999-09-17 Mark Mitchell * cp-tree.h (poplevel_class): Declare. * class.c (popclass): Use poplevel_class, not poplevel. * decl.c (poplevel_class): Don't make it static. Don't return a value. (poplevel): Don't call poplevel_class; abort in a class binding level is seen. * semantics.c (finish_translation_unit): Use pop_everything. * parse.y (member_init): Allow errors. (pending_inline): Call finish_function. * parse.c: Regenerated. * Makefile.in (CONFLICTS): Adjust. 1999-09-17 Gabriel Dos Reis * error.c: Reduce code duplication. (dump_template_value): New function. (dump_type_real): Use it. (dump_decl): Likewise. (dump_function_name): Likewise. (dump_function_decl): Don't be too talkative about function return type variety. 1999-09-16 Kaveh R. Ghazi * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero. * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy. 1999-09-16 Jason Merrill * decl2.c (finish_file): Also call check_global_declarations for the pending_statics list. 1999-09-15 Jason Merrill * lex.c (cp_pragma_implementation): Allow #pragma implementation in header files. 1999-09-15 Richard Henderson * lex.c (mark_impl_file_chain): Follow the next chain. 1999-09-15 Mark Mitchell * decl.c (warn_extern_redeclared_static): Simplify. Catch problems with extern "C" functions redeclared as static. (duplicate_decls): When a builtin is redeclared static, make the new function have internal linkage. 1999-09-15 Mark Mitchell * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR. * pt.c (tsubst_copy): Likewise. * tree.c (search_tree): Likewise. (mapcar): Likewise. 1999-09-15 Kaveh R. Ghazi * typeck2.c (ack): Don't declare progname. 1999-09-14 Alexandre Oliva * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy filenames with ggc_alloc_string. 1999-09-14 Mark Mitchell * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the TARGET_EXPR. * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on the TARGET_EXPR. * cvt.c (build_up_reference): Likewise. * tree.c (build_cplus_new): Likewise. (get_target_expr): Likewise. Tue Sep 14 01:45:10 1999 Marc Espie * Makefile.in: Prepend $(SHELL) to move-if-change calls. 1999-09-13 Mark Mitchell * cp-tree.h (build_target_expr): New function. * call.c (build_conditional_expr): Use build_target_expr. (convert_like): Likewise. (build_over_call): Likewise. * cvt.c (build_up_reference): Likewise. * decl.c (build_cleanup_on_safe_obstack): Fold into ... (destroy_local_var): Here. (build_target_expr): New function. * tree.c (build_cplus_new): Use it. (get_target_expr): Likewise. 1999-09-13 Nathan Sidwell * typeck.c (expr_sizeof): Don't decay arrays and functions. Remove misleading comment. (build_compound_expr): Don't decay arrays. 1999-09-13 Jason Merrill * call.c (build_conditional_expr): Always use a TARGET_EXPR for class rvalues again. Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. 1999-09-12 Mark Mitchell * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs. * cvt.c (ocp_convert): Complete the from and destination types. Adjust warning about functions always being `true' in conditionals. * decl.c (duplicate_decls): Don't play funny games with abort. * error.c (dump_expr): Handle OVERLOADs. * spew.c (probe_obstack): Remove. * typeck.c (condition_conversion): Use perform_implicit_conversion. 1999-09-12 Bernd Schmidt * cp-tree.h (auto_function, define_function): Adjust prototypes. * decl.c (define_function): Lose FUNCTION_CODE arg. All callers changed. (auto_function): Likewise, for CODE arg. Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to... (builtin_function): ... here. 1999-09-11 Mark Mitchell * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion. (init_decl_processing): Don't set TREE_PERMANENT for the error_mark_node. (start_decl): Don't rebuild non-permanent ARRAY_TYPEs. (grokdeclarator): Likewise. (grokparms): Don't check TREE_PERMANENT when building up lists. * decl2.c (grokfield): Don't assert TREE_PERMANENT. (mark_inline_for_output): Likewise. * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT. * init.c (build_offset_ref): Don't check TREE_PERMANENT. * lex.c (check_newline): Don't check ggc_p; it is always one. * pt.c (process_template_parm): Don't check TREE_PERMANENT. * spew.c (yylex): Don't copy_node or probe_obstacks for non-permanent CONSTANTs and STRINGs. * tree.c (build_cplus_array_type_1): Don't fuss with TREE_PERMANENT on ARRAY_TYPEs. * cp-tree.def (CLEANUP_STMT): New node. * cp-tree.h (language_function): Add name_declared. (current_function_name_declared): New macro. (CLEANUP_DECL): New macro. (CLEANUP_EXPR): Likewise. (emit_local_var): Likewise. (finish_decl_cleanup): New function. * cvt.c (build_up_reference): Simplify. (ocp_convert): Remove dead code. * decl.c (start_decl): Remove call to add_decl_stmt. (grok_reference_init): Adjust, to handle bindings temporaries to references. Remove dead code. (initialize_local_var): Don't generate RTL for declarations here, or build cleanups here. Don't fuss with obstacks. Replace expand_start_target_temps calls with explicit setting of stms_are_full_exprs_p. (destroy_local_var): New function. (emit_local_var): Likewise. (cp_finish_decl): Use them, as appropriate. (start_function): Announce template functions. (store_parm_decls): Don't call declare_function_name here. (finish_stmt): Don't start emit base-initialization code when just building the statement-tree. * init.c (create_temporary_var): Move add_decl_stmt call ... (get_temp_regvar): Here. * pt.c (tsubst_expr): Make DECL_INITIAL look like what cp_finish_decl would expect. Don't call add_decl_stmt. * semantics.c (begin_compound_stmt): Call declare_function_name, if appropriate. (finish_decl_cleanup): New function. (expand_stmt): Use emit_local_var to output variables. (expand_body): Set current_function_name_declared. 1999-09-10 Mark Mitchell * cp-tree.h (finish_cleanup_try_block): New function. * semantics.c (finish_cleanup_try_block): Add comment. Fri Sep 10 10:32:32 1999 Bernd Schmidt * cp-tree.h: Delete declarations for all tree nodes now moved to global_trees. * decl.c: Delete their definitions. (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't provide defaults. (init_decl_processing): Call build_common_tree_nodes and build_common_tree_nodes_2 instead of building their nodes here. Don't add gc roots for them. 1999-09-10 Mark Mitchell * cp-tree.h (language_function): Rename expanding_p to x_expanding_p. Rename named_label_uses to x_named_label_uses. (expanding_p): Adjust accordingly. (TREE_VIA_PRIVATE): Fix typo in comment. (DECL_REFERENCE_SLOT): Remove. (SET_DECL_REFERENCE_SLOT): Likewise. * decl.c (named_label_uses): Adjust. Remove chicken comment. (push_overloaded_decl): Don't truncate the chain of bindings when adding an overloaded function. (grok_reference_init): Don't use DECL_REFERENCE_SLOT. (initialize_local_var): Fix typo in comment. (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up. * decl2.c (start_objects): Make the fact that we are expanding the generated function right away explicit. (start_static_storage_duration_function): Likewise. (finish_file): Fix typo in comment. * init.c (build_vec_init): Correct bugs in handling cleanups. * semantics.c (maybe_convert_cond): New function. (FINISH_COND): Always store the condition, even if there's a declaration. (finish_if_stmt_cond): Use maybe_convert_cond. (finish_while_stmt_cond): Likewise. (finish_do_stmt): Likewise. (finish_for_cond): Likewise. (expand_cond): Adjust. * cp-tree.h (FN_TRY_BLOCK_P): New macro. * init.c (perform_member_init): Remove obstack machinations. (expand_cleanup_for_base): Likewise. (finish_init_stmts): Mark the statement-expression as used. * method.c (emit_thunk): Use tree-generating functions, not RTL. (do_build_copy_constructor): Likewise. (do_build_assign_ref): Likewise. (synthesize_method): Likewise. Keep track of line numbers. * pt.c (tsubst_expr): Handle various kinds of try blocks. * semantics.c (expand_stmts): Remove. (begin_function_try_block): Set FN_TRY_BLOCK_P. (finish_function_try_block): Be careful rechaining function try blocks. (expand_stmt): Loop through all the statements at a given level. (exapnd_body): Be careful with line-numbers here too. Prepare for being called directly from the parser. * cp-tree.h (finish_function): Adjust prototype. * decl.c (finish_function): Return the function compiled. * pt.c (instantiate_decl): Don't play games with obstacks. * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF. (search_tree): Likewise. * typeck.c: Fix typo in comment. * typeck2.c (store_init_value): Add comment. * cp-tree.h (CPTI_ATEXIT): New macro. (atexit_node): Likewise. * decl.c (destroy_local_static): New function, broken out from ... (expand_static_init): Here. * rtti.c (get_tinfo_var): These should always be global (expand_si_desc): Use tree, not RTL, functions to generate code. (expand_class_desc): Likewise. (expand_ptr_desc): Likewise. (expand_attr_desc): Likewise. (expand_generic_desc): Likewise. (synthesize_tinfo_fn): Likewise. 1999-09-09 Mark Mitchell * semantics.c (RECHAIN_STMTS): Remove `last' parameter. (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with RECHAIN_STMTS. (RECHAIN_STMST_FROM_CHAIN): Likewise. * parse.y (simple_stmt): Fix typo in last change. * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro. (STMT_IS_FULL_EXPR_P): Likewise. (STMT_LINENO_FOR_FN_P): Likewise. (prep_stmt): New function. (building_stmt_tree): Tweak for safety. * pt.c (tsubst_expr): Use prep_stmt throughout. (add_tree): Move it to semantics.c * semantics.c (add_tree): Move it here. (finish_expr_stmt_real): New function. (finish_expr_stmt): Use it. (finish_if_stmt_cond): Use FINISH_COND. (finish_while_stmt_cond): Likewise. (finish_for_cond): Likewise. (finish_stmt_tree): Tweak line-number handling. (prep_stmt): New function. (expand_stmt): Use it. * cp-tree.h (begin_switch_stmt): Adjust prototype. (finish_switch_cond): Likewise. * parse.y (simple_stmt): Adjust accordingly. * parse.c: Regenerated. * pt.c (tsubst_expr): Adjust accordingly. * semantics.c (expand_cond): New function. (FINISH_COND): New macro. (begin_switch_stmt): Build the SWITCH_STMT here. (finish_switch_stmt_cond): Not here. (expand_stmt): Adjust calls to begin_switch_stmt and finish_switch_cond. Use expand_cond throughout. * dump.c (dequeue_and_dump): Dump types for constants. Describe DECL_ARG_TYPE more intuitively. Handle ARRAY_REF. * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC. (lang_cleanup_tree): Remove. * lex.c (make_lang_type): Use ggc_alloc to allocate TYPE_LANG_SPECIFIC. Reorganize per-function data. * cp-tree.h (saved_scope): Add function_decl, bindings. (language_function): Rename binding_level to bindings. (cp_function_chain): Use the current_function, not the outer_function_chain. (current_class_ptr): Make it work, even when there's no current function. (current_class_ref): Likewise. (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New macros. (clear_temp_name): Remove. * decl.c (check_function_type): New function, broken out from start_function. (current_binding_level): Adjust definition. (pushlevel): Simplify. (poplevel): Don't use named_label_uses when we're outside a function scope. (mark_saved_scope): Mark function_decl and bindings. (maybe_push_to_top_level): Don't unconditionally push a new function context. Save bindings and the current_function_decl. Don't clear named_labels. (pop_from_top_level): Pop function context if appropriate. (init_decl_processing): Set init_lang_status and free_lang_status, rather than save_lang_status and restore_lang_status. (start_function): Take SF_* flags. Don't clear per-function data. Reorder and simplify to use new per-function data code. Add asserts. (store_parm_decls): Don't call init_function_start here. (finish_function): Adjust for new handling of per-function data. (push_cp_function_context): Simplify. (mark_cp_function_context): Change binding_level to bindings. * decl2.c (clear_temp_name): Remove. (start_objects): Use SF flags to start_function. (start_static_storage_duration_function): Likewise. * except.c (start_anon_func): Remove redundant calls to push_function_context_to. Use SF flags to start function. (end_anon_func): Remove redundant call to pop_function_context from. * lex.c (reinit_parse_for_function): Don't initialize per-function data. * method.c (emit_thunk): Clear current_function after calling assemble_end_function. Use SF flags for start_function. (synthesize_method): Use SF flags for start_function. * parse.c: Regenerated. * parse.y (fn.defpen): Likewise. (pending_inline): Clear current_function, even if something goes wrong. * pt.c (instantiate_decl): Use SF flags to start_function. Don't save and restore expanding_p. (add_tree): Handle the case where we are outside any function. (end_tree): Likewise. * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function. * semantics.c (begin_function_definition): Likewise. (expand_body): Likewise. 1999-09-09 Nathan Sidwell * cp-tree.h (convert_to_void): Prototype new function. (require_complete_type_in_void): Remove prototype. * cvt.c (convert_to_void): New function. (ocp_convert): Use convert_to_void. * decl.c (cplus_expand_expr_stmt): Likewise, for complete expressions. * typeck.c (require_complete_type_in_void): Remove function. (build_compound_expr): Use convert_to_void. (build_static_cast): Likewise. (build_c_cast): Likewise. * semantics.c (finish_expr_stmt): Do not decay full expressions. * typeck.c (build_x_compound_expr): Add FIXME. 1999-09-08 Mark Mitchell * cp-tree.h (scratch_tree_cons): Remove. * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons, and perm_tree_cons with plain tree_cons. * class.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * init.c: Likewise. * lex.c: Likewise. * method.c: Likewise. * parse.y: Likewise. * pt.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * typeck.c: Likewise. * parse.c: Regenerated. * tree.c (build_srcloc): Simplify. 1999-09-08 Bruce Korb autogen@linuxbox.com * Makefile.in: Give the gperf user a hint about why "gperf -F" fails. 1999-09-08 Mark Mitchell * cp-tree.h (lang_decl_flags): Remove permanent_attr. Remove next. (LANG_DECL_PERMANENT): Remove. * decl.c (duplicate_decls): Don't mess about with obstacks trying to free memory. (lang_mark_tree): Mark DECL_LANG_SPECIFIC. * lex.c (free_lang_decl_chain): Remove. (build_lang_decl): Don't use obstacks. (retrofit_lang_decl): Likewise. (copy_lang_decl): Likewise. * cp-tree.h (saved_scope): Remove old_binding_level and function_decl. Tidy up. * decl.c (mark_saved_scope): Don't set them. (maybe_push_to_top_level): Clear memory. * decl.c (layout_var_decl): Change prototype. Don't complete types for external objects. (check_initializer): Likewise. Tidy. (initialize_local_var): Complete types here. (cp_finish_decl): Not here. Reorganize a little. (grokvardecl): Don't complete types here. * decl.c (start_function): Clear last_dtor_insn and last_parm_cleanup_insn. (push_cp_function_context): Just copy over a little of the old context, not all of it. * cp-tree.h (copy_to_permanent): Remove. (permanent_p): Likewise. * decl.c (building_typename_type): Don't use copy_to_permanent. (start_decl): Likewise. (grok_reference_init): Likewise. (cp_finish_decl): Likewise. * init.c (build_new_1): Don't use mapcar. (build_vec_delete_1): Don't use copy_to_permanent. (build_vec_init): Likewise. * parse.y (primary): Likewise. * parse.c: Regenerated. * pt.c (push_template_decl_real): Don't use copy_to_permanent. (lookup_template_class): Likewise. (tsubst_friend_function): Likewise. (instantiate_class_template): Likewise. (tsubst_decl): Likewise. (tsubst): Likewise. (instantiate_template): Likewise. (unify): Likewise. * rtti.c (get_tinfo_fn): Likewise. (build_dynamic_cast): Likewise. * semantics.c (finish_if_stmt_cond): Likewise. (finish_while_stmt_cond): Likewise. (finish_do_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_cleanup): Likewise. (add_decl_stmt): Likewise. (finish_named_return_value): Likewise. (finish_qualified_call_expr): Likewise. * tree.c (perm_manip): Remove. (build_exception_variant): Don't use copy_to_permanent. (permanent_p): Remove. (copy_to_permament): Remove. (build_min_nt): Don't use copy_to_permanent. (build_min): Likewise. (min_tree_cons): Likewise. * typeckc.c (build_static_cast): Likewise. (build_reinterpret_cast): Likewise. (build_const_cast): Likewise. 1999-09-07 Mark Mitchell * decl.c (ggc_p): Set it to 1. (mark_saved_scope): Add prototype. 1999-09-07 Richard Henderson * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete. * typeck.c (self_promoting_args_p): Delete. 1999-09-07 Jason Merrill * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT. (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove. 1999-09-07 Mark Mitchell * Makefile.in (tree.o): Depend on ggc.h. * class.c (make_method_vec): Remove. (free_method_vec): Likewise. (free_method_vecs): Remove. (add_method): Don't use them. * cp-tree.def (PTRMEM_CST): Make it longer. (TEMPLATE_PARM_INDEX): Make it shorter. * cp-tree.h (BINDING_HAS_LEVEL_P): New macro. (template_parm_index): Remove RTL field. (ptrmem_cst): Add RTL field. (finish_function): Removed parameter. (process_next_inline): Change prototype. (init_cplus_unsave): Rename to init_tree. (binding_init): Remove. * decl.c (free_binding_nodes): Remove. (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P. (pop_binding): Don't use free_binding_nodes. (free_binding_vecs): Remove. (store_bindings): Don't use them. (pop_from_top_level): Likewise. (lookup_namespace_name): Simplify. (build_typename_type): Don't use obstack_free. (unqualified_namespace_lookup): Simplify. (lookup_name_real): Simplify. (start_function): Remove comment about leaks. (finish_function): Removed nested parameter. Call expand_end_bindings even when building_stmt_tree. Call ggc_push_context and ggc_pop_context around rest_of_compilation, if necessary. (mark_cp_function_context): Handle a NULL language-context. (lang_mark_false_label_stack): Fix typo. (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD, TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on pointer to method types. (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC. * decl2.c (finish_objects): Adjust call to finish_function. (finish_static_store_duration_function): Likewise. (do_nonmember_using_decl): Remove call to binding_init. * except.c (end_anon_func): Adjust call to finish_function. * lex.c (mark_impl_file_chain): New function. (init_parse): Call init_tree, not init_cplus_unsave. Add GC roots. (cp_pramga_interface): Use xmalloc, not permalloc. (cp_pragma_implementation): Likewise. (begin_definition_of_inclass_inline): Simplify. (process_next_inline): Adjust prototype. (do_scoped_id): Don't call binding_init. (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc. * method.c (emit_thunk): Adjust call to finish_function. (synthesize_method): Likewise. * parse.y (%union): Add a new `pi' variant. (PRE_PARSED_FUNCTION_DECL): Use it. (fn.defpen): Likewise. (fndef): Adjust call to finish_function. * pt.c (instantiate_decl): Likewise. * rtti.c (syntheisze_tinfo_fn): Likewise. * semantics.c (expand_body): Likewise. * tree.c: Include ggc.h. (mark_list_hash): New function. (binding_init): Remove. (init_cplus_unsave): Rename to ... (init_tree): This. Add GC roots. 1999-09-05 Mark Mitchell Get ready for garbage collection. * Makefile.in (CXX_TREE_H): Add varray.h (lex.o): Depend on ggc.h. (decl.o): Likewise. (decl2.o): Likewise. (method.o): Likewise. (search.o): Likewise. (pt.o): Likewise. (repo.o): Likewise. * class.c: Include ggc.h. (current_class_name): Remove. (current_class_type): Likewise. (current_access_specifier): Likewise. (previous_class_type): Likewise. (previous_class_values): Likewise. (class_cache_firstobj): Likewise. (current_lang_base): Likewise. (current_lang_stack): Likewise. (current_lang_stacksize): Likewise. (lang_name_c): Likewise. (lang_name_cplusplus): Likewise. (lang_name_java): Likewise. (current_lang_name): Likewise. (base_layout_decl): Likewise. (access_default_node): Likewise. (access_public_node): Likewise. (access_protected_node): Likewise. (access_private_node): Likewise. (access_default_virtual_node): Likewise. (access_public_virtual_node): Likewise. (access_protected_virtual_node): Likewise. (access_private_virtual_node): Likewise. (signed_zero_node): Likewise. (init_class_processing): Don't build base_layout_decl. (push_lang_context): Adjust now that current_lang_base is a varray. (pop_lang_context): Likewise. * cp-tree.h: Include varray.h. (cp_global_trees): Add access_default, access_public, access_protected, access_private, access_default_virtual, access_public_virtual, access_protected_virtual, access_private_virtual, ctor_identifier, delta2_identifier, delta_identifier, dtor_identifier, in_charge_identifier, index_identifier, nelts_identifier, this_identifier, pfn_identifier, pfn_or_delta2_identifier, vptr_identifier, lang_name_c, lang_name_cplusplus, lang_name_java, empty_except_spec, null, jclass, minus_one, terminate. (saved_scope): Move here from decl.c. Define globals in terms of saved_scope: current_namespace, current_class_name, current_class_type, current_access_specifier, current_lang_stack, current_lang_base, current_lang_name, current_function_parms, current_template_parms, processing_template_decl, processing_specialization, processing_explicit_instantiation, previous_class_type, previous_class_values, class_cache_firstobj. (scope_chain): New variable. (init_pt): New function. * decl.c (current_namespace): Remove. (this_identifier, in_charge_identifier, ctor_identifier): Likewise. (dtor_identifier, pfn_identifier, index_identifier): Likewise. (delta_identifier, delta2_identifier): Likewise. (pfn_or_delta2_identifier, tag_identifier): Likewise (vt_off_identifier, empty_except_spec, null_node): Likewise. (current_function_parms, current_lang_base): Remove. (current_lang_stack, previous_class_values): Remove. (class_binding_level): Macroize. (saved_scope): Remove. (current_saved_scope): Rename to scope_chain. (mark_saved_scope): Adjust for new scope structure. (maybe_push_to_top_level): Likewise. (pop_from_top_level): Likewise. (duplicate_decls): Adjust now that current_lang_base is a varray. (build_typename_type): Call ggc_add_tree_hash_table_root. (init_decl_processing): Call init_pt. Call push_to_top_level to set up globals. Add GC roots. (xref_basetypes): Adjust now that current_lang_base is a varray. * decl.h (this_identifier): Remove. (in_charge_identifier): Likewise. * decl2.c: Don't include varray.h. (current_namespace): Remove. (init_decl2): Add GC roots. * except.c (Terminate): Remove. (init_exception_processing): Use terminate_node instead. (build_terminate_handler): Likewise. * init.c (nc_nelts_field_id): Remove. (minus_one): Likewise. (init_init_processing): Use minus_one_node and nelts_identifier instead. Add GC roots. (jclass_node): Remove. (build_new_1): Use nelts_identifier. (build_vec_init): Likewise. (build_vec_delete): Likewise. * lex.c: Include ggc.h. (defarg_fn): Move declaration early. (defarg_parms): Likewise. (init_parse): Add GC roots. (handle_cp_pragma): Remove redundant declaration of pending_vtables. * method.c: Include ggc.h. (btypelist): Make it a varray. All uses changed. (ktypelist): Likewise. (init_method): Add GC roots. * pt.c: Don't include varray.h. Include ggc.h. (current_template_parms): Remove. (processing_template_decl): Likewise. (processing_specialization): Likewise. (processing_explicit_instantiation): Likewise. (init_pt): New function. * repo.c: Include ggc.h. (init_repo): Add GC roots. * search.c: Don't include varray.h. (_vptr_name): Remove. (lookup_field_1): Use vtpr_identifier instead. (expand_indirect_vtbls_init): Remove redundant declaration of in_charge_identifier. (init_search_processing): Use vptr_identifier. 1999-09-05 Richard Henderson Bernd Schmidt Mark Mitchell * Makefile.in (parse.o): Depend on ggc.h. (decl2.o): Depend on ggc.h. (init.o): Depend on ggc.h. * cp-tree.h (init_decl2): Declare. (cp_parse_init): Likewise. * decl.c (ggc_p): Define to zero. (mark_saved_scope): New function. (init_decl_processing): Call cp_parse_init, and cp_decl2. Register GC roots. (expand_static_init): Add GC roots. * decl2.c: Include ggc.h. (init_decl2): New function. * init.c: Include ggc.h. (init_init_processing): Add GC roots. * parse.y: Include ggc.h. (cp_parse_init): New function. 1999-09-04 Mark Mitchell * decl.c (init_decl_processing): Set mark_lang_status. (lang_mark_false_label_stack): Adjust prototype. * decl2.c (grok_function_init): Remove extraneous declaration of abort_fndecl. * Make-lang.in (cc1plus): Remove dependency on GGC. * Makefile.in (OBJS): Don't mention ggc-simple.o. (OBJDEPS): Don't mention ggc-simple.o. * Make-lang.in (cc1plus): Depend on $(GGC). * Makefile.in (OBJS): Add ggc-simple.o. (OBJDEPS): Likewise. * cp-tree.h (language_function): Rename members to `x_' versions; we now have x_named_labels, x_ctor_label, x_dtor_label, x_base_init_list, x_member_init_list, x_base_init_expr, x_current_class_ptr, x_current_class_ref, x_last_tree, x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and x_result_rtx. (dtor_label, ctor_label, current_base_init_list, current_member_init_list, base_init_expr, current_class_ptr, current_class_ref, last_tree, last_expr_type): Adjust accordingly. * decl.c: Include ggc.h. (last_dtor_insn): Adjust to use x_ names. (last_parm_cleanup_insn): Likewise. (original_result_rtx): Likewise. (named_labels): Likewise. (mark_binding_level): New function. (mark_cp_function_context): Likewise. (mark_false_label_stack): Likewise. (lang_mark_tree): Likewise. (lang_cleanup_tree): Likewise. 1999-09-03 Mark Mitchell * Makefile.in (CXX_TREE_H): Include function.h. (decl.o): Don't depend on function.h. (decl2.o): Likewise. (typeck.o): Likewise. (init.o): Likewise. (method.o): Likewise. * cp-tree.h: Include function.h. (cp_function): Rename to language_function. Remove next. (cp_function_chain): Make it a macro, not a variable. (push_cp_function_context): Don't declare. (pop_cp_function_context): Likewise. * decl.c: Don't include function.h. (push_cp_function_context): Make it static. Make it suitable for a save_lang_status callback. (pop_cp_function_context): Likewise. (maybe_push_to_top_level): Call push_function_context_to, not push_cp_function_context. (pop_from_top_level): Call pop_function_context_from, not pop_cp_function_context. (init_decl_processing): Set save_lang_status and restore_lang_status. Call push_function_context_to, not push_cp_function_context. (cp_function_chain): Remove. * decl2.c: Don't include function.h. * except.c: Don't include function.h. (start_anon_func): Call push_function_context_to, not push_cp_function_context. (end_anon_func): Call pop_function_context_from, not pop_cp_function_context. * init.c: Don't include function.h. * lex.c (begin_definition_of_inclass_inline): Call push_function_context_to, not push_cp_function_context. (process_next_inline): Call pop_function_context_from, not pop_cp_function_context. * method.c: Don't include function.h. (synthesize_method): Call push_function_context_to, not push_cp_function_context. Call pop_function_context_from, not pop_cp_function_context. * typeck.c: Don't include function.h. * decl.c (expand_static_init): Tweak handling of static initializations for objects without constructors. 1999-09-03 Nathan Sidwell * typeck.c (build_indirect_ref): Reject dereference of pointer to void. 1999-09-02 Mark Mitchell * cp-tree.h (cp_function): Move here, from decl.c. (cp_function_chain): Declare. (dtor_label): New macro, instead of variable. (ctor_label): Likewise. (current_base_init_list): Likewise. (current_member_init_list): Likewise. (base_init_expr): Likewise. (current_class_ptr): Likewise. (current_class_ref): Likewise. (last_tree): Likewise. (last_expr_type): Likewise. (current_function_returns_value): Likewise. (current_function_returns_null): Likewise. (current_function_just_assigned_this): Likewise. (current_function_parms_stored): Likewise. (temp_name_counter): Likewise. (static_labelno): Likewise. (expanding_p): Likewise. (stmts_are_full_exprs_p): Likewise. (in_function_try_handler): Likewise. (lang_type): Remove nested type_flags. All uses changed. * call.c (ctor_label): Remove. (dtor_label): Likewise. * class.c (current_class_ptr): Remove. (current_class_ref): Likewise. * decl.c (static_labelno): Remove. (dtor_label): Likewise. (last_dtor_insn): New macro, instead of variable. (last_parm_cleanup_insn): Likewise. (original_result_rtx): Likewise. (in_function_try_handler): Remove. (named_label_uses): New macro, instead of variable. (named_labels): Likewise. (current_function_returns_value): Remove. (current_function_returns_null): Likewise. (current_function_assigns_this): New macro, instead of variable. (current_function_just_assigned_this): Likewise. (current_binding_level): Likewise. (init_decl_processing): Call push_cp_function_context. (cp_function): Move to cp-tree.h (cp_function_chain): Make it global. (temp_name_counter): Remove. (push_cp_function_context): Simplify. (pop_cp_function_context): Likewise. * decl2.c (temp_name_counter): Remove. * init_c (current_base_init_list): Likewise. (current_member_init_list): Likewise. (base_init_expr): Likewise. * method.c (static_labelno): Likewise. * pt.c (last_tree): Likewise. * semantics.c (expanding_p): Likewise. (stmts_are_full_exprs_p): Likewise. (last_expr_type): Likewise. * typeck.c (dtor_label): Likewise. (ctor_label): Likewise. 1999-09-01 Alex Samuel * decl2.c (arg_assoc_template_arg): New prototype. New function. (arg_assoc_class): Use arg_assoc_template_arg for template arguments. (arg_assoc): Likewise. * pt.c (mangle_class_name_for_template): Allow member template template arguments. 1999-09-02 Nathan Sidwell * call.c (build_conditional_expr): Warn on enum mismatches. (convert_arg_to_ellipsis): Move non-pod check to after conversion. 1999-09-01 Kaveh R. Ghazi * gxx.gperf (hash, is_reserved_word): Add prototypes. * init.c (build_vec_init): Initialize variable `try_block'. * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts. Likewise for bzero/memset. (token_getch, token_put_back): Add static prototypes. Remove `inline' from the definitions. (retrofit_lang_decl): Call memset, not bzero, to avoid casts. 1999-09-01 Mark Mitchell * cp-tree.h (lang_type): Move align into type_flags. (CLASSTYPE_ALIGN): Adjust accordingly. * call.c (direct_reference_binding): Remove misleading comment. 1999-08-30 Kaveh R. Ghazi * parse.y (language_string): Constify. 1999-08-30 Kaveh R. Ghazi * repo.c (getpwd): Don't prototype. * xref.c (getpwd): Likewise 1999-08-30 Kaveh R. Ghazi * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a. Remove hacks for stuff which now comes from libiberty. 1999-08-30 Jason Merrill * cp-tree.h (IS_AGGR_TYPE_2): Fix typo. 1999-08-30 Mark Mitchell * cp-tree.h (begin_init_stmts): Declare. (finish_init_stmts): Likewise. * cvt.c (build_up_reference): Wrap the declaration of a temporary in a statement-expression so that we will see it when expanding tree structure later. * init.c (begin_init_stmts): Don't make it static. (finish_init_stmts): Likewise. * cp-tree.h (start_handler_parms): New function. (expand_start_catch_block): Take only one parameter. (start_handler_parms): New function. * decl.c (start_handler_parms): Define it. * except.c (process_start_catch_block): Take only one parameter. Don't call grokdeclarator here. (expand_start_catch_block): Don't call grokdeclarator here, either. * parse.y (handler_args): Adjust call to expand_start_catch_block. Use start_handler_parms. * pt.c (push_template_decl_real): Make permanent lists have permanent elements. (tsubst_expr): Adjust calls to expand_start_catch_block appropriately. * semantics.c (expand_stmt): Likewise. 1999-08-29 Alex Samuel * pt.c (push_template_decl_real): Use template declaration from class type if it exists. 1999-08-29 Mark Mitchell * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition. (maybe_inject_for_scope_var): Declare it. (initialize_local_var): Likewise. * decl.c (maybe_inject_for_scope_var): Make it global. (initialize_local_var): Likewise. Move cleanup handling here, from cp_finish_decl. (make_rtl_for_nonlocal_decl): Use push_obstacks_nochange/pop_obstacks, rather than end_temporary_allocation/resume_temporary_allocation. (cp_finish_decl): Try to complete the type of a variable when it is declared. Move cleanup-handling to initialize_local_var. (expand_static_init): Use tree-building code, rather than RTL-building code. * decl2.c (get_temp_name): Assert non-initializedness of temporaries. * init.c (create_temporary_var): Move RTL-assigning code to ... (get_temp_regvar): Here. * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here. * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just call initialize_local_var to generate initialization code. 1999-08-29 Kaveh R. Ghazi * cp-tree.h (fndecl_as_string, type_as_string, type_as_string_real, args_as_string, decl_as_string, expr_as_string, code_as_string, language_as_string, parm_as_string, op_as_string, assop_as_string, cv_as_string, lang_decl_name, cp_file_of, lang_printable_name): Constify a char*. * errfn.c (cp_printer): Likewise. * error.c (cp_printer, fndecl_as_string, type_as_string_real, type_as_string, expr_as_string, decl_as_string, lang_decl_name, cp_file_of, code_as_string, language_as_string, parm_as_string, op_as_string, assop_as_string, args_as_string, cv_as_string): Likewise. * tree.c (lang_printable_name): Likewise. 1999-08-28 Richard Henderson * decl2.c (arg_assoc_class): Bail if the class is a builtin type. 1999-08-28 Mark Mitchell * cp-tree.h (strip_array_types): New function. * decl.c (maybe_deduce_size_from_array_init): New function, split out from cp_finish_decl. (layout_var_decl): Likewise. (maybe_commonize_var): Likewise. (maybe_inject_for_scope_var): Likewise. (initialize_local_var): Likewise. (build_cleanup_on_safe_obstack): Likewise. (check_initializer): Likewise. (make_rtl_for_nonlocal_decl): Likewise. (cp_finish_decl): Use them. * typeck.c (strip_array_types): New function. * cp-tree.def (LABEL_STMT): New tree node. * cp-tree.h (LABEL_STMT_LABEL): New macro. (shadow_label): Remove. (declare_local_label): New function. (finish_label_decl): Likewise. * decl.c (make_label_decl): New function, split out from lookup_label. (shadowed_labels): Remove. (binding_level): Add shadowed_labels. (clear_binding_level): Remove. (push_binding_level): Just bzero the new binding level. (pushlevel): Fix indentation. (pop_label): New function. (pop_labels): Likewise, split out from poplevel. (poplevel): Pop local labels. Use pop_labels. (maybe_push_to_top_level): Don't clear shadowed_labels. (lookup_label): Use make_label_decl. (shadow_label): Remove. (declare_local_label): New function. (define_label): Simplify. (start_function): Don't clear shadowed_labels. (cp_function): Remove shadowed_labels. (push_cp_function_context): Don't save shadowed_labels. (pop_cp_function_context): Don't restore it. * dump.c (dequeue_and_dump): Handle LABEL_STMT. * parse.y (label_decl): Use finish_label_decl. * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label declarations. * semantics.c (finish_label_stmt): Add a LABEL_STMT when building_stmt_tree. (finish_label_decl): New function. (expand_stmt): Handle LABEL_STMTs and local label declarations. 1999-08-26 Mark Mitchell * decl.c (lookup_label): Build labels on the permanent obstack when building statement trees. Don't build RTL for labels when building statement trees. * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when building statement trees. (finish_label_stmt): Likewise. (expand_stmt): Adjust accordingly. * pt.c (tsubst_expr); Likewise. (do_decl_instantiation): Robustify. * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro. * tree.c (build_cplus_new): Set it. * expr.c (cplus_expand_expr): Use it. * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR. * decl.c (store_parm_decls): Reset immediate_size_expand. (finish_function): Likewise. * tree.c (cplus_unsave_expr_now): Don't return a value. * semantics.c (do_poplevel): Always initialize the return value. 1999-08-26 Gavin Romig-Koch * cp-tree.h (cplus_unsave_expr_now) : Correct return type. * tree.h (cplus_unsave_expr_now) : Same. 1999-08-25 Mark Mitchell * decl.c (grokdeclarator): Amend comment. * except.c (expand_start_catch_block): Call push_template_decl for catch-block parameters. * method.c (synthesize_method): Build an empty compound statement for the body of a constructor. 1999-08-25 Jason Merrill * tree.c (cp_build_qualified_type_real): If we're asking for the same quals we already have, just return. 1999-08-25 Mark Mitchell * cp-tree.def (SUBOBJECT): New tree node. * cp-tree.h (CLEANUP_P): New macro. (SUBOBJECT_CLEANUP): Likewise. (keep_next_level): Add parameter. (get_temp_regvar): Don't declare. (emit_base_init): Remove parameter. (expand_aggr_init): Rename to build_aggr_init. (expand_vec_init): Rename to build_vec_init. (do_pushlevel): Remove. (do_poplevel): Likewise. (finish_cleanup): New function. (finish_subobject): Likewise. (stmts_are_full_exprs_p): New variable. * decl.c (keep_next_level): Add parameter. (cp_finish_decl): Use build_aggr_init, not expand_aggr_init. Use finish_expr_stmt to expand the code. (expand_static_init): Use tree-generating, not RTL-generating, functions to handle the initialization. (start_function): Remove dead code. Always have a momentary obstack inside the function, even before hitting the first curly brace. (cplus_expand_expr_stmt): Move calls to expand_{start,end}_target_temps into semantics.c. (cp_function): Add stmts_are_full_exprs_p. (push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * decl2.c (get_temp_regvar): Move to init.c. (do_static_initialization): Use build_{aggr,vec}_init. (do_static_destruction): Fix typo in comment. * dump.c (dequeue_and_dump): Handle INIT_EXPR. * except.c (expand_throw): Use create_temporary_var. * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. * init.c (expand_vec_init_try_block): Remove. (expand_vec_init_catch_clause): Likewise. (get_temp_regvar): New function. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. (perform_member_init): Use build_{aggr,vec}_init. Build up tree structure here. (emit_base_init): Likewise. Remove unused parameter. (expand_virtual_init): Likewise. (expand_cleanup_for_base): Use finish_subobject. (expand_aggr_vbase_init_1): Simplify. (construct_virtual_bases): Use tree-generating functions to build up initialization. (expand_aggr_init): Likewise. Rename to build_aggr_init. (expand_default_init): Likewise. (expand_aggr_init_1): Likewise. (expand_vec_init): Rename to build_vec_init. * method.c (do_build_copy_constructor): Use tree-generating functions. Don't call clear_last_expr. (do_build_assign_ref): Likewise. (synthesize_method): Call clear_last_expr here. * parse.y (base_init): Don't call clear_last_expr here. (nodecls): Likewise. * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. * semantics.c (do_pushlevel): Move to here. (do_poplevel): Likewise. (stmts_are_full_exprs_p): New variable. (finish_expr_stmt): Handle logic for temoprary cleanup here. (finish_for_stmt): Use finish_expr_stmt. (finish_cleanup): New function. (finish_function_try_block): Fix indentation. (finish_subobject): New function. (setup_vtbl_ptr): Call keep_next_level here. (finish_stmt_expr): Handle a block with no scope inside the statement-expression. (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle SUBOBJECT. * tree.c (search_tree): Handle INIT_EXPR. (mapcar): Likewise. * typeck.c (build_modify_expr): Don't build an RTL_EXPR. * typeck2.c (store_init_value): Change expand_aggr_init to build_aggr_init in comment. 1999-08-25 Mark Mitchell * dump.c (dequeue_and_dump): Dump TARGET_EXPRs. 1999-08-25 Nathan Sidwell * decl2.c (handle_class_head): Be graceful about additional scope qualifiers. Adjust comments to reflect reality. 1999-08-24 Jason Merrill * call.c (build_conditional_expr): Fix typo. * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an lvalue before trying to mess with the sides. * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly. Mon Aug 23 22:17:20 1999 Mumit Khan * g++spec.c (lang_specific_driver): Add room for NULL in arglist. 1999-08-23 Jason Merrill * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2. Return arbitrary pointer or NULL. (check_eh_spec): Call __throw_type_match_rtti_2. * tinfo.h (*::dcast): Return int. Add valp parm. * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers. * tinfo2.cc (__throw_type_match_rtti_2): Likewise. (__throw_type_match_rtti): Now just a wrapper. * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind. (init_exception_processing): Don't initialize them. 1999-08-23 Paul Burchard * decl.c (check_default_argument): Fix typo. 1999-08-22 Mark Mitchell * cp-tree.def (STMT_EXPR): Fix typo in node name. * dump.c (dump_next_stmt): New function. (dequeue_and_dump): Use it. * pt.c (tsubst_copy): Make sure to initialize return value for a STMT_EXPR, even when processing_template_decl. * semantics.c (finish_stmt_expr): A statement-expression whose last statement is not an expression-statement has type `void'. 1999-08-20 Mark Mitchell * semantics.c (finish_stmt_expr): Fix typo in comment. * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR. (mapcar): Likewise. * init.c (build_vec_delete_1): Make the children of a permanent BIND_EXPR permanent. * pt.c (register_specialization): Don't register a specialization more than once. 1999-08-18 Andrew Haley * method.c (process_overload_item): Call build_mangled_C9x_name () for all integer parameter types larger than long long. 1999-08-19 Mark Mitchell * pt.c (redeclare_class_template): Merge default template arguments in both directions. * typeck.c (common_type): Undo 1999-08-18 change. Remove compiler_error message. 1999-08-19 Jason Merrill * cp-tree.h: Declare flag_use_repository. * pt.c (do_decl_instantiation): Don't complain about duplicate instantiation with -frepo. (do_type_instantiation): Likewise. * pt.c (push_template_decl_real): Complain about everything that isn't a valid template. * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't affect inlines. 1999-08-19 Mark Mitchell * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code. * decl2.c (build_expr_from_tree): Handle it. * error.c (dump_expr): Likewise. * pt.c (for_each_template_parm): Likewise. (tsubst_copy): Likewise. * tree.c (search_tree): Likewise. * semantics.c (finish_pseudo_destructor_call): Create it. 1999-08-18 Mark Mitchell * search.c (setup_class_bindings): Robustify. * typeck.c (common_type): Use same_type_p, not pointer equality, to compare types. * cp-tree.h (build_lang_field_decl): Remove. * class.c (build_vtable): Replace calls to build_lang_field_decl with build_lang_decl. (prepare_fresh_vtable): Likewise. (finish_struct_1): Likewise. (init_class_processing): Likewise. * decl.c (push_using_decl): Likewise. (init_decl_processing): Likewise. (grokvardecl): Likewise. (build_ptrmemfunc_type): Likewise. (grokdeclarator): Likewise. (build_enumerator): Likewise. * decl2.c (grok_x_components): Likewise. (do_class_using_decl): Likewise. * except.c (call_eh_info): Likewise. * init.c (init_init_processing): Likewise. * rtti.c (expand_class_decl): Likewise. * tree.c (build_base_fields): Likewise. (build_vbase_pointer_fields): Likewise. * lex.c (build_lang_decl): Build declarations on the permanent obstack if we're building statmeent trees. (retrofit_lang_decl): Handle both the full lang_decl and also the smaller lang_decl_flags here. (build_lang_field_decl): Remove. * pt.c (push_template_decl_real): Issue errors for variable declarations that are not static members. 1999-08-18 Richard Henderson * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too. (mapcar): Likewise. 1999-08-17 Mark Mitchell * cp-tree.h (back_end_hook): New variable. * decl2.c (back_end_hook): Define it. (finish_file): If it's non-NULL, call it. * decl.c (add_decl_to_level): New function. (push_local_binding): Use it. (find_binding): Fix typo in comment. (pushdecl): Use add_decl_to_level. Put templates on the corresponding namespace-scope binding levels. * dump.c (dequeue_and_dump): Print the specializations of a template. * pt.c (push_template_decl_real): Don't push a template multiple times. 1999-08-17 Mark Mitchell * cp-tree.h (CALL_DECLARATOR_PARMS): New macro. (CALL_DECLARATOR_QUALS): Likewise. (CALL_DECARATOR_EXCEPTION_SPEC): Likewise. * decl.c (grokdeclarator): Adjust to use them. * decl2.c (grokfield): Likewise. (reparse_absdcl_as_casts): Likewise. * lex.c (make_call_declarator): Likewise. (set_quals_and_spec): Likewise. * pt.c (tsubst): Likewise. * tree.c (mapcar): Remove special hack to handle third operand of a CALL_EXPR. 1999-08-16 Mark Mitchell * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro. * class.c (build_vtable): Use build_lang_field_decl to build the VAR_DECLs for vtables. (prepare_fresh_vtable): Likewise. * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if CAN_HAVE_FULL_LANG_DECL_P. (push_using_decl): Use build_lang_decl to build USING_DECLs. (grokdeclarator): Use build_lang_decl to build TYPE_DECLs. * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P. (build_lang_field_decl): Likewise. (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much to copy. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. 1999-08-15 Mark Mitchell * pt.c (check_default_tmpl_args): Don't check in local scopes. (tsubst_decl): Make sure the declaration is on a saveable obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local variable. (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs. 1999-08-14 Jason Merrill Speed up Koenig lookup. * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm to return namespaces we've looked at. * decl2.c (lookup_using_namespace): Likewise. (add_function): Don't call ovl_member. (lookup_arg_dependent): Initialize k.namespaces to the list of namespaces seen in unqualified lookup. * call.c (equal_functions): Move here from tree.c. (joust): Use it to handle duplicate candidates. * tree.c (ovl_member): Use ==. 1999-08-13 Mark Mitchell * cp-tree.def (DECL_STMT): Make it smaller. * cp-tree.h (lang_decl_flags): Move saved_tree to ... (lang_decl): ... here. Add next. (DECL_SAVED_TREE): Adjust accordingly. (DECL_IMPLICIT_TYPEDEF_P): New macro. (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise. (DECL_STMT_DECL): Likewise. (create_implicit_typedef): New function. (maybe_push_decl): Likewise. (tsubst_default_argument): New function. (at_function_scope_p): Likewise. (add_decl_stmt): Likewise. (push_permanent_obstack): Likewise. * call.c (convert_default_arg): Use tsubst_default_argument. * class.c (add_method): Use push_permanent_obstack. (build_self_reference): Create a TEMPLATE_DECL for the self-reference, if necessary. * decl.c (pseudo_global_level_p): Only look at the current binding level. (push_binding): Use push_permanent_obstack. (create_implicit_typedef): New function. (pushtag): Use it. (duplicate_decls): Use push_permanent_obstack. (maybe_push_decl): New function. (start_decl): Use it. Remove dead code. Use add_decl_stmt. (start_decl_1): Remove dead code. (cp_finish_decl): Remove DECL_STMT handling here. Don't use pseudo_global_level_p. (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a template. (grokdeclarator): Likewise, for TYPE_DECLs. Don't use pseudo_global_level_p. * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in a template. (get_sentry): Use push_permanent_obstack. * dump.c (dequeue_and_dump): Enable DECL_STMT. * except.c (call_eh_info): Use push_permanent_obstack. (build_eh_type_ref): Likewise. (do_pop_exception): Likewise. (expand_eh_spec): Likewise. (alloc_eh_object): Likewise. (expand_throw): Likewise. * init.c (build_java_class_ref): Likewise. * lex.c (get_time_identifier): Likewise. (free_lang_decl_chain): Correct type. (retrofit_lang_decl): Adjust accordingly. (build_lang_field_decl): Likewise. * lex.h (free_lang_decl_chain): Likewise. * parse.y (lang_extdef): Don't use pseudo_global_level_p. * parse.c: Regenerated. * pt.c (tsubst_default_arguments): New function. (retrieve_local_specialization): Likewise. (register_local_specialization): Likewise. (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use pseudo_global_level_p to determine whether or not a template is primary. (lookup_template_class): Likewise. Use create_implicit_typedef. (instantiate_class_template): Call tsubst_default_arguments for member functions, if appropriate. (tsubst_default_argument): New function. (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs. * search.c (at_function_scope_p): New function. * semantics.c (finish_asm_stmt): Use push_permanent_obstack. (finish_label_stmt): Likewise. (add_decl_stmt): New function. (begin_class_definition): Likewise. (finish_typeof): Likewise. * tree.c (copy_template_template_parm): Likewise. (copy_to_permanent): Likewise. (push_permanent_obstack): Define. (mark_addressable): Use it. * typeck.c (mark_addressable): Likewise. 1999-08-13 Gavin Romig-Koch * cp-tree.h (init_cplus_unsave): New. (cplus_unsave_expr_now): New. * lex.c (init_parse): Call init_cplus_unsave. * tree.c (init_cplus_unsave): New. (cplus_unsave_expr_now): New. 1999-08-13 Mark Mitchell * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and decl_constant_value to simplify array bounds. 1999-08-11 Jason Merrill * lang-options.h: Add -fms-extensions. * cp-tree.h: Declare flag_ms_extensions. * decl2.c: Define it. * class.c (instantiate_type): Don't complain about taking the address of a bound member function if -fms-extensions. * typeck.c (build_unary_op): Likewise. * decl.c (grokdeclarator): Or about implicit int. * init.c (resolve_offset_ref): Or about implicit '&'. 1999-08-11 Mark Mitchell * cp-tree.h (minimal_parse_mode): Remove. (finish_label_stmt): New function. * decl.c (saved_scope): Remove minimal parse mode. (maybe_push_to_top_level): Don't save it. (pop_from_top_level): Don't restore it. (define_label): Split out template-handling code to semantics.c. (start_decl): Don't use minimal_parse_mode. (cp_finish_decl): Likewise. (start_function): Don't increment it. (store_return_init): Don't use it. (finish_function): Don't decrement it. * parse.y (label_colon): Use finish_label_stmt throughout. * parse.c: Regenerated. * pt.c (minimal_parse_mode): Don't define it. (tsubst_expr): Use finish_label_stmt. * semantics.c (finish_label_stmt): New function. * dump.c (queue): Be careful when computing bitmasks. (dequeue_and_dump): Describe binfos as binfos, not as vectors. * parse.y (pedantic): Give it itype. Adjust usage accordingly throughout. * parse.c: Regenerated. * Make-lang.in (CXX_SRCS): Remove sig.c. * Makefile.in (CXX_OBJS): Remove sig.o. (sig.o): Remove. * cp-tree.h (CPTI_OPAQUE_TYPE): Remove. (CPTI_SIGNATURE_TYPE): Likewise. (CPTI_SIGTABLE_ENTRY_TYPE): Likewise. (opaque_type_node): Likewise. (signature_type_node): Likewise. (sigtable_entry_type): Likewise. (flag_handle_signatures): Likewise. (lang_type): Remove is_signature, is_signature_pointer, is_signature_reference, has_opaque_typedecls, sigtables_has_been_generated. Adjust dummy. Remove signature, signature_pointer_to, signature_reference_to. (IS_SIGNATURE): Remove. (SET_SIGNATURE): Remove. (CLEAR_SIGNATURE): Remove. (IS_SIGNATURE_POINTER): Remove. (IS_SIGNATURE_REFERENCE): Remove. (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove. (SIGTABLE_HAS_BEEN_GENERATED): Remove. (CLASSTYPE_SIGNATURE): Remove. (SIGNATURE_TYPE): Remove. (SIGNATURE_METHOD_VEC): Remove. (SIGNATURE_POINTER_TO): Remove. (SIGNATURE_REFERENCE_TO): Remove. (lang_decl_flags): Remove is_default_implementation. Rename memfunc_pointer_to to saved_tree. (IS_DEFAULT_IMPLEMENTATION): Remove. (DECL_MEMFUNC_POINTER_TO): Remove. (DECL_MEMFUNC_POINTING_TO): Remove. (DECL_SAVED_TREE): Adjust definition. (tag_types): Remove signature_type_node. (SIGNATURE_FIELD_NAME): Remove. (SIGNATURE_FIELD_NAME_FORMAT): Likewise. (SIGNATURE_OPTR_NAME): Likewise. (SIGNATURE_SPTR_NAME): Likewise. (SIGNATURE_POINTER_NAME): Likewise. (SIGNATURE_POINTER_NAME_FORMAT): Likewise. (SIGNATURE_REFERENCE_NAME): Likewise. (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise. (SIGTABLE_PTR_TYPE): Likewise. (SIGTABLE_NAME_FORMAT): Likewise. (SIGTABLE_NAME_FORMAT_LONG): Likewise. (SIGTABLE_TAG_NAME): Likewise. (SIGTABLE_VB_OFF_NAME): Likewise. (SIGTABLE_VT_OFF_NAME): Likewise. (finish_base_specifiers): Change prototype. (build_signature_pointer_type): Remove. (build_signature_reference_type): Remove. (build_signature_pointer_constructor): Remove. (build_signature_method_call): Remove. (build_optr_ref): Likewise. (append_signature_fields): Likewise. (signature_error): Likewise. * call.c (build_this): Remove signature support. (build_over_call): Likewise. (build_new_method_call): Likewise. * class.c (add_implicitly_declared_members): Likewise. (finish_struct_1): Likewise. (finish_struct): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. (convert_to_pointer_force): Likewise. (ocp_convert): Likewise. * decl.c (sigtable_decl_p): Remove. (init_decl_processing): Remove support for signatures. (cp_finish_decl): Likewise. (grokdeclarator): Likewise. (grokparms): Likewise. (xref_tag): Likewise. (start_function): Likewise. (start_method): Likewise. * decl2.c (finish_sigtable_vardecl): Remove. (flag_handle_signatures): Remove. (lang_f_options): Remove handle-signatures. (grokfield): Remove support for signatures. (grokbitfield): Likewise. (finish_file): Likewise. (reparse_absdcl_as_casts): Likewise. * error.c (dump_type_real): Likewise. (dump_function_decl): Likewise. * friend.c (make_friend_class): Likewise. * gxx.gperf: Remove __signature__, signature, __sigof__, sigof. * hash.h: Regenerated. * init.c (build_new_1): Remove support for signatures. * lang-options.h: Remove -fhandle-signatures, -fno-handle-signatures. * lex.c (init_parse): Remove support for signatures. (yyprint): Likewise. * lex.h (rid): Remove RID_SIGNATURE. * method.c (build_decl_overload_real): Remove support for signatures. (hack_identifier): Likewise. * parse.y (base_class): Likewise. (base_class.1): Likewise. (access_specifier): Likewise. * search.c (lookup_member): Likewise. * semantics.c (finish_qualified_object_call_expr): Likewise. (finish_template_type_parm): Likewise. (begin_class_definition): Likewise. (finish_base_specifier): Likewise. * sig.c: Remove. * tree.c (build_cplus_method_type): Remove support for signatures. * typeck.c (require_complete_type): Likewise. (c_sizeof): Likewise. (c_alignof): Likewise. (build_object_ref): Likewise. (build_component_ref): Likewise. (build_indirect_ref): Likewise. (build_c_cast): Likewise. (build_modify_expr): Likewise. (convert_for_initialization): Likewise. * typeck2.c (signature_error): Remove. (store_init_value): Remove support for signatures. (digest_init): Likewise. (build_x_arrow): Likewise. (build_functional_cast): Likewise. * xref.c (GNU_xref_decl): Likewise. 1999-08-10 Martin v. Loewis * lex.c (do_identifier): Remove unnecessary lookup of class field. 1999-08-09 Martin v. Loewis * decl2.c (set_decl_namespace): Do not complain about non-matching decls if processing a template. 1999-08-09 Mark Mitchell * decl.c (build_ptrmemfunc_type): Handle qualified pointer-to-member types here. * tree.c (cp_build_qualified_type_real): Simplify handling here. 1999-08-09 Kaveh R. Ghazi * lex.c (lang_identify): Likewise. 1999-08-09 Bernd Schmidt * Makefile.in: Update dependencies. * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with NULL_RTX. * decl.c: Include "function.h" (cleanup_label, return_label): Delete declarations. (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX. (finish_function): Rename last_parm_insn variable to fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX. * decl2.c: Include "function.h". (rtl_expr_chain): Delete declaration. * method.c: Include "function.h" * tree.c (build_vbase_pointer_fields): Don't initialize DECL_SAVED_INSNS with NULL_RTX. * typeck.c: Include "function.h" 1999-08-09 Jason Merrill * semantics.c (begin_function_try_block, finish_function_try_block, finish_function_handler_sequence): New fns. * parse.y (function_try_block): Use them. * pt.c (instantiate_decl): Likewise. * cp-tree.h: Declare in_function_try_handler. * decl.c: Define it. (start_function): Clear it. (struct cp_function, push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * parse.y (function_try_block): Set and clear it. * except.c (expand_end_catch_block): Rethrow if we reach the end of a function-try-block handler in a ctor or dtor. * typeck.c (c_expand_return): Complain about returning from a function-try-block handler of a ctor. * parse.y (function_try_block): Call end_protect_partials before expand_start_all_catch. 1999-08-08 Jason Merrill * decl.c (struct binding_level): Add eh_region field. (push_binding_level): Set it. (define_label): Complain about jumping into an EH block. * ptree.c (print_lang_type): Print the real type of a PMF. Print what exceptions a fn type throws. 1999-08-07 Kaveh R. Ghazi * class.c (count_fields, add_fields_to_vec): Add static prototype. * cp-tree.h (opname_tab, assignop_tab, operator_name_string, get_id_2, composite_pointer_type, dump_node_to_file): Constify a char*. * decl.c (named_label_list, cp_finish_decl, grokdeclarator): Constify a char*. * decl2.c (finish_static_data_member_decl, grokfield): Constify a char*. * dump.c (queue_and_dump_index, dump_int, dump_string, dump_string_field, dequeue_and_dump, dump_node_to_file): Constify a char*. (dump_stmt): Add static prototype. * errfn.c (cp_thing): Constify a char*. * error.c (dump_unary_op, dump_binary_op, aggr_variety, dump_aggr_type, dump_global_iord, dump_decl, dump_function_name, dump_expr): Constify a char*. * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc, read_line_number): Add static prototype. (opname_tab, assignop_tab, operator_name_string): Constify a char*. (real_yylex): Move label `letter' into the scope where it is used. * method.c (build_mangled_template_parm_index, build_overload_int, build_decl_overload_real, get_id_2): Constify a char*. * search.c (check_final_overrider): Make static. * typeck.c (composite_pointer_type): Constify a char*. 1999-08-06 Jason Merrill * pt.c (maybe_get_template_decl_from_type_decl): Make sure that we're looking at a class. * decl.c (lookup_name_real): Set the complain flag if we're looking for a namespace member. * lex.c (real_yylex): We can have a number with no digits. * cvt.c (cp_convert_to_pointer): Don't force pmf conversions. * search.c (binfo_from_vbase): New fn. * cp-tree.h: Declare it. * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion from pointer to member of virtual base. * typeck.c (get_delta_difference): Likewise. 1999-08-06 Alexandre Oliva * pt.c (tsubst): Use build_index_type to build in-template array index type. Fixes g++.oliva/dwarf1.C. * decl.c (grokdeclarator): Likewise, just for consistency, as it doesn't seem to trigger the bug without it. 1999-08-06 Jason Merrill * typeck2.c (add_exception_specifier): Use complete_type. 1999-08-06 Mark Mitchell * error.c (dump_expr): Handle EXACT_DIV_EXPR. (dump_binary_op): Bulletproof. * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR]. * tree.c (search_tree): Don't enumerate all the nodes of classes `1', `2', and `<'; handle them generically. Don't be sorry about "unrecognized tree codes"; just abort. (no_linkage_check): Don't do linkage checks for templates. * tree.c (cp_build_qualified_type_real): Handle pointer-to-member-function types correctly. 1999-08-05 Jason Merrill * decl.c (pushdecl): Only give an error for shadowing a parm from *this* function. Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) * typeck2.c: Update URLs and mail addresses. 1999-08-04 Nathan Sidwell * cp-tree.h (empty_except_spec): New global var. (compexcepttypes): Remove prototype. (comp_except_specs): Prototype new global function. (add_exception_specifier): Prototype new global function. * decl.c (empty_except_spec): Define new global var. (duplicate_decls): Use comp_except_specs, reword error message. (init_decl_processing): Initialize empty_except_spec. Adjust build_exception_variant calls. * parse.y (exception_specification_opt): Use empty_except_spec. (ansi_raise_identifier): Call check_for_new_type. (ansi_raise_identifiers): Use add_exception_specifier. * pt.c (tsubst): Use add_exception_specifier to build exception specifier. * search.c (check_final_overrider): New static function, broken out of get_matching_virtual. Check throw specifiers, reword diagnostics. (get_matching_virtual): Use check_final_overrider. * tree.c (build_exception_variant): Use comp_except_specs. * typeck.c (compexcepttypes): Remove. (comp_except_types): New static function, helper for comp_except_specs. Compare two types as exception specifiers. (comp_except_specs): New global function, compare two exception specifiers. (comptypes): Adjust for comp_except_specs. * typeck2.c (add_exception_specifier): New global function. * class.c (check_for_override): Reword error message. 1999-08-03 Nathan Sidwell * call.c (convert_arg_to_ellipsis): Use pod_type_p. * cp-tree.h (struct lang_type): Added non_pod_class flag. (CLASSTYPE_NON_POD_P): New macro to access it. * class.c (finish_struct_1): Determine non-PODness. Check for arrays of pointers (-Weffc++). Remove array inspection duplicated code. * tree.c (pod_type_p): Detect non-pod non-aggregate types. Use CLASSTYPE_NON_POD_P. 1999-08-03 Nathan Sidwell * class.c (duplicate_tag_error): Preserve template information. 1999-08-03 Nathan Sidwell * decl.c (start_enum): Show location of previous definition. * parse.y (enumlist_opt): New reduction. (structsp): Simplify enum rules to use enumlist_opt. 1999-08-03 Jason Merrill * lex.c (yyprint): Handle PFUNCNAME. * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only build_expr_from_tree on the args of a TEMPLATE_ID_EXPR. 1999-08-03 Mumit Khan * decl.c (start_decl): Set attributes before duplicate_decls call. 1999-08-02 Mark Mitchell * Make-lang.in (CXX_SRCS): Add dump.c. * Makefile.in (CXX_OBJS): Add dump.o. (dump.o): New target. * cp-tree.h (DECL_CONV_FN_P): Document. (DECL_OVERLOADED_OPERATOR_P): New function. (TYPE_PTRMEM_CLASS_TYPE): New macro. (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE. (ASM_VOLATILE_P): New macro. (STMT_LINENO): Likewise. (cp_namespace_decls): New function. (dump_node_to_file): New function. * decl.c (cp_namespace_decls): New function. (walk_namespaces_r): Use it. (wrapup_globals_for_namespace): Likewise. * decl2.c (flag_dump_translation_unit): New variable. (lang_decode_option): Handle -fdump-translation-unit. (finish_file): If flag_dump_translation_unit is set, dump the translation unit. * dump.c: New file. * lang-options.h: Add -fdump-translation-unit. * pt.c (tsubst_template_parms): Robustify. (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P. (tsubst_expr): Use STMT_LINENO. * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check for invalid cv-qualifiers even while building templates. 1999-08-02 Richard Henderson * call.c: Include defaults.h instead of expr.h. * decl.c: Likewise. * pt.c: Likewise. * typeck.c: Include defaults.h. 1999-08-02 Mark Mitchell * lex.c (errorcount, sorrycount): Don't declare. * repo.c (errorcount, sorrycount): Likewise. * typeck2.c (errorcount, sorrycount): Likewise. 1999-08-02 Jakub Jelinek * call.c (convert_default_arg, build_over_call): Change all uses of PROMOTE_PROTOTYPES, so that it tests it as a C expression. Ensure expr.h is included. * decl.c (grokparams): Ditto. * pt.c (tsubst_decl): Ditto. * typeck.c (convert_arguments): Ditto. 1999-08-02 Jason Merrill * class.c (mark_overriders): Fix order of args to overrides. (warn_hidden): Likewise. Fix for having virtual and non-virtual functions with the same name. 1999-08-02 Richard Henderson * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null. 1999-08-01 Mark Mitchell * call.c (build_conditional_expr): Fix typo in comment. 1999-08-01 Bernd Schmidt * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack, case_stack; use in_control_zone_p. * typeck.c (c_expand_return): Likewise. 1999-07-31 Bernd Schmidt * except.c (catch_clauses): Delete declaration. 1999-07-30 Mark Mitchell * call.c (build_conditional_expr): Call convert_from_reference to avoid reference/non-reference type confusion. Fix typo. 1999-07-30 Richard Henderson * typeck2.c (initializer_constant_valid_p): Moved to c-common.c. * cp-tree.h (initializer_constant_valid_p): Remove. 1999-07-28 Mark Mitchell * call.c (conditional_conversion): Don't build BASE_CONVs for conversions between things that have the same type. (build_conditional_expr): Tweak. (convert_like): Some BASE_CONVs really do require the generation of code. * init.c (perform_member_init): Don't go through build_modify_expr for simple initializations. 1999-07-27 Jason Merrill * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro. * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for virtual functions and MI. Simplify. * method.c: Remove prototype for largest_union_member. * pt.c (determine_specialization): Fix uninitialized warning. * lex.c (real_yylex): Likewise. 1999-07-27 Mark Mitchell * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS here too. * cp-tree.h (BINFO_VIRTUALS): Document new format. * class.c (modify_one_vtable): Change prototype accordingly. (modify_all_vtables): Likewise. (modify_all_direct_vtables): Likewise. (modify_all_indirect_vtables): Likewise. (build_vtable_entry_for_fn): New function. (set_rtti_entry): Simplify for new BINFO_VIRTUALS format. (modify_vtable_entry): Likewise. (add_virtual_function): Likewise. (build_vtbl_initializer): New function. (finish_vtbls): Simplify for new BINFO_VIRTUALS format. (fixup_vtable_deltas1): Likewise. (fixup_vtable_deltas): Likewise. (override_one_vtable): Likewise. (finish_struct_1): Likewise. * error.c (dump_expr): Likewise. * search.c (get_abstract_virtuals_1): Likewise. (get_abstract_virtuals): Likewise. (expand_upcast_fixups): Likewise. * tree.c (debug_binfo): Likewise. * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to __pure_virtual here. 1999-07-26 Mark Mitchell * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error as per 1999-07-26 change. * typeck.c (c_sizeof): Don't allow non-static data members. (expr_sizeof): Likewise. 1999-07-26 Jason Merrill * input.c (feed_input): Only touch lineno and input_filename if !USE_CPPLIB. Save the old values before setting the new ones. * input.c (feed_input): Add file, line parms. * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust. (real_yylex): Check linemode before input_redirected(). * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL from op new to warning. 1999-07-26 Mark Mitchell * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion. * call.c: All uses changed. * typeck.c: Likewise. 1999-07-26 Nathan Sidwell * exception.cc (__cplus_type_matcher): Match __eh_matcher prototype. 1999-07-26 Mark Mitchell * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro. (ARITHMETIC_TYPE_P): Adjust definition for standard conformance. (strip_top_quals): Declare. (ncp_convert): Likewise. (type_after_usual_arithmetic_conversions): Likewise. (composite_pointer_type): Likewise. * call.c (strip_top_quals): Don't make it static. (promoted_arithmetic_type_p): New function. (conditional_conversion): Likewise. (null_ptr_cst_p): Allow `false' as a NULL pointer constant. (standard_conversion): Use same_type_p. Don't build BASE_CONVs for converting a type to itself. (reference_binding): Honor LOOKUP_NO_TEMP_BIND. (implicit_conversion): Make sure the from and to types are complete. (add_builtin_candidate): Correct handling of ?: operator. (add_builtin_candidates): Improve documentation. (build_conditional_expr): New function. (can_convert): Implement in terms of can_convert_arg. (ncp_convert): New function. * typeck.c (type_after_usual_arithmetic_conversions): New function, split out from common_type. (composite_pointer_type): New function, split out from build_conditional_expr. (common_type): Use type_after_usual_arithmetic_conversions. Remove redundant attribute merging. (comptypes): Tidy. Handle COMPLEX_TYPE. (build_binary_op_nodefault): Use null_ptr_cst_p. (build_conditional_expr): Remove. (convert_for_assignment): Use new conversion functions. * cp-tree.h (abstract_virtuals_error): Change declaration. * typeck2.c (abstract_virtuals_error): Check to see if an error occurred, and return a boolean value accordingly. (build_functional_cast): Adjust accordingly. * class.c (finish_struct_1): Likewise. * cvt.c (ocp_convert): Likewise. * decl.c (cp_finish_decl): Likewise. (grokparams): Likewise. (grok_op_properties): Likewise. (start_function): Likewise. * init.c (build_new_1): Likewise. * pt.c (unify): Don't get confused by pointers-to-member functions. * search.c (build_cplus_new): Robustify. 1999-07-24 Richard Henderson * gxx.gperf (__builtin_va_arg): New. * parse.y (VA_ARG): New token. (unary_expr): Recognize it. Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com) * g++FAQ.texi: Deleted per Joe Buck's request. * Makefile.in: Corresponding changes. 1999-07-23 Jason Merrill * lex.c: Sync with C frontend. (whitespace_cr): New fn. (skip_white_space): Use it. (init_parse): Reorder. (yyprint): Support CONSTANT. (pragma_getc, pragma_ungetc): Bring back. (read_line_number): Change in_system_header directly. (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file. (parse_float): Update to C version. (yylex): Handle '$' under the letter case. Remove looking_for_typename handling. Support hex floating point constants. Follow C's lead for choosing type of integer constants. Rearrange stuff to match C frontend. (yyungetc, reinit_parse_for_block, yylex): Support indent_level. * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC. 1999-07-23 Mark Mitchell * call.c (reference_binding): Tweak. (mayble_handle_implicit_object): Use direct_reference_binding to create the right implicit conversion sequence. 1999-07-22 Mark Mitchell * pt.c (convert_nontype_argument): Don't call decl_constant_value if we're converting to a reference type. * call.c (NEED_TEMPORARY_P): New macro. (standard_conversion): Set it, for derived-to-base conversions. (reference_related_p): New function. (reference_compatible_p): Likewise. (convert_class_to_reference): Likewise. (direct_reference_binding): Likewise. (reference_binding): Rework for standards-compliance. (convert_like): Adjust accordingly. (maybe_handle_ref_bind): Simplify; the right conversion sequences are now built up in reference_binding. (initialize_reference): New function. * cp-tree.h (ICS_USER_FLAG): Document. (ICS_THIS_FLAG): Likewise. (ICS_BAD_FLAG): Likewise. (NEED_TEMPORARY_P): Likewise. (cp_lvalue_kind): New type. (real_lvalue_p): Return it. * error.c (dump_expr): Provide more accurate representation for AGGR_INIT_EXPRs. * init.c (expand_default_init): Do not try to perform implicit conversions for a brace-enclosed initializer. * search.c (lookup_conversions): Document. * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate appropriately. (real_lvalue_p): Adjust accordingly. (lvalue_p): Likewise. (build_cplus_new): Don't allow the creation of an abstract class. * typeck.c (convert_for_initialization): Use initialize_reference. 1999-07-21 Gavin Romig-Koch * lex.c (real_yylex) : Correct the test for overflow when lexing integer literals. 1999-07-20 Jason Merrill * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL, not DECL_BUILT_IN, to determine if a function is internally declared. (duplicate_decls): Likewise. Improve handling of builtins. (push_overloaded_decl): Remove special handling of builtins. * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P. * decl.c (grokdeclarator): Pull out decl_constant_value in templates, too. * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm. * cp-tree.h, pt.c, semantics.c: Adjust. * method.c (largest_union_member): Remove. * lang-specs.h (c++-cpp-output): Pass -fpreprocessed. * lex.c (token_getch, token_put_back): New fns. (real_yylex): Use them. * lex.c (lang_init): Generalize. (lang_init_options): Tell cpplib this is C++. (nextchar): Remove. Replace uses with put_back. (skip_white_space): Handle linemode here. Optimize for cpplib. (extend_token_buffer_to): New fn. (extend_token_buffer): Use it. (read_line_number, check_newline): Just deal with tokens. (real_yylex): More cpplib optimizations. Simplify. Don't produce EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here. * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING. * parse.y (PAREN_STAR_PAREN): Remove. * input.c: Don't use the putback machinery with cpplib. (sub_getch): Fold back into getch. (getch): Don't handle linemode here. (feed_input): Unget any text in the token buffer. * lex.c (set_typedecl_interface_info, set_vardecl_interface_info, nextyychar, nextyylval): Remove. 1999-07-20 Michael Tiemann Jason Merrill * lex.c (indent_level): New variable. (init_parse): Set cpp_token to CPP_DIRECTIVE. (consume_string): Make this smart about USE_CPPLIB. (yyungetc): Use put_back function. (pragma_getc, pragma_ungetc): Functions deleted. (check_newline): Rewrite to be intelligent about USE_CPPLIB. Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and pragma_ungetc. (real_yylex): Rewrite to be intelligent about USE_CPPLIB. Also, clean up cases where we redundantly set token_buffer[0]. (read_line_number): New fn. * input.c (feed_input): Use integrated cpplib if USE_CPPLIB. (end_input): Call cpp_pop_buffer if USE_CPPLIB. (sub_getch): Conditionalize out code that's not appropriate if USE_CPPLIB. (put_back): Rewrite in case USE_CPPLIB is defined. (input_redirected): Ditto. Tue Jul 20 11:24:19 1999 Bernd Schmidt * cp-tree.h: Delete lots of declarations of tree nodes; replaced by c_global_trees and accessor macros defined in c-common.h. (cp_tree_index): New enumeration. (cp_global_trees): Declare new array. Add accessor macros for it, and delete declarations of tree nodes replaced by it. (builtin_function): Delete macro, add declaration for new function. Include c-common.h. * decl.c: Delete definitions for tree nodes that were replaced by cp_global_trees and c_global_trees. (init_decl_processing): Call c_common_nodes_and_builtins; delete code to generate the common builtins here. (builtin_function): New function. * decl2.c (abort_fndecl): Delete declaration. * except.c (expand_builtin_return_address): Delete declaration. (builtin_return_address_fndecl): Delete variable. (const_ptr_type_node): Delete declaration. * lex.c (cons_up_default_function): Delete declaration of void_list_node. * parse.y (void_list_node): Delete declaration. * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type): Delete variables. (const_string_type_node): Delete declaration. * search.c (abort_fndecl): Delete declaration. * Makefile.in: Update dependencies. 1999-07-19 Mark Mitchell * pt.c (check_default_tmpl_args): Move test for missing default arguments here, from ... (end_template_parm_list): Here. 1999-07-18 Mark Mitchell * decl.c (lookup_nested_type): Remove. (pushtag): Don't call it. Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com) * Makefile.in (INTERFACE): Bump to 2. 1999-07-17 Alexandre Oliva * typeck2.c (my_friendly_abort): Updated URL with bug reporting instructions to gcc.gnu.org. Removed e-mail address. 1999-07-17 Mark Mitchell * pt.c (determine_specialization): Tighten error-checking. (end_template_parm_list): Likewise. 1999-07-14 Mark Mitchell * pt.c (check_default_tmpl_args): Handle friends defined in the class just like member functions defined in the class. 1999-07-09 Michael Tiemann Jason Merrill * cp-tree.h (struct lang_decl): Added field for storing sorted FIELD_DECLs (used in TYPE_DECLs). (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union. (DECL_SORTED_FIELDS): New macro. * class.c (method_name_cmp): New function. (finish_struct_methods): Modified to support sorting and searching methods. (finish_struct_anon): Changed code in inner loop to use ELT rather than UELT (which required an extra indirection for every reference). (field_decl_cmp): New function to support sorting FIELD_DECLs. (finish_struct_1): Sort fields. * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them. (lookup_fnfields_1): Search sorted methods in METHOD_VEC. Also, switch to using array indexing rather than a changing pointer. * ptree.c (print_lang_decl): Handle TYPE_DECLs that have DECL_SORTED_FIELDS. 1999-07-09 Jason Merrill * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style casts in system headers or extern "C" blocks. * pt.c (do_decl_instantiation): Downgrade duplicate instantiation errors to pedwarn. 1999-07-09 Michael Tiemann * decl2.c (write_virtuals): Deleted declaration. * cp-tree.h (write_virtuals): Deleted extern declaration. * class.c (finish_struct_1): Removed #if 0'd code that mentions write_virtuals. * semantics.c (begin_class_definition): Rewrite code to not depend on write_virtuals. * lex.c (cp_pragma_interface): New function. (cp_pragma_implementation): Likewise. (handle_cp_pragma): Call them. * typeck.c (comptypes): Simplify C code in look_hard. * xref.c (PALLOC): Use xcalloc, not calloc. (SALLOC): Use xmalloc, not malloc. * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary. * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS is NO_DEBUG. * decl.c (duplicate_decls): If a redeclaration doesn't match the initial declaration, then don't save the inline info and by all means don't mark the function as a builtin function. * decl.c (lookup_name_real): Set NONCLASS to 1 if CURRENT_CLASS_TYPE is 0. * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to NULL_TREE. * ptree.c (print_lang_type): Added vtable-needs-writing. Wed Jul 7 01:26:47 1999 Alexandre Oliva * decl2.c (mark_vtable_entries): Fix check for rtti offset. 1999-07-06 Gavin Romig-Koch * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : Merged into c-common. 1999-07-05 Dave Brolley * lex.c (errorcount): Declare it. (finish_parse): Update errorcount for when using CPPLIB. 1999-07-05 Mark Mitchell * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template parameters. (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro. * decl.c (push_class_binding): Use it. (lookup_name_real): Likewise. 1999-07-02 Gavin Romig-Koch * cp-tree.h (widest_integer_literal_type_node, widest_unsigned_literal_type) : New. * decl.c (widest_integer_literal_type_node, widest_unsigned_literal_type) : New. (init_decl_processing): Handle/use the two new types. * lex.c (real_yylex): Same. * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : Same. 1999-07-01 Mark Mitchell * decl.c (grokdeclarator): Don't give names "for linkage purposes" to anonymous cv-qualified types. 1999-07-01 Gavin Romig-Koch * lex.c (real_yylex) : Change integer literal overflow handling to be like c-lex.c. * lex.c (real_yylex): Improve 'integer constant out of range' messages. 1999-06-28 Richard Henderson * decl.c (cp_finish_decl): Fix typo in cp_warning_at call. 1999-06-28 Jason Merrill * error.c (dump_type_real): Handle TREE_LIST again. * typeck.c (comp_target_parms): Don't complain about converting from () to (...) if !flag_strict_prototype. * decl.c (grokdeclarator): Update the names of all variants when de-anonymizing. 1999-06-21 Mark Mitchell * init.c (expand_aggr_vbase_init): Rename to construct_virtual_bases. Conditionalize construction here, rather than ... (emit_base_init): Here. 1999-06-19 Mark Mitchell * semantics.c (finish_asm_stmt): Apply decay conversions to input operands. * decl.c (expand_static_init): When building an anonymous function for use with atexit, compute its body before and after entering the function. * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and EXIT_EXPR. 1999-06-18 Mark Mitchell * init.c (expand_aggr_vbase_init): Add flag parameter. (build_partial_cleanup_for): Remove, inlining into .. (expand_cleanup_for_base): ... here. Take flag parameter. (emit_base_init): Pass the in_chrg parameter to emit_aggr_vbase_init. (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base. 1999-06-16 Mark Mitchell * decl2.c (import_export_decl): Use same_type_p, rather than relying on pointer-equality for types. * method.c (do_build_copy_constructor): Simplify. * call.c (build_method_call): Remove bogus code for two-argument delete. * init.c (build_new_1): Expand on comment, and remove dead code. * init.c (expand_cleanup_for_base): New function, split out from ... (emit_base_init): Here. (expand_aggr_vbase_init): Use it. 1999-06-15 Mark Mitchell * cp-tree.h (class_cache_firstobj): Declare. (maybe_push_cache_obstack): Rename to push_cache_obstack. * class.c (permanent_obstack): Remove declaration. (class_cache_firstobj): Make it global. (add_method): Don't use permanent_obstack directly. (pushclass): Only free the class_cache_obstack if we know how far back to free it. (maybe_push_cache_obstack): Rename to push_cache_obstack. * decl.c: Remove dead comment. (saved_scope): Add class_cache_firstobj. (push_to_top_level): Save it. (pop_from_top_level): Restore it. (push_class_level_binding): Use push_cache_obstack, not maybe_push_cache_obstack. * search.c (push_class_decls): Likewise. 1999-06-14 Martin von Löwis * pt.c (tsubst_friend_function): Push into namespace of friend function before pushdecl'ing it. 1999-06-14 Nathan Sidwell * call.c (build_new_op): Remove REF_BIND from all operands. 1999-06-13 Alexandre Oliva * init.c (build_new_1): Look up operator delete even if there was no explicit new placement. 1999-06-08 Nathan Sidwell * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out of ... (build_throw): ... here. Call it. (process_start_catch_block): Call it. 1999-06-07 Mark Mitchell * search.c (convert_pointer_to_single_level): Reimplement without using get_binfo. 1999-06-06 Mark Mitchell * method.c (is_back_referenceable_type): Back-reference bools when not squangling. 1999-06-07 Dave Brolley * lex.c (real_yylex): Replace unused bytes from bad multibyte char. * input.c (putback_buffer): New structure type. (putback): Replaces putback_char member. (putback): Replaces putback_char static variable. (feed_input): Use putback. (end_input): Use putback. (sub_getch): Use putback. (put_back): Use putback. 1999-06-05 Mark Mitchell * decl.c (grokdeclarator): Fix typo in last change. 1999-06-04 Jason Merrill * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack. (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise. 1999-06-04 Nathan Sidwell * except.c (build_throw): Check throw expression validity. 1999-06-03 Mark Mitchell * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned just because flag_signed_bitfields is false. 1999-06-03 Nathan Sidwell * semantics.c (begin_class_definition): Update the struct's location here ... * class.c (finish_struct): ... rather than here. * decl.c (make_typename_type): Don't rely on uninitialized variable. 1999-05-31 Kaveh R. Ghazi * Makefile.in (ALL_CFLAGS): Add '-W -Wall'. 1999-05-31 Mark Mitchell * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange and friends rather than messing with current_obstack directly. (cp_build_qualified_type_real): Rework ARRAY_TYPE allocation to match practice throughout the rest of the compiler. 1999-05-30 Mark Mitchell * lex.c (make_lang_type): Create TYPE_BINFO for TEMPLATE_TYPE_PARMs just like for non-template types. * decl.c (start_decl): Move checks on initialization to ... (cp_finish_decl): Here. Tidy formatting slightly. 1999-05-28 Mark Mitchell * decl.c (add_binding): Don't complain about a redeclaration of a semantically identical typedef in a local scope. 1999-05-28 Nathan Sidwell * decl.c (complete_array_type): Allocate off same obstack. Fix DO_DEFAULT comment to match reality. * friend.c (make_friend_class): Fix diagnostic typo. 1999-05-28 Mark Mitchell * decl.c (lookup_namespace_name): Handle getting a TEMPLATE_ID_EXPR. (expand_static_init): Don't call pushdecl for implicitly declared `atexit' used to register destructors. 1999-05-25 Mark Mitchell * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to initialize a vtable. * cp-tree.h (NAMESPACE_LEVEL): Reformat. (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes by combining TEMPLATE_INFO and LEVEL into a single union. (DECL_TEMPLATE_INFO): Reformat. (DECL_SAVED_TREE): Document. (DECL_TEMPLATE_INJECT): Remove. * class.c (finish_struct): Remove code to deal with DECL_TEMPLATE_INJECT. * decl.c (maybe_process_template_type_declaration): Handle all new types in templates uniformly. * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not DECL_CONTEXT. * pt.c (lookup_template_class): Inject template instantiations of forward-declarations. (instantiate_class_template): Remove code processing DECL_TEMPLATE_INJECT. * pt.c (lookup_template_class): Tweak lookup to find member templates. * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into ASM_CV_QUAL. * semantics.c (finish_asm_stmt): Make strings permanent if they're used in a template. 1999-05-25 Jason Merrill * typeck.c (casts_away_constness, casts_away_constness_r): Strip both parts of pointer to data member types. 1999-05-24 Mark Mitchell * decl2.c (mark_vtable_entries): Don't make a copy of a function, and then make it look like `abort'. Just use `abort' instead. * typeck.c (build_static_cast): Don't allow static_casts that cast away constness. (casts_away_constness_r): New function. (casts_away_constness): Likewise. * decl.c (lookup_tag): Remove code no longer needed after name-lookup improvements. * decl2.c (handle_class_head): Make error-recovery more robust. * friend.c (make_friend_class): Reject templated typename types. * lex.c (is_global): A template parameter isn't global. * parse.y (class_head): Robustify. * parse.c: Regenerated. 1999-05-22 Mark Mitchell * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs, INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs. * cp-tree.h (push_nested_namespace): Declare. (pop_nested_namespace): Likewise. * decl.c (push_nested_namespace): New function. (pop_nested_namespace): Likewise. * pt.c (instantiate_class_template): Use them. * tree.c (mapcar): Handle NON_LVALUE_EXPR. * cp-tree.h (cplus_expand_constant): Declare. * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're converted from one pointer-to-object type to another. * expr.c (cplus_expand_constant): Don't make it static. * typeck.c (build_component_ref): Don't crash when presented with a component which is a TEMPLATE_DECL. (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a cast from a pointer-to-member constant to its own type does not result in a valid non-type template argument. 1999-05-21 Mark Mitchell Nathan Sidwell * Make-lang.in (cc1plus): Make it depend on gxx.gperf. * cp-tree.h: Fix typo in documentation on pointers-to-members. (cp_build_qualified_type): Make it a macro. (cp_build_qualified_type_real): Declare. * decl.c (grokdeclarator): Remove misleading comment. Avoid problem with template parameters and restrict-qualification. * gxx.gperf: Replace NORID with RID_UNUSED throughout. * hash.h: Regenerated. * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into the enumeration. (NORID): Remove definition. * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real. (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs. (fn_type_unification): Check that the function type resulting from the deduction is legal. (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially. (unify): Use cp_build_qualified_type_real. * tree.c (build_cplus_array_type_1): Handle error_marks as inputs. (cp_build_qualified_type): Rename to ... (cp_build_qualified_type_real): Add additional COMPLAIN parameter and modify appropriately. * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to reveal optimization opportunities. * pt.c (tsubst): Don't issue error messages when we're not complaining, even if we see a qualified function type. (check_cv_quals_for_unify): Don't allow a qualified function type. 1999-05-20 Jason Merrill * class.c (instantiate_type): Downgrade errors for object-dependent memfn refs to pedwarn. 1999-05-20 Mark Mitchell * decl.c (grokdeclarator): Don't treat [] as indicating a zero-sized array in a typedef. * call.c (build_object_call): Don't look at DECL_NAME for a type. (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK. (typeck.c): Or TYPE_MAIN_VARIANT for a type. * pt.c (for_each_template_parm): Rework to match documentation. Don't be fooled by a COMPONENT_REF with no TREE_TYPE. 1999-05-20 Jason Merrill * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P. * class.c (finish_base_struct): Allow non-COM bases for COM classes except at the leftmost position. (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable): Pass the binfo's class, not the most derived, to skip_rtti_stuff. * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise. * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue. (build_cplus_new): Make sure that what we return is of the right type. 1999-05-20 Mark Mitchell * cp-tree.h (make_ptrmem_cst): New function. * expr.c (cplus_expand_constant): Split out from ... (cplus_expand_expr): Here. Use cplus_expand_constant. (init_cplus_expand): Set lang_expand_constant. * pt.c (convert_nontype_argument): Use make_ptrmem_cst. * tree.c (make_ptrmem_cst): Define. * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst. * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst. 1999-05-19 Mark Mitchell * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P. * decl2.c (start_static_storage_duration_function): Fix comment. (finish_file): Create static storage duration functions lazily. 1999-05-19 Jason Merrill Implement anonymous structs. * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P. * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust. * class.c (finish_struct_1): Remove redundant check for anon struct. * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union. (check_tag_decl): Check for anonymous struct here. * decl2.c (build_anon_union_vars): Catch anon struct at file scope. * init.c (sort_member_init, emit_base_init): Handle getting fields as well as names in current_member_init_list. (perform_member_init): Handle getting an anon aggr. * method.c (do_build_assign_ref): Don't descend into anon aggrs. (do_build_copy_constructor): Likewise. 1999-05-19 Mark Mitchell * tree.c (cp_build_qualified_type): Don't allow qualified function types. Wed May 19 02:50:53 1999 Arvind Sankar * gxxint.texi: Fix typo. 1999-05-19 Jason Merrill * call.c (find_scoped_type, resolve_scope_to_name): Lose. * class.c (finish_struct_1): Use CLASS_TYPE_P. * ptree.c (print_lang_type): Likewise. * typeck.c (build_modify_expr, c_expand_asm_operands): Use IS_AGGR_TYPE_CODE. * typeck2.c (digest_init): Likewise. 1999-05-18 Jason Merrill * call.c (joust): Compare the types of the conv ops, not the target types of the conversions. Tue May 18 00:21:34 1999 Zack Weinberg * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc was not given. 1999-05-17 Mark Mitchell * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation. * decl.c (grokfndecl): Don't allow inline declarations of friend template specializations, or friend template specializations with default arguments. * pt.c (tsubst): Handle substitution into array types that does not yield a fixed upper bound, even when not processing a template. (tsubst_copy): Deal with the fact that the second operand to a TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC. * search.c (marked_pushdecls_p): Don't descend into TEMPLATE_TYPE_PARMs and the like. (unmarked_pushdecls_p): Likewise. * call.c (build_over_call): Don't throw away initializations/copies of empty classes; use MODIFY_EXPR and INIT_EXPR as for non-empty classes. * class.c (finish_struct_1): Put the padding byte for an empty class on the TYPE_NONCOPIED_PARTS list for the class. 1999-05-16 Mark Mitchell * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that indicate a reference to a field that is a qualified name. 1999-05-16 Jason Merrill * decl2.c (finish_objects): Don't use .?tors.* if we don't have ASM_OUTPUT_CONSTRUCTOR. * friend.c (do_friend): Add attrlist arg. Remove support for getting a non-decl as 'decl'. * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or rtl. (grokdeclarator): Adjust. * cp-tree.h: Adjust. 1999-05-16 Mark Mitchell * cp-tree.h (permanent_p): New function. * init.c (build_new_1): Use mapcar, not copy_node, to copy a possibly complex tree node. * tree.c (mapcar): Adjust comments, and follow coding standards in conditional. (permanent_p): New function. 1999-05-13 Per Bothner * class.c (push_lang_context): Turn off DECL_IGNORED_P for primitive Java types, if we actually see `extern "Java"'. 1999-05-10 18:21 -0400 Zack Weinberg * lang-specs.h: Pass -$ to the preprocessor. 1999-05-10 Jason Merrill * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too. Don't bother wrapping an OFFSET_TYPE around unknown_type_node. (resolve_offset_ref): Don't handle a raw baselink. * cvt.c (build_expr_type_conversion): Likewise. * typeck.c (decay_conversion, build_c_cast, convert_for_assignment, convert_for_initialization): Likewise. * class.c (instantiate_type): Handle seeing a baselink under an OFFSET_REF. * error.c (dump_expr): Likewise. * pt.c (for_each_template_parm): Likewise. (resolve_overloaded_unification): Likewise. * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise. * typeck.c (expr_sizeof): Also complain about other permutations of overloaded functions. 1999-05-07 Jason Merrill * init.c (resolve_offset_ref): Don't return a raw method. Use BASELINK_P. * typeck.c (decay_conversion): Don't handle a raw method. Resolve all OFFSET_REFs. (get_member_function_from_ptrfunc): 0 is a valid vtable index. (build_binary_op_nodefault): Handle resolving overloaded fns. Use same_type_p for pmf bits. Don't use build_binary_op to compare raw pointers to methods. (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE, to decide when to call resolve_offset_ref. (build_c_cast, convert_for_initialization): Likewise. * cvt.c (build_expr_type_conversion): Likewise. 1999-05-06 Nathan Sidwell * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class. 1999-05-05 Mark Mitchell * decl2.c (start_objects): Don't let static constructors and destructors get inlined. * parse.y (nested_name_specifier): Make sure ordinary types are complete, just like template types. * parse.c: Regenerated. * pt.c (check_explicit_specialization): Improve error messages. 1999-05-04 Martin von Löwis * typeck.c (string_conv_p): Use same_type_p to check whether we try to convert between char and wchar_t. 1999-05-03 Mark Mitchell * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous lookup to error_mark_node here. (lookup_member): Revise documentation. Add comments. Don't set the TREE_TYPE to error_mark_node here, and don't build up an extra TREE_LIST for ambiguous lookups. (setup_class_bindings): Adjust accordingly. (push_class_decls): Revise out-of-date comments. * typeck.c (build_const_cast): Tighten checks for legality. 1999-05-02 Martin von Löwis * init.c (build_member_call): Lookup names coming from namespace-scoped LOOKUP_EXPR. 1999-05-03 Jim Blandy * gxxint.texi: Add documentation for 'I'. 1999-05-02 Martin von Löwis * tinfo.cc (operator==): Qualify type_info with std::. 1999-05-02 Mark Mitchell * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy. (DECL_COMDAT): Remove definition. 1999-05-01 Mark Mitchell * decl.c (wrapup_globals_for_namespace): Fix thinko in previous change. 1999-04-30 Mark Mitchell * class.c (build_vtable): Use build_lang_decl when building vtables, not just build_decl. (prepare_fresh_vtable): Likewise. * decl.c (wrapup_globals_for_namespace): Mark vtables as DECL_EXTERNAL when calling wrapup_global_declarations. * decl2.c (priority_info_s): Add initializations_p and destructions_p members. (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED, when deciding what vtables to write out. (ssdf_decls): New variable. (ssdf_decls_used): Likewise. (start_static_storage_duration_function): Deal with being called multiple times. Avoid inlining this function. (generate_inits_for_priority): Deal with reuse of priority map. (get_priority_info): Clear initializations_p and destructions_p. (do_static_initialization): Tweak comment. (do_static_destruction): Likewise. Fix condition on sentries for destruction. (generate_ctor_or_dtor_function): Call all of the static storage duration functions. (generate_ctor_or_dtor_function_for_priority): Check initializations_p and destructions_p to see what priorities need initialization functions. (finish_file): Rework to generate multiple static storage duration functions, rather than just one. * typeck.c (build_const_cast): Tweak last change to handle templates correctly. * typeck.c (build_const_cast): Disallow use of const_cast to anything but a pointer or reference type. 1999-04-30 Nathan Sidwell * decl.c (cp_finish_decl): Don't permit arrays of abstract or signature type. 1999-04-29 Mark Mitchell * decl2.c (do_static_destruction): Remove obsolete FIXME comment. (finish_file): Indent comments properly. 1999-04-29 Richard Henderson * decl2.c (do_static_initialization): Call do_pending_stack_adjust. (do_static_destruction): Likewise. 1999-04-29 Nathan Sidwell * cp-tree.h (TYPE_NOTHROW_P): New macro. * decl2.c (delete_sanity): Warn on deleting void *. * init.c (build_new_1): Use TYPE_NOTHROW_P. * typeck.c (c_expand_return): cp_pedwarn on returning NULL from throwing operator new. 1999-04-28 Nathan Sidwell * cp-tree.h (build_component_addr): Remove prototype. * typeck.c (build_component_addr): Make static. Remove MSG argument. (build_component_addr): Remove MSG parameter, clean up comment. (build_x_function_call): Use cp_error. (build_unary_op): Adjust call of build_component_addr. 1999-04-28 Mark Mitchell * pt.c (tsubst_friend_class): Check for NULL. Wed Apr 28 11:42:22 1999 Andreas Schwab * search.c (binfo_for_vtable): Initialize bfvi.var. 1999-04-27 Nathan Sidwell * rtti.c (build_x_typeid): Check rtti is enabled. 1999-04-26 Mark Mitchell * search.c (is_subobject_of_p): Make sure we're looking at the right baseclasses. 1999-04-26 Marc Espie * Make-lang.in (cplib2.ready): Don't depend on phony targets. 1999-04-23 Mark Mitchell * decl2.c (finish_file): Tweak handling of extern inlines so that they are not unnecessarily put out. * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and such as base classes. 1999-04-22 Brendan Kehoe * tree.c (build_exception_variant): Fix typo: use the chain of U, not trying V, while cycling through U. 1999-04-22 Mark Mitchell * cp-tree.h (lang_decl_flags): Remove returns_first_arg and preserves_first_arg. Enlarge dummy accordingly. (DECL_TINFO_FN_P): New macro. (SET_DECL_TINFO_FN_P): Likeiwse. (DECL_RETURNS_FIRST_ARG): Remove. (DECL_PRESERVES_THIS): Likewise. (DECL_INIT_PRIORITY): New macro. (finish_struct_1): Change prototype. (cat_namespace_levels): Remove prototype. (vtable_decl_p): New prototype. (vtype_decl_p): Likewise. (sigtable_decl_p): Likewise. (walk_globals_pred): New typedef. (walk_globals_fn): Likewise. (walk_globals): New prototype. (walk_namespaces_fn): New typedef. (walk_namespaces): New prototype. (wrapup_globals_for_namespace): Likewise. (walk_vtables): Remove prototype. (walk_sigtables): Likewise. (instantiate_pending_templates): New prototype. * class.c (finish_struct_1): Don't return a value. * decl.h (pending_statics): Remove declaration. * decl.c (walk_namespaces_r): New function. (walk_globals_r): Likewise. (vtable_decl_p): Likewise. (vtype_decl_p): Likewise. (sigtable_decl_p): Likewise. (walk_namespaces): Likewise. (walk_globals_data): New type. (walk_globals): New function. (wrapup_globals_for_namespace): Likewise. (expand_static_init): Remove assertion. Remove redundancy in conditional. Don't put static data members in static_aggregates Tidy. (finish_function): Remove redundancy in conditional. Don't set DECL_RETURNS_FIRST_ARG. (cat_namespace_levels): Remove. * decl2.c: Include splay-tree.h and varray.h. (priority_info_s): New structure. (finish_vtable_vardecl): Change prototype. Adjust for new calling conventions. (prune_vtable_vardecl): Likewise. (finish_sigtable_vardecl): Likewise. (setup_initp): Remove. (do_dtors): Remove. (do_ctors): Remove. (start_static_storage_duration_function): New function. (generate_inits_for_priority): Likewise. (finish_static_storage_duration_function): Likewise. (get_priority_info): Likewise. (do_static_initialization): Likewise. (do_static_destruction): Likewise. (do_static_initialization_and_destruction): Likewise. (generate_ctor_or_dtor_function): Likewise. (generate_ctor_and_dtor_functions_for_priority): Likewise. (pending_statics): Make it a varray. (pending_statics_used): New variable. (saved_inlines): Make it a varray. (saved_inlines_used): New variable. (finish_static_data_member): Change method of updating pending_statics. (mark_inline_for_output): Remove #if 0'd code. Change method of updating saved_inlines. (walk_vtables): Remove. (walk_sigtables): Likewise. (import_export_decl): Use DECL_TINFO_FN_P. (pending_templates): Remove declaration. (maybe_templates): Likewise. (static_aggregates_initp): Likewise. (setup_initp): Likewise. (finish_objects): Simplify. (INITIALIZE_P_IDENTIFIER): New macro. (PRIORITY_IDENTIFIER): New macro. (SSDF_IDENTIFIER): New macro. (initialize_p_decl): New variable. (priority_decl): Likewise. (ssdf_decl): Likewise. (priority_info_map): Likewise. (finish_file): Recode output of static intializers and other file-scope finalization tasks. * error.c (OB_END_TEMPLATE_ID): New macro. (dump_type_real): Use it. (dump_decl): Likewise. (dump_function_name): Likewise. * lex.c (set_typedecl_interface_info): Adjust for new walk_globals interface. (check_newline): Use walk_globals, not walk_vtables. * pt.c (pending_tempalte_expansions): Remove. (set_vardecl_interface_info): Likewise. (pending_templates): Make static. (maybe_templates): Likewise. (instantiate_class_template): Adjust call to finish_struct_1. (instantiate_pending_templates): New function. * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P. * tree.c (static_aggregates_initp): Remove. (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY instead. * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h. * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes with the RTL code RETURN. * hash.h: Regenerated. * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD. * parse.y: Replace RETURN with RETURN_KEYWORD throughout. * parse.c: Regenerated. * pt.c: Include varray.h. Include rtl.h since varray.h requires it. (inline_parm_levels): New variable. (inline_parm_levels_used): Likewise. (maybe_begin_member_template_processing): Update them. (maybe_end_member_template_processing): Use them, rather than guessing how many levels to pop. * decl.c (make_typename_type): Tighten error-checking. 1999-04-20 Mark Mitchell * cp-tree.h (build_binary_op): Remove unneeded parameter. * class.c (build_vrable_entry_ref): Adjust call to build_binary_op. * decl.c (expand_static_init): Likewise. (grokdeclarator): Likewise. (finish_function): Likewise. * decl2.c (delete_sanity): Likewise. (do_dtors): Likewise. (do_ctors): Likewise. * error.c (dump_type_suffix): Likewise. * expr.c (cplus_expand_expr): Likewise. * init.c (resolve_offset_ref): Likewise. (build_new): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (expand_vec_init_catch_clause): Likewise. (build_delete): Likewise. * pt.c (tsubst): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * search.c (expand_upcast_fixups): Likewise. (expand_direct_vtbls_init): Likewise. * typeck.c (get_member_function_from_ptrfunc): Likewise. (build_binary_op_nodefault): Likewise. (point_int_sum): Likewise. (pointer_diff): Likewise. (build_unary_op): Likewise. (build_modify_expr): Likewise. (get_delta_difference): Likewise. (build_ptrmemfunc): Likewise. (expand_ptrmemfunc_cst): Likewise. 1999-04-20 Jason Merrill * decl.c (grokfndecl): Always call cplus_decl_attributes. * decl2.c (grokfield): Pass attrlist to grokdeclarator. 1999-04-19 Mark Mitchell * cp-tree.h (finish_static_data_member_decl): New function. * decl2.c (finish_static_data_member_decl): Split out from ... (grokfield): Here. * pt.c (instantiate_class_template): Use it here instead of trying to fake it. (tsubst_decl): Don't set DECL_ASSEMBLER_NAME; finish_static_data_member_decl will do that. Explicit set DECL_EXTERNAL to match non-template processing. 1999-04-18 Mark Mitchell * cp-tree.h (finish_class_definition): Add parameter. * parse.y (structsp): Use it. Don't call pop_scope here. * parse.c: Regenerated. * semantics.c (finish_class_definition): Pop it here. 1999-04-17 Mark Mitchell * decl.c (xref_tag): Revise handling of nested template declarations. * pt.c (check_explicit_specialization): Tweak handling of friend templates in template classes. (tsubst_friend_class): Handle friend declarations for nested member template classes. 1999-04-16 Mark Mitchell * class.c (finish_struct): Remove unused variable. (pushclass): Likewise. (invalidate_class_lookup_cache): Likewise. * cp-tree.def (TYPENAME_TYPE): Improve documentation. * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME doesn't get obliterated. (make_typename_type): Handle template classes correctly. * cp-tree.h (TREE_NONLOCAL_FLAG): Remove. (storetags): Declare. * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG. (pushclass): Likewise. Use storetags to install tag declarations, not pushtag. (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG. * decl.c (storetags): Make it global. (push_class_binding): Set INHERITED_VALUE_BINDING_P for an implicit typename declaration. (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG. * method.c (hack_identifier): Likewise. * search.c (lookup_member): Likewise. * decl.c (warn_about_implicit_typename_lookup): New function. (lookup_name_real): Use it. Rework handling of implicit typename extension. 1999-04-15 Mark Mitchell * cp-tree.h (lookup_nested_field): Remove. * class.c (push_nested_class): Handle UNION_TYPEs. (pop_nested_class): Likewise. * decl.c (lookup_name_real): Don't call lookup_nested_field. (start_decl): Use push_nested_class, not just pushclass. (cp_finish_decl): Use pop_nested_class, not just popclass. * search.c (lookup_nested_field): Remove. * cp-tree.h (lang_type): Add documentation. * decl2.c (handle_class_head): Create template declarations here, as appropriate. * parse.y (class_head): Return whether or not we entered a new scope, as well as the type named. (named_class_head): Likewise. (named_complex_class_head_sans_basetype): Likewise. (structsp): Adjust accordingly. Pop scope when required. * parse.c: Regenerated. * pt.c (check_default_tmpl_args): Robustify. (redeclare_class_template): Likewise. (instantiate_class_template): An instantiation of an anonymous union is itself an anonymous union. * semantics.c (begin_class_definition): Don't create template declarations here. 1999-04-15 Jason Merrill * parse.y (after_type_declarator_intern): New nonterminal. (after_type_declarator): Use it. (direct_after_type_declarator): Likewise. Move above nonnested_type to fix reduce/reduce conflict resolution. (declmods): Reducing from just 'attributes' has EMPTY precedence. * Makefile.in (CONFLICTS): Update. * decl.c (define_label): Downgrade error for jumping over a non-POD decl to pedwarn. 1999-04-14 Mark Mitchell * cp-tree.h (popclass): Change declaration. (pop_nested_class): Likewise. (poplevel_class): Remove declaration. * call.c (convert_default_argument): Pass no arguments to popclass. * class.c (finish_struct_1): Likewise. (finish_struct): Likewise. (popclass): Remove argument. Simplify code accordingly. (pop_nested_class): Likewise. * decl.c (poplevel_class): Declare it here, and make it static. (poplevel): Handle class scopes. (poplevel_class): Don't take an rgument. Simplify. (pop_everything): Pass no arguments to pop_nested_class. (cp_finish_decl): Pass no arguments to popclass. (grokdeclarator): Pass no arguments to pop_nested_class. (finish_function): Likewise. * decl2.c (grokfield): Likewise. (pop_scope): Pass no arguments to popclass. * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class. * pt.c (instantiate_class_template): Move call to pushclass, and document. Pass no arguments to popclass. (regenerate_decl_from_template): Likewise. 1999-04-14 Jason Merrill * typeck.c (build_unary_op): Handle taking the address of a unique bound non-static member function. 1999-04-13 Martin von Loewis * lang-options.h (-Wdeprecated): New flag. * decl2.c (warn_deprecated): New flag. (lang_decode_option): Deprecated this-is-variable, external-templates, alt-external-templates. Support -Wdeprecated. * errfn.c (cp_deprecated): New function. 1999-04-13 Jason Merrill * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead of the decls themselves. * pt.c (tsubst_function_type): Copy attributes over. * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority and com_interface. * cp-tree.h: Add prototype. * decl.c (init_decl_processing): Set valid_lang_attribute. 1999-04-13 Mark Mitchell * class.c (finish_struct_1): Look at the const-ness of the field's type, not the TREE_READONLY-ness of the declaration. * method.c (synthesize_method): Likewise. * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when creating new declarations. 1999-04-13 Mike Stump * decl2.c (import_export_decl): Because vtables always reference virtual functions, even if they are inlined, don't allow -fno-implement-inlines to not emit them, instead, emit them with the vtable. * decl.c (start_function): Likewise. 1999-04-12 Jason Merrill * cp-tree.h (struct lang_type): Add com_interface. (CLASSTYPE_COM_INTERFACE): New macro. * class.c (set_rtti_entry): COM interface classes have no RTTI entries in their vtables; adjust. (add_virtual_function, finish_base_struct, skip_rtti_stuff, modify_one_vtable, fixup_vtable_deltas1, override_one_vtable, finish_struct_1): Likewise. * decl2.c (mark_vtable_entries): Likewise. * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise. * search.c (get_abstract_virtuals_1, get_abstract_virtuals, expand_upcast_fixups): Likewise. * tree.c (debug_binfo): Likewise. * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro. * typeck.c (comptypes): If we get it, ignore attributes. * class.c (instantiate_type): Use BASELINK_P. Change complain parameter to flags; 2 means ignore attributes. * call.c (build_op_delete_call): Pass it. * decl.c (xref_tag): Only complain once about using a typedef-name with 'struct'. Downgrade to pedwarn. * decl.c (grokdeclarator): Allow [] syntax for zero-length array. * parse.y (absdcl_intern): New nonterminal. (absdcl, direct_abstract_declarator): Use it. * pt.c (lookup_template_class): Look through implict typename. 1999-04-11 Mark Mitchell * friend.c (add_friend): Deal gracefully with error_mark_node. * method.c (build_overload_value): Handle pointers-to-members as template parameters. * decl.c (push_binding): Fix typo in comment. 1999-04-10 Mark Mitchell * error.c (dump_type_real): If a typename is a template-id, put out the template arguments. (dump_expr): Handle TEMPLATE_ID_EXPR. * pt.c (lookup_template_class): Now that full arguments are available everywhere, remove code that tried to guess them. 1999-04-09 Mark Mitchell * decl.c (make_typename_type): Complain if we don't find a type when trying to make a typename type for a non-template type. 1999-04-09 Jason Merrill * decl.c (start_decl): Pass attributes to grokdeclarator. (grokdeclarator): Handle attributes on constructor-syntax initializers. 1999-04-08 Mark Mitchell * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands don't have types. * search.c (template_self_reference_p): Tweak. 1999-04-07 Mark Mitchell * init.c (build_offset_ref): Don't build yet another weird data structure to describe overloaded functions. 1999-04-06 Mark Mitchell * cp-tree.h (BASELINK_P): New macro. (SET_BASELINK_P): Likewise. * init.c (build_member_call): Remove needless assignment in if statement. * search.c (lookup_field_r): Fix handling when we are looking specifically for a type; these are not hidden by functions and variables. (lookup_member): Use SET_BASELINK_P. * tree.c (is_overloaded_fn): Use BASELINK_P. (really_overloaed_fn): Likewise. (get_first_fn): Likewise. 1999-04-05 Mark Mitchell * decl.c (lookup_name_current_level): Tweak, and improve documentation. * class.c (maybe_fixup_vptrs): Remove declaration. (build_class_init_list): Likewise. * decl.c (pushdecl_class_level): Call check_template_shadow here ... (push_class_level_binding): ... not here. * search.c (dfs_push_type_decls): Only avoid template-self-reference TYPE_DECLs if they are from base classes. 1999-04-04 Mark Mitchell * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL nodes. Tidy. 1999-04-03 Jason Merrill * class.c (maybe_fixup_vptrs, build_class_init_list): Lose. (finish_struct_1): Don't call build_class_init_list. 1999-04-02 Mark Mitchell * tinfo.h (__class_type_info): Fix illegal declaration. * cp-tree.def (TEMPLATE_ID_EXPR): Update comment. * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro. (IDENTIFIER_CLASS_VALUE): Improve documentation. (is_properly_derived_from): Declare. (invalidate_class_lookup_cache): Likewise. (maybe_maybe_note_name_used_in_class): Likewise. (note_name_declared_in_class): Likewise. (push_using_decl): Remove duplicate declaration. (id_in_current_class): Remove declaration. (push_class_binding): Change prototype. (clear_identitifer_class_values): Declare. * call.c (is_properly_derived_from): Make it global. (build_new_function_call): Be careful about updating candidates. (build_new_method_call): Handle COMPONENT_REFs. Don't crash when asked to make illegal calls. * class.c: Include splay-tree.h. (class_stack_node): Add names_used slot. (check_member_decl_is_same_in_complete_scope): Remove. (add_method): Fix comment. Push the declaration into class scope. (finish_struct_1): When popping the class, pop the bindings too. Remove check for data member/function member conflict. (finish_struct): Remove calls to check_member_decl_is_same_in_complete_scope. Change calls to popclass. (pushclass): Clear names_used in the class stack entry. Use invalidate_class_lookup_cache to remove cached entries, rather than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE before entering a new class. Remove dead code. Don't mess with current_function_decl when pushing declarations. (invalidate_class_lookup_cache): New function, split out from ... (popclass): Here. Clean up names_used on our way out. (instantiate_type): Adjust. (build_self_reference): Don't push the declaration here. (maybe_note_name_used_in_class): New function. (note_name_declared_in_class): Likewise. * decl.c (add_binding): Change prototype. (find_class_binding_level): New function. (innermost_nonclass_level): Likewise. (current_binding_level): Update documentation. (inner_binding_level): Remove. Replace with current_binding_level throughout. (push_binding_level): Remove special handling of class_binding_level. (pop_binding_level): Likewise. Use find_class_binding_level. (suspend_binding_level): Likewise. (global_bindings_p): Use innermost_nonclass_level. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (pseudo_global_level_p): Likewise. (push_binding): Clear INHERITED_VALUE_BINDING_P. (add_binding): Check for illegal multiple declarations. Return a value indicating whether or not the new binding was legal. (push_local_binding): Skip over class binding levels. Check return value from add_binding. (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call note_name_declared_in_class. (pushlevel_class): Remove "fake out the rest of the compiler" code. (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs. (clear_identifier_class_values): New function. (pop_from_top_level): Use it. (pop_everything): Tweak. (maybe_process_template_type_declaration): Don't push the declaration for the template here. (pushtag): Don't push tag declarations into class scope here. (pushdecl): Apply DeMorgan's law for readability. (pushdecl_class_level): Remove special-case code for TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions. (push_class_level_bindng): Deal with inherited bindings. (lookup_name_real): Remove special-case code for TYPE_BEING_DEFINED, and some implicit typename magic. (grokdeclarator): Handle COMPONENT_REF for a template function. (build_enumerator): Don't call pushdecl_class_level here. (id_in_current_class): Remove. * decl2.c (grokfield): Don't call pushdecl_class_level or check_template_shadow. * errfn.c (cp_file_of): Don't declare. (cp_line_of): Likewise. * error.c (dump_decl): Handle an OVERLOAD. (cp_file_of): Likewise. (cp_line_of): Likewise. * init.c (build_member_call): Handle a COMPONENT_REF. * lex.c (do_identifier): Call maybe_note_name_used_in_class, not pushdecl_class_level. * method.c (hack_identifier): Build COMPONENT_REFs for references to member templates as well as member functions. Remove dead code. * parse.y (left_curly): Remove. (nonnested_type): Call maybe_note_name_used_in_class, not pushdecl_class_level. * parse.c: Regenerated. (nested_name_specifier_1): Likewise. * pt.c (check_explicit_specialization): Adjust, for robustness. (check_template_shadow): Handle OVERLOADs. (build_template_decl): Set DECL_CONSTRUCTOR_P on the TEMPLATE_DECL, if appropriate. * search.c (envelope_add_decl): Remove. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (dfs_push_decls): New function. (dfs_push_type_decls): Likewise. (setup_class_bindings): Likewise. (template_self_reference_p): Likewise. (lookup_field_r): Use it. (looup_member): Remove old comment. Deal with ambiguity. (push_class_decls): Use dfs_push_decls and dfs_push_type_decls, and remove envelope processing. * semantics.c (begin_class_definition): Let pushclass push declarations for base classes. (finish_member_declaration): Push declarations into class scope. * typeck.c (build_component_ref): Just put an OVERLOAD into the COMPONENT_REF, not a TREE_LIST of an OVERLOAD. (build_x_function_call): Deal with OVERLOAD. Handle template-ids. * Makefile.in (class.o): Depend on splay-tree.h. Wed Mar 31 11:30:43 1999 Nathan Sidwell * cvt.c (convert_pointer_to_real): Use same_type_p. * typeck.c (comp_target_types): Use same_type_p. 1999-03-31 Jason Merrill * semantics.c (begin_inline_definitions, finish_inline_definitions): Rename from finish_default_args and begin_inline_definitions, respectively, to something that isn't a total lie. :) * parse.y (structsp): Adjust. * tree.c (hash_tree_cons): Remove obsolete via_* parms. (list_hash_lookup): Likewise. (hash_tree_chain): Adjust. * pt.c (tsubst): Adjust. (tsubst_arg_types): Use plain hash_tree_cons. * cp-tree.h (hash_tree_cons_simple): Lose. * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons. Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi * Makefile.in (hash.h): Generate using gperf language 'C', not 'KR-C', so gperf uses the `const' keyword on strings. * gxx.gperf (resword): Const-ify a char*. 1999-03-30 Jason Merrill * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST, CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES, CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH, CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST, CLASSTYPE_BINFO_AS_LIST): Remove cruft. * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c, tree.c: Adjust. 1999-03-29 Jason Merrill * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall. 1999-03-28 Jason Merrill * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops. 1999-03-27 Mark Mitchell * cp-tree.h (add_friend): Declare. (add_friends): Likewise. * friend.c (add_friend): Make it global. Don't add to DECL_BEFRIENDING_CLASSES if the befriending class is a template. (add_friends): Make it global. (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the befriending class is a template. * parse.y (component_decl_1): Fix typo in comment. * parse.c: Regenerated. * pt.c (instantiate_class_template): Use add_friend and add_friends rather that duplicating some of their functionality here. 1999-03-27 Jason Merrill * call.c (build_field_call): Unify 'this' and non-'this' cases. * typeck.c (build_indirect_ref): Check for 'this' sooner. Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi * call.c (op_error): Const-ify a char*. (add_candidate, source_type, add_warning): Add static prototype. (print_z_candidates): Const-ify a char*. * class.c (resolve_address_of_overloaded_function, fixed_type_or_null, build_vtable_entry_ref): Add static prototype. (get_vtable_name, finish_struct_1): Const-ify a char*. * cvt.c (convert_to_reference): Likewise. * decl.c (redeclaration_error_message, record_builtin_type, record_unknown_type, member_function_or_else, bad_specifiers): Likewise. (find_binding, select_decl, unqualified_namespace_lookup, lookup_flags, qualify_lookup, record_builtin_java_type, tag_name): Add static prototype. (warn_extern_redeclared_static, duplicate_decls, pushdecl, implicitly_declare, record_builtin_java_type, define_function, grok_op_properties, tag_name): Const-ify a char*. * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const. (define_function, finish_builtin_type): Const-ify a char*. (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn, cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args. (file_name_nondirectory): Const-ify a char*. (init_filename_times): Don't prototype. (compiler_error): Prototype. (yyerror, init_repo): Const-ify a char*. (build_srcloc): Don't prototype. (build_x_indirect_ref, build_indirect_ref, build_component_addr): Const-ify a char*. (warn_for_assignment): Don't prototype. (convert_for_initialization, readonly_error, check_for_new_type, GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call): Const-ify a char*. * decl2.c (acceptable_java_type, output_vtable_inherit, setup_initp, start_objects, finish_objects, do_dtors, do_ctors, merge_functions, decl_namespace, validate_nonmember_using_decl, do_nonmember_using_decl): Add static prototype. (lang_f_options): Const-ify a char*. (finish_builtin_type): Likewise. (add_function, arg_assoc_namespace, arg_assoc_class): Add static prototype. * errfn.c: Include cp-tree.h. (cp_thing): Add static prototype. (compiler_error): Don't protoptype. (cp_compiler_error): Cast `compiler_error' to `errorfn' before passing it to `cp_thing'. * error.c (interesting_scope_p): Add static prototype. * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify a char*. * init.c (compiler_error): Don't prototype. (member_init_ok_or_else): Const-ify a char*. (build_java_class_ref): Add static prototype. * lex.c (compiler_error): Don't prototype. (get_time_identifier, interface_strcmp, extend_token_buffer, handle_cp_pragma): Const-ify a char*. (is_global, init_filename_times): Add static prototype. (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*. (compiler_error): Change from fixed args to variable args. (yyerror): Const-ify a char*. * parse.y (cond_stmt_keyword): Const-ify a char*. (parse_decl): Add static prototype. * pt.c (template_args_equal, print_template_context): Likewise. (print_candidates, check_default_tmpl_args): Const-ify a char*. (instantiate_class_template): Likewise. * repo.c (get_base_filename, open_repo_file, init_repo): Likewise. * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise. * search.c (lookup_field_info, lookup_member): Likewise. (lookup_member): Cast the first argument of `bzero' to a PTR. * sig.c (compiler_error): Don't prototype. (build_signature_pointer_or_reference_nam): Const-ify a char*. (get_sigtable_name, build_member_function_pointer): Likewise. * tree.c (compiler_error): Don't prototype. (no_linkage_helper, build_srcloc): Add static prototype. (build_vbase_pointer_fields): Const-ify a char*. (__eprintf): Don't unnecessarily handle `const' when !__STDC__. * typeck.c (compiler_error): Don't prototype. (convert_for_assignment): Const-ify a char*. (comp_cv_target_types): Add static prototype. (build_x_indirect_ref, build_indirect_ref, convert_arguments, build_component_addr, build_unary_op, convert_for_initialization): Const-ify a char*. * typeck2.c (ack): Add static prototype and change from fixed args to variable args. (readonly_error, check_for_new_type): Const-ify a char*. * xref.c (_XREF_FILE, find_file, filename, fctname, declname, fixname, open_xref_file, classname, GNU_xref_begin): Likewise. (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'. (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call, gen_assign, GNU_xref_member): Const-ify a char*. 1999-03-25 Martin von Löwis * gxxint.texi: Remove old discussion on copying virtual bases. 1999-03-25 Zack Weinberg * Make-lang.in: Remove all references to g++.o/g++.c. Link g++ from gcc.o. 1999-03-25 Jason Merrill * decl2.c (comdat_linkage): Treat vtables like functions. 1999-03-25 Mark Mitchell * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES. 1999-03-25 Nathan Sidwell * decl.c (init_decl_processing): Add `signed' type as a synonym for `int'. 1999-03-25 Jason Merrill * typeck.c (common_type): Handle cv-qual unification for pointers to members. * decl.c (unqualified_namespace_lookup): Return error_mark_node on error. (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing. * lex.c (do_identifier): If we got error_mark_node, call lookup_name again. 1999-03-24 Martin von Löwis * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty classes. 1999-03-24 Jason Merrill * decl.c (lookup_name_real): Do nested field lookup regardless of TYPE_BEING_DEFINED. 1999-03-24 Mark Mitchell * cp-tree.h (lang_type): Remove has_assignment and has_real_assignment. Add befriending_classes. (TYPE_HAS_ASSIGNMENT): Remove. (TYPE_HAS_REAL_ASSIGNMENT): Likewise. (CLASSTYPE_BEFRIENDING_CLASSES): New macro. (lang_decl): Document. (DECL_BEFRIENDING_CLASSES): New macro. (FRIEND_NAME): Move declaration to more obvious location. (FRIEND_DECLS): Likewise. * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT. * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES. (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT. (grok_op_properties): Likewise. * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS. (add_friend): Likewise. Don't do weird things with assignment operators. Update DECL_BEFRIENDING_CLASSES. (add_friends): Don't do weird things with assignment operators. (make_friend_class): Likewise. Update CLASSTYPE_BEFRIENDING_CLASSES. * pt.c (instantiate_class_template): Don't set TYPE_HAS_ASSIGNMENT. (tsubst_copy): Substitute the TREE_TYPE for more unary expressions. * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT. * search.c (protected_accessible_p): New function. (friend_accessible_p): Likewise. (accessible_p): Use them. 1999-03-23 Mark Mitchell * pt.c (convert_nontype_argument): Don't create things that aren't PTRMEM_CSTs when applying a qualification conversion to a PTRMEM_CST. 1999-03-23 Mark Mitchell * Makefile.in (OBJS): Don't mention hash.o. (OBJDEPS): Likewise. 1999-03-23 Jason Merrill * decl2.c (finish_file): Set at_eof to 2 after expanding ctors. * decl.c (expand_static_init): Make sure we don't add any after then. * decl.c (cp_finish_decl): Move intelligence about handling DECL_COMDAT for variables from here... * decl2.c (comdat_linkage): ...to here. (maybe_make_one_only): Tweak. (import_export_decl): Call comdat_linkage for variables, too. (finish_file): Handle template statics properly. 1999-03-22 Mark Mitchell * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG. Document internals of pointer-to-member-functions. (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc. (PFN_FROM_PTRMEMFUNC): Likewise. (build_type_conversion): Remove unused parameter. (build_ptrmemfunc1): Declare. (expand_ptrmemfunc_cst): New function. (delta2_from_ptrmemfunc): Likewise. (pfn_from_ptrmemfunc): Likewise. * cvt.c (cp_convert_to_pointer): Remove unused parameter to build_type_conversion. Use TYPE_PTRMEM_P for readability. (convert_to_reference): Remove unused parameter to build_type_conversion. (ocp_convert): Likewise. (build_user_type_conversion): Likewise. * error.c (dump_expr): Handle NULL pointer-to-member functions. * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions. * method.c (build_overload_value): Don't go splitting CONSTRUCTORs open when handling pointer-to-member functions. * pt.c (convert_nontype_argument): Clean up error messages. Be more stringent with pointers-to-members. * typeck.c (build_ptrmemfunc1): Don't declare. Make it global. (build_unary_op): Tidy ever-so-slightly. (build_conditional_expr): Remove extra parameter to build_type_conversion. (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function we're using. (expand_ptrmemfunc_cst): Define. (delta2_from_ptrmemfunc): Likewise. (pfn_from_ptrmemfunc): Likewise. 1999-03-19 Mark Mitchell * init.c (build_member_call): Handle template-id expressions correctly. * typeck.c (build_x_function_call): Likewise. 1999-03-19 Chip Salzenberg * friend.c (make_friend_class): Avoid core dump when not-yet-defined friend type lacks TYPE_LANG_SPECIFIC(). 1999-03-18 Jason Merrill * decl.c (start_function): Suppress normal linkage heuristics for #pragma interface under MULTIPLE_SYMBOL_SPACES. 1999-03-19 Alexandre Oliva * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c. ($(srcdir)/cp/parse.c): Moved from ../Makefile.in. 1999-03-17 Martin von Löwis * parse.y (named_complex_class_head_sans_basetype): Do not push a scope for error_mark_node. (maybe_base_class_list): Likewise. * decl.c (start_decl): Check for error_mark_node as a type. Detected by g++.brendan/array-refs.C. (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C. (maybe_build_cleanup_1): Likewise. Detected by g++.jason/incomplete1.C. * tree.c (build_dummy_object): Use void_zero_node instead of the error_mark_node. (is_dummy_object): Check for such a node. Detected by g++.bob/inherit1.C 1999-03-16 Jason Merrill * method.c (old_backref_index): Split out... (flush_repeats): From here. Rename back from try_old_backref. (build_mangled_name): Put back some old-style repeat handling. Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi * lex.c: Don't include setjmp.h. (parse_float): New static function. (pf_args): New struct. (real_yylex): Use them in call to `do_float_handler'. 1999-03-15 Mark Mitchell * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here. * tree.c (layout_basetypes): Not here. * search.c (dfs_search): Remove; no longer used. 1999-03-12 Mark Mitchell * decl2.c (validate_nonmember_using_decl): Issue sensible error-messages on bogus qualifiers. 1999-03-14 Jason Merrill * call.c (add_function_candidate): Fix uninitialized variable. * Makefile.in (search.o): Add dependency on varray.h. 1999-03-13 Jason Merrill * decl.c (duplicate_decls): Use same_type_p. * method.c (try_old_backref): Renamed from flush_repeats. Use same_type_p. Don't try to handle repeats. Return success. (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support calls from old-style code, too. (check_ktype): Use same_type_p. (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT. (build_qualified_name): Simplify logic. (process_overload_item): Strip typedefs and quals at the top. (build_mangled_name_for_type_with_Gcode): Remove call to type_canonical_variant. (build_mangled_name): Likewise. Remove support for old-style repeats, which have been disabled since 2.7.2. Don't mess with TREE_USED. (build_decl_overload_real): Don't mess with TREE_USED. 1999-03-13 Nathan Sidwell * error.c (cp_printers): Add 'F' escape character. (dump_type_real): Remove TREE_LIST (fnargs) printing. Functionality moved to dump_parameters. (dump_type_suffix): Use dump_parameters and dump_exception_spec. (dump_function_decl): Extend meaning of V parameter. Use dump_parameters and dump_exception_spec. (dump_parameters): New static function. (dump_exception_spec): New static function. (fndecl_as_string): Change argument semantics. Use dump_function_decl directly. * sig.c (build_signature_table_constructor): Use cp_error. 1999-03-13 Martin von Löwis * semantics.c (finish_switch_cond): Handle error cases gracefully. Detected by g++.law/enum5.C. * typeck.c (build_modify_expr): Check for errors after resolving offsets. Detected by g++.brendan/static1.C. * decl.c (complete_array_type): Ignore initial_value if it is an error. Detected by g++.benjamin/17930.C. * typeck2.c (process_init_constructor): Return error if one argument is in error. Detected by g++.benjamin/13478.C. 1999-03-12 Martin von Löwis * decl.c (select_decl): Allow class templates when we need types. * decl2.c (ambiguous_decl): Likewise. 1999-03-12 Mark Mitchell * lex.c (do_identifier): Correct call to enforce_access. * search.c (accessible_p): Tweak comment. 1999-03-10 Mark Mitchell * semantics.c (begin_class_definition): Call build_self_reference. (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs. * search.c (assert_canonical_unmarked): Fix typo in prototype. * search.c (dfs_canonical_queue): New function. (dfs_assert_unmarked_p): Likewise. (assert_canonical_unmarked): Likewise. (access_in_type): Use it. (accessible_p): Likewise. Walk the whole tree when umarking. * sig.c (build_signature_table_constructor): Use accessible_p instead of compute_access. 1999-03-09 Jason Merrill * call.c (add_builtin_candidates): Handle overloaded conversion ops. 1999-03-09 Mark Mitchell * cp-tree.h (flag_access_control): Declare. (TREE_VIA_PPUBLIC): Document. (DECL_NONSTATIC_MEMBER_P): New macro. (enforce_access): Return an indication of whether or not access was permitted. (build_self_reference): Change prototype. (compute_access): Replace with ... (accessible_p): New function. (dfs_walk): Change prototype. (dfs_unmark): Likewise. (markedp): Likewise. * call.c (enforce_access): Use accessible_p. * class.c (build_self_reference): Insert the declaration into the list of members for this type, and make it public. * decl.c (xref_basetypes): Avoid ill-timed recursion. * init.c (build_offset_ref): Use lookup_member, not three separate name-lookups. Call enforce_access rather than checking for illegal accesses here. (resolve_offset_ref): Likewise. * lex.c (do_identifier): Likewise. * method.c (hack_identifier): Likewise. * parse.y (self_reference): Remove. (opt_component_decl_list): Don't use it. * parse.c: Regenerated. * pt.c (print_candidates): Generalize to handle lists of overloaded functions. (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's not set. (get_template_base): Use new calling convention for dfs_walk. * search.c: Include varray.h. Add prototypes. (dfs_walk): Accept a data pointer to pass to the work functions. All callers changed. All work functions changed. (breadth_first_search): Rename to bfs_walk, and make consistent with dfs_walk. (dfs_walk_real): New function. (canonical_binfo): New function. (context_for_name_lookup): Likewise. (shared_marked_p): Likewise. (shared_unmarked_p): Likewise. (lokup_field_queue_p): Likewise. (lookup_field_r): Generalize to handle both functions and fields. (lookup_field): Just call lookup_member. (lookup_fnfields): Likewise. (lookup_member): Move body of lookup_field here and generalize. (dfs_accessible_queue_p): Likewise. (dfs_accessible_p): Likewise. (dfs_access_in_type): Likewise. (access_in_type): Likewise. (compute_access): Remove, and replace with ... (accessible_p): New function. (vbase_types): Remove. (vbase_decl_ptr_intermediate): Likewise. (vbase_decl_ptr): Likewise. (vbase_init_result): Likewise. (closed_envelopes): Likewise. (bvtable): Likewise. 1999-03-09 Jason Merrill * call.c (add_function_candidate): Check for proper number of args before checking the validity of those args. 1999-03-06 Jason Merrill * cp-tree.h (struct lang_type): Add anon_union field. (ANON_UNION_TYPE_P): Use it instead of examining type. (SET_ANON_UNION_TYPE_P): New macro. * decl.c (check_tag_decl): Use it. * search.c (compute_access): Handle non-type contexts earlier, and handle NULL_TREE. * tree.c (build_exception_variant): Use copy_to_permanent. * decl2.c (setup_initp): Give statics with no priority the default priority here. (do_dtors, do_ctors, finish_file): Remove special handling of non-prioritized statics. 1999-03-05 Mark Mitchell * cp-tree.h (ANON_UNION_TYPE_P): Robustify. * decl.c (make_typename_type): Don't issue an error if an immediate lookup fails; it migt be resolved later. * friend.c (is_friend): Add comment. * search.c (breadth_first_search): Add POSTFN and DATA parameters. Tidy. All callers changed. (lookup_field_queue_p): New function. (lookup_field_r): Likewise. (lookup_field_post): Likewise. (lookup_field): Use them, via breadth_first_search, instead of duplicating logic. (compute_access): Robustify. (lookup_fnfield_info): New structure. 1999-03-05 Jason Merrill * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again. 1999-03-03 Jason Merrill * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4 cc happy. * decl2.c (import_export_class): Also return if CLASSTYPE_INTERFACE_ONLY is set. 1999-03-03 Martin von Löwis * decl.c (push_overloaded_decl): Only overwrite the old binding if there was one. * decl2.c (do_local_using_decl): Fix loop termination. 1999-03-02 Mark Mitchell * cp-tree.h (determine_specialization): Don't declare. * pt.c (determine_specialization): Make it static. Eliminate complain parameter. Note that decl is always non-NULL now, and simplify accordingly. * decl.c (maybe_push_to_top_level): Always call push_cp_function_context. (pop_from_top_level): Always call pop_cp_function_context. 1999-02-26 Nathan Sidwell * typeck.c (complete_type_or_else): Add VALUE arg, for helpful diagnostics. * cp-tree.h (complete_type_or_else): Added VALUE parameter. * init.c (build_new_1): Extra arg to complete_type_or_else. (build_delete): Likewise. * typeck.c (require_complete_type): Likewise. (pointer_int_sum): Likewise. (pointer_diff): Likewise. (build_component_ref): Likewise. * typeck2.c (incomplete_type_error): Always use cp_error. Show declaration of undefined type, if appropriate. Deal with UNKNOWN_TYPE nodes. * typeck.c (require_complete_type): Use TYPE_SIZE as size_zero_node to mean incomplete type. (require_complete_type_in_void): New function. (build_compound_expr): Call complete_type_in_void for LHS. (build_c_cast): Call complete_type_in_void for void cast. * cvt.c (ocp_convert): Call complete_type_in_void for void cast. * decl.c (cplus_expand_expr_stmt): Void expression checks moved to require_complete_type_in_void. Call it. * cp-tree.h (require_complete_type_in_void): Prototype new function. * typeck.c (convert_arguments): Use alternative format for function decls. Don't require_complete_type here. Simplify diagnostic printing. (convert_for_initialization): Don't require_complete_type on RHS yet. * call.c (convert_arg_to_ellipsis): Call require_complete_type. * call.c (build_over_call): Cope with qualified void return type. * semantics.c (finish_call_expr): Likewise. * typeck.c (build_function_call_real): Likewise. (c_expand_return): Likewise. * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type. * call.c (print_z_candidates): Use alternate print format, to be consistent with (pt.c) print_candidates. * method.c (hack_identifier): List candidate members. * search.c (lookup_field): Build ambiguous list, and show it, if ambiguous. 1999-02-26 Mark Mitchell * typeck.c (decay_conversion): Don't confuse constant array variables with their initializers. * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when merging decls. * pt.c (regenerate_decl_from_template): Tweak for clarity. (instantiate_decl): Mark a decl instantiated before regenerating it to avoid recursion. * tree.c (mapcar): Don't call decl_constant_value unless we know something is TREE_READONLY_DECL_P. * class.c (check_for_override): Don't stop checking when we find the first overridden function. Delete #if 0'd code. * search.c (get_matching_virtual): Likewise. 1999-02-25 Richard Henderson * lang-specs.h: Define __FAST_MATH__ when appropriate. 1999-02-24 Mike Stump * typeck.c (convert_for_assignment): Allow boolean integral constant expressions to convert to null pointer. 1999-02-24 Martin von Loewis * decl.c (lookup_namespace_name): Resolve namespace aliases. * class.c (push_nested_class): Allow namespaces. * decl2.c (set_decl_namespace): Add friendp parameter. * decl.c (grokfndecl): Pass it. (grokvardecl): Likewise. * cp-tree.h: Change declaration. 1999-02-24 Jason Merrill * pt.c (tsubst): Allow an array of explicit size zero. 1999-02-23 Jason Merrill * errfn.c: Change varargs code to look like toplev.c. * method.c (process_modifiers): Don't prepend 'U' for char or wchar_t. 1999-02-20 Craig Burley * Make-lang.in (cplib2.ready): Don't consider updating cplib2 stuff if the current directory isn't writable, as it won't work (such as during a `make install'). Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org) * decl2.c (start_objects): Make file scope constructors and destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and ASM_OUTPUT_DESTRUCTOR are defined. 1999-02-19 Mark Mitchell * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment. (fn_type_unification): Adjust prototype. (lookup_fnfields_1): Declare. * call.c (add_template_candidate_real): Adjust call to fn_type_unification. * class.c (add_method): Don't allow duplicate declarations of constructors or destructors. (resolve_address_of_overloaded_function): Remove unused variable. Adjust call to fn_type_unification. * decl.c (grokfndecl): Be more robust in the face of illegal specializations. * decl2.c (check_classfn): Remove hokey handling of member templates. * pt.c (determine_specialization): Improve comments. Adjust to handle template argument deduction as per the standard. (check_explicit_specialization): Fix comment spacing. Handle type-conversion operators correctly. Improve error-recovery. (fn_type_unification): Remove EXTRA_FN_ARG parameter. (get_bindings_real): Simplify handling of static members. * search.c (lookup_fnfields_1): Make it have external linkage. * typeck.c (compparms): Fix comment. (build_unary_op): Don't try to figure out which template specialization is being referred to when when the address-of operator is used with a template function. Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi * cp-tree.h (lvalue_or_else): Qualify a char* with the `const' keyword to match an analogous change at the top level. * tree.c (lvalue_or_else): Likewise. 1999-02-17 Mark Mitchell * decl.c (xref_basetypes): Comment. * pt.c (instantiate_class_template): Use xref_basetypes. 1999-02-16 Mark Mitchell * cp-tree.h (tsubst): Change prototype. (tsubst_expr): Likewise. (tsubst_copy): Likewise. (type_unification): Remove prototype. * call.c (convert_default_arg): Adjust call to tsubst_expr. * class.c (resolve_address_of_overloaded_function): Just use fn_type_unification. * decl.c (grokdeclarator): Adjust call to tsubst. * method.c (build_template_parm_names): Likewise. * pt.c (GTB_VIA_VIRTUAL): New macro. (GTB_IGNORE_TYPE): Likewise. (resolve_overloaded_unification): Add `complain' parameter. (try_one_overload): Likewise. (tsubst_template_arg_vector): Likewise. (tsubst_template_parms): Likewise. (tsubst_aggr_type): Likewise. (tsubst_arg_types): Likewise. (tsubst_call_declarator_parms): Likewise. (unify): Remove explicit_mask. (type_unification_real): Likewise. (get_template_base_recursive): Likewise. (coerce_template_template_parms): Provide prototype. (tsubst_function_type): Likewise. (try_class_unification): New function. All callers changed to use new complain parameter. (get_template_base): Use try_class_unification. (unify): Adjust handling of classes derived from template types. (fn_type_unification): Substitute explicit arguments before unification. 1999-02-16 Kriang Lerdsuwanakij * decl.c (pushdecl): Remove dead code. 1999-02-16 Jason Merrill * decl2.c (finish_objects): Fix code I missed in previous change. 1999-02-13 Jason Merrill * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node. (grokdeclarator): Don't expect error_mark_node from grokfndecl. * pt.c (maybe_process_partial_specialization): Complain about 'template <>' on non-specialization. 1999-02-10 Jason Merrill * decl.c (grokdeclarator): Catch weird declarators. * decl2.c (finish_file): Don't abort because of namespace parsing failure. (check_decl_namespace): Remove. 1999-02-09 Mark Mitchell * cp-tree.h (get_template_base): Don't declare. (dfs_walk): Declare. (dfs_unmark): Likewise. (markedp): Likewise. * pt.c (unify): Remove duplicate declaration. Pass tparms and targs to get_template_base. (get_template_base_recursive): Move here from search.c. Check to see that the base found can be instantiated to form the desired type. (get_template_base): Likewise. (get_class_bindings): Simplify. * search.c (get_template_base_recursive): Move to pt.c. (get_template_base): Likewise. (markedp): Make it global. (dfs_walk): Likewise. (dfs_unmark): Likewise. 1999-02-07 Jason Merrill * pt.c (maybe_process_partial_specialization): Complain about specialization in wrong namespace. * tree.c (decl_namespace_context): New fn. 1999-02-06 Kriang Lerdsuwanakij * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM. * pt.c (coerce_template_template_parms): Handle nested template template parameters. Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com) * typeck2.c: Update email addresses. 1999-02-04 Kriang Lerdsuwanakij * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag turned off. 1999-02-04 Jason Merrill * lex.c (retrofit_lang_decl): Split out... (build_lang_decl): From here. * decl.c (pushdecl): Call it for functions generated by the middle end that don't have DECL_LANG_SPECIFIC. * cp-tree.h: Declare it. * decl2.c: Remove flag_init_priority. Always enable initp stuff. (start_objects, finish_objects): Only use special init_priority code if the user specified a priority. (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp objects. Wed Feb 3 22:50:17 1999 Marc Espie * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and mkstemp.o. Get them from libiberty now. (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o. Tue Feb 2 22:38:48 1999 Theodore Papadopoulo * decl2.c (lang_decode_option): Use read_integral_parameter. 1999-02-01 Mark Mitchell * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED before calling complete_type_or_else. Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi * input.c (inline): Don't define, its handled by system.h. Sun Jan 31 20:34:29 1999 Zack Weinberg * decl2.c: Don't define flag_no_ident here. Don't process -f(no-)ident here. * cp-tree.h: Don't declare flag_no_ident here. * lang-specs.h: Map -Qn to -fno-ident. 1999-01-28 Jason Merrill * cp-tree.h (struct tree_binding): Replace scope field with a union. (BINDING_SCOPE): Adjust. * decl.c (BINDING_LEVEL): Adjust. 1999-01-26 Jason Merrill * pt.c (instantiate_class_template): Set up the DECL_INITIAL of member constants. * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in a ctor initializer. * tree.c (equal_functions): Fix name in prototype. * decl.c (push_local_binding): Add FLAGS argument. (pushdecl, push_overloaded_decl): Pass it. * decl2.c (do_local_using_decl): Likewise. * cp-tree.h: Adjust prototype. * decl.c (poplevel): Fix logic. * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST. (poplevel): Handle that. Fix logic for removing TREE_LISTs. (cat_namespace_levels): Don't loop forever. 1999-01-25 Richard Henderson * typeck.c (build_reinterpret_cast): Fix typo in duplicated test. 1999-01-25 Jason Merrill * class.c (resolve_address_of_overloaded_function): Mark the chosen function used. * call.c (build_call): Make sure that a function coming in has been marked used already. * decl.c (expand_static_init): Call mark_used instead of assemble_external. * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec, alloc_eh_object, expand_throw): Likewise. * init.c (build_builtin_delete_call): Likewise. * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1, expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, expand_generic_desc): Likewise. 1999-01-25 Martin von Löwis * tree.c (equal_functions): New function. (ovl_member): Call it. 1999-01-24 Jason Merrill * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf. 1999-01-25 Martin von Loewis * decl.c (decls_match): Return 1 if old and new are identical. (push_overloaded_decl): Set OVL_USED when PUSH_USING. 1999-01-24 Jason Merrill * decl.c (start_function): Make member functions one_only on windows. * decl2.c (import_export_decl): Likewise. * decl.c (grokdeclarator): Don't complain about implicit int in a system header. Change same-name field check to not complain in a system header instead of within extern "C". 1999-01-21 Mark Mitchell * cp-tree.h (PUSH_GLOBAL): New macro. (PUSH_LOCAL): Likewise. (PUSH_USING): Likewise. (namespace_bindings_p): Declare. (push_overloaded_decl): Likewise. * decl.c (push_overloaded_decl): Don't make it static. Check for illegal declarations after using declarations here. (namespace_bindings_p): Likewise. (duplicate_decls): Don't consider declarations from different namespaces to be the same. (pushdecl): Use symbolic PUSH_ constants in calls to push_overloaded_decl. (push_overloaded_decl_1): Likewise. * decl2.c (validate_nonmember_using_decl): Tweak `std' handling. (do_nonmember_using_decl): Check for illegal using declarations after ordinary declarations here. (do_local_using_decl): Call pushdecl to insert declarations. 1999-01-21 Jason Merrill * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo. 1999-01-21 Mark Mitchell * tree.c (build_cplus_array_type_1): Don't call build_array_type for types involving template parameters. * cp-tree.h (PARM_DECL_EXPR): Delete. (convert_default_arg): Change prototype. (check_default_argument): Declare. (search_tree): Likewise. * call.c (convert_default_arg): Take the function to which the default argument belongs as a parameter, and do any necessary instantiation here, instead of ... (build_over_call): Here. * decl.c (local_variable_p): New function. (check_default_argument): Likewise, split out and tidied from ... (grokparms): Here. * error.c (dump_expr): Don't set PARM_DECL_EXPR. * pt.c (tsubst_call_declarator_parms): New function. (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing with CALL_EXPRs, rather than trying to be clever. (tsubst): Use tsubst_call_declarator_parms. * tree.c (search_tree): Don't make it static. * typeck.c (convert_arguments): Use new interface to convert_default_arg. 1999-01-20 Mark Mitchell * error.c (dump_function_decl): Don't print the argument types for a function when the verbosity level is negative. * call.c (build_over_call): Check format attributes at call-time. * pt.c (tsubst_copy): Fix comment. (unify): Don't allow unification with variable-sized arrays. * semantics.c (finish_stmt_expr): When processing a template make the BIND_EXPR long-lived. 1999-01-19 Jason Merrill * decl2.c (finish_vtable_vardecl): Make vtables comdat here. (import_export_vtable): Not here. 1999-01-18 Jason Merrill * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique non-static member function. 1999-01-18 Nathan Sidwell * class.c (instantiate_type): Only diagnose illegal address of member function if complaining. * decl.c (lookup_name_real): Remove duplicate code. 1999-01-18 Jason Merrill * tree.c (copy_template_template_parm): Use permanent_obstack. 1999-01-18 Kriang Lerdsuwanakij * pt.c (unify): Remove restrictions on deduction of argument of template template parameters. 1999-01-18 Nathan Sidwell * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs. * class.c (resolve_address_of_overloaded_function): Show list of all candidates, when none of them match. 1999-01-18 Chip Salzenberg * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up definition of 'casting away const' in reinterpret_cast<>. 1999-01-18 Graham * cvt.c: Add include for decl.h, remove extern for static_aggregates which is now provided by decl.h. * Makefile.in (cvt.o): Add dependency for decl.h and missing dependencies for convert.h and flags.h. 1999-01-18 Nathan Sidwell * decl2.c (do_dtors): Set current location to that of the decl, for sensible diagnostics and debugging. (check_classfn): Issue `incomplete type' error, if class is not defined. 1999-01-16 Jason Merrill * cp-tree.h: Add prototype for bound_pmf_p. 1999-01-16 Jason Merrill Manfred Hollstein * decl.c (grokdeclarator): Don't make 'main(){}' an error with only -Wreturn-type. 1999-01-16 Nathan Sidwell * cp-tree.h (struct lang_type): Added has_mutable flag. (CLASSTYPE_HAS_MUTABLE): New macro to access it. (TYPE_HAS_MUTABLE_P): New macro to read it. (cp_has_mutable_p): Prototype for new function. * class.c (finish_struct_1): Set has_mutable from members. * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if it contains a mutable. * typeck.c (cp_has_mutable_p): New function. 1999-01-15 Mark Mitchell * pt.c (process_template_parm): Ignore top-level qualifiers on non-type parameters. * decl.c (start_function): Use current_function_parms in the call to require_complete_type_for_parms, not the probably empty DECL_ARGUMENTS. 1999-01-14 Jason Merrill * semantics.c (finish_asm_stmt): Don't warn about redundant volatile. * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means that we don't suppress the other copies. * lex.c (handle_cp_pragma): Likewise. 1999-01-13 Mark Mitchell * decl.c (grokdeclarator): Undo 1998-12-14 change. * tree.c (build_cplus_array_type_1): Likewise. * pt.c (instantiate_class_template): Remove misleading comment. (tsubst_aggr_type): Substitute if there are template parameters, regardless of whether or not they use template arguments. (unify): Likewise, but for unification. 1999-01-12 Richard Henderson * cp-tree.h (flag_permissive): Declare extern. 1999-01-06 Mark Mitchell * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT here. (lang_type): Add is_partial_instantiation. Decrease width of dummy. (PARTIAL_INSTANTIATION_P): New macro. (OPERATOR_TYPENAME_P): Remove. * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not OPERATOR_TYPENAME_P. (grok_op_properties): Likewise. * friend.c (do_friend): Handle friends that are member functions correctly. * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT. * pt.c (instantiate_class_template): Rework for clarity. Avoid leaving TYPE_BEING_DEFINED set in obscure cases. Don't do any more partial instantiation than is absolutely necessary for implicit typename. Set PARTIAL_INSTANTIATION_P. (tsubst_decl): Use IDENTIFIER_TYPENAME_P. * semantics.c (begin_class_definition): Handle partial specializations of a type that was previously partially instantiated. Wed Jan 6 03:18:53 1999 Mark Elbrecht * Make-lang.in (g++.o): Depend on prefix.h. 1999-01-04 Jason Merrill * tree.c (bound_pmf_p): New fn. * typeck.c (build_c_cast): Use it. * decl.c (grok_op_properties): Use same_type_p.