aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
AgeCommit message (Collapse)AuthorFilesLines
2003-11-13* decl.c (grokfndecl): Change OK to type tree.Richard Earnshaw1-1/+1
From-SVN: r73549
2003-11-13re PR rtl-optimization/12275 ([unit-at-a-time] ICE in htab_clear_slot)Jan Hubicka1-1/+1
PR opt/12275 * c-decl.c (finish_decl): Use change_decl_assembler_name. * c-pragma.c (handle_pragma_redefine_extname): Likewise. * varasm.c (make_decl_rtl): Likewise. * cgraph.c (change_decl_assembler_name): New function. * tree.h (set_decl_assembler_name): Kill dead declaration. (change_decl_assembler_name): Declare. * decl.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name. * decl2.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name. From-SVN: r73532
2003-11-12decl.c (cp_make_fname_decl): When creating a top-level __FUNCTION__-like ↵Mark Mitchell1-2/+3
symbol, do register it with pushdecl. * decl.c (cp_make_fname_decl): When creating a top-level __FUNCTION__-like symbol, do register it with pushdecl. From-SVN: r73515
2003-11-12decl.c (finish_case_label): Do not check that we are within a switch ↵Mark Mitchell1-12/+0
statement here. * decl.c (finish_case_label): Do not check that we are within a switch statement here. * parser.c (struct cp_parser): Add in_iteration_statement_p and in_switch_statement_p. (cp_parser_new): Initialize them. (cp_parser_labeled_statement): Check validity of case labels here. (cp_parser_selection_statement): Set in_switch_statement_p. (cp_parser_iteration_statement): Set in_iteration_statement_p. (cp_parser_jump_statement): Check validity of break/continue statements here. From-SVN: r73508
2003-11-12re PR c++/12735 (duplicate error messages for redeclaration errors)Mark Mitchell1-27/+47
PR c++/12735 * cp-tree.h (duplicate_decls): Return a tree. * decl.c (duplicate_decls): Clarify documentation. Return error_mark_node to indicate a failed redeclaration. * friend.c (do_friend): Handle that case. * name-lookup.c (pushdecl): Likewise. From-SVN: r73503
2003-11-06c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY field instead ↵Matt Austern1-0/+1
of hanging an attribute object off the decl. * c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY field instead of hanging an attribute object off the decl. * tree.h (DECL_VISIBLITY): New accessor macro for symbol_visibility field in struct tree_decl. (enum symbol_visibility): Move definition to before tree_decl. (struct tree_decl): Define new two-bit field, symbol_visibility. (decl_visibility): Remove declaration. * varasm.c (maybe_assemble_visibility): Use DECL_VISIBILITY instead of decl_visibility. (default_binds_local_p_1): Use DECL_VISIBILITY instead of decl_visibility. (decl_visibility): Remove. * cp/decl.c (duplicate_decls): copy DECL_VISIBILITY field. * cp/method.c (use_thunk): give thunk same visibility as function. * cp/optimize.c (maybe_clone_body): copy DECL_VISIBILITY field. From-SVN: r73320
2003-10-24PR c++/12698, c++/12699, c++/12700, c++/12566Nathan Sidwell1-8/+9
cp: PR c++/12698, c++/12699, c++/12700, c++/12566 * cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New. (debug_class, debug_thunks): New. * class.c (dump_class_hierarchy_1): New break out from ... (dump_class_hierarchy): ... here. (dump_thunk, debug_thunks, debug_class): New. (update_vtable_entry_for_fn): Add ssizetype casts. Correct continued search for primary binfo via virtual. (build_vtbl_initializer): Follow covariant thunk alias. * method.c (make_thunk): Clear DECL_THUNKS of the thunk. (finish_thunk): Look for an alias of the covariant thunk and point to it. (use_thunk): We should never use an alias. * semantics.c (emit_associated_thunks): Do not emit aliases. PR c++/12566 * cp-tree.h (cp_fname_init): Add TYPE pointer param. * decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't create an ad-hoc ERROR_MARK. (cp_make_fname_decl): Adjust. * pt.c (tsubst_expr): Adjust. testsuite: PR c++/12698, c++/12699, c++/12700, c++/12566 * g++.dg/inherit/covariant9.C: New test. * g++.dg/inherit/covariant10.C: New test. * g++.dg/inherit/covariant11.C: New test. From-SVN: r72882
2003-10-21decl.c (cp_finish_decl): Remove clause intended for asm directives in struct ↵Robert Bowdidge1-10/+2
or class fields... * cp/decl.c (cp_finish_decl): Remove clause intended for asm directives in struct or class fields: this code is never executed. From-SVN: r72775
2003-10-21decl.c (start_decl): Exit if push_template_decl returns error_mark_node.Kriang Lerdsuwanakij1-0/+2
* decl.c (start_decl): Exit if push_template_decl returns error_mark_node. From-SVN: r72760
2003-10-21ChangeLog: Fix typos.Kazu Hirata1-1/+1
* ChangeLog: Fix typos. * call.c: Fix comment typos. * class.c: Likewise. * cp-tree.h: Likewise. * cvt.c: Likewise. * cxx-pretty-print.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * parser.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. From-SVN: r72737
2003-10-20toplev.c (rest_of_compilation): Fix webizer pass ordering.Jan Hubicka1-0/+2
* toplev.c (rest_of_compilation): Fix webizer pass ordering. * cgraphunit.c (decide_is_function_needed): Fix test dealing with functions implicitly made inline. * cgraphunit.c (cgraph_decide_inlining_incrementally): New function. (cgraph_finalize_function): Use it. (cgraph_mark_inline): Allow incrmental decisions * invoke.texi (max-inline-slope, min-inline-insns): Kill. * params.def (PARAM_MAX_INLINE_SLOPE, PARAM_MIN_INLINE_INSNS): Kill. * tree-inline.c (limits_allow_inlining): Kill. (expand_call_inline): Always use unit-at-a-time path. * decl.c (start_cleanup_fn): Set DECL_DECLARED_INLINE_P to deffer the expansion. * testsuite/g++.dg/opt/inline4.C: Do not use min-inline-insns parameter. * testsuite/gcc.dg/inline-2.c: Likewise. From-SVN: r72721
2003-10-20PR c++/9781, c++/10583, c++/11862Kriang Lerdsuwanakij1-1/+3
PR c++/9781, c++/10583, c++/11862 * decl.c (cp_finish_decl): Exit immediately if decl is an error_mark_node. * pt.c (push_template_decl_real): Return error_mark_node for invalid template declaration of variable. * g++.dg/parse/crash13.C: New test. From-SVN: r72701
2003-10-17re PR c++/2513 (internal template template parameter causes ICE)Kriang Lerdsuwanakij1-3/+3
PR c++/2513 * decl.c (make_typename_type): Use dependent_type_p. (make_unbound_class_template): Likewise. * pt.c (instantiate_class_template): Increment processing_template_decl during substitution of template friend function. Preincrement processing_template_decl rather than postincrement. (get_mostly_instantiated_function_type): Increment processing_template_decl during partial substitution of function type. * g++.dg/template/typename5.C: New test. From-SVN: r72611
2003-10-14Breack out decl.c (3/n)Gabriel Dos Reis1-821/+1
Breack out decl.c (3/n) * name-lookup.c: Include flags.h (lookup_name_current_level): Make static. (add_decl_to_level): Likewise. (push_local_binding): Likewise. (push_overloaded_decl): Likewise. (lookup_using_namespace): Likewise. (qualified_lookup_using_namespace): Likewise. (lookup_type_current_level): Likewise. (unqualified_namespace_lookup): Likewise. (namespace_ancestor): Likewise. (push_using_directive): Likewise. * decl.c (pushdecl): Move to name-lookup.c. (pushdecl_top_level_1): Likewise. (pushdecl_top_level): Likewise. (pushdecl_top_level_and_finish): Likewise. (maybe_push_decl): Likewise. (push_using_decl): Likewise. (push_overloaded_decl): Likewise. (make_anon_name): Likewise. (anon_cnt): Likewise. (clear_anon_tags): Likewise. (maybe_inject_for_scope_var): Likewise. (check_for_out_of_scope_variable): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on flags.h. * decl.c (warn_extern_redeclared_static): Export. * cp-tree.h (warn_extern_redeclared_static): Declare. From-SVN: r72492
2003-10-13Break out decl.c (2/n)Gabriel Dos Reis1-2264/+4
Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
2003-10-09tweak whitespaceJason Merrill1-2/+2
From-SVN: r72256
2003-10-07re PR c++/10147 (Confusing error message for invalid template function argument)Mark Mitchell1-1/+1
PR c++/10147 * call.c (initialize_reference): Tweak error message. PR c++/12337 * init.c (build_new_1): Make sure that the expression returned is not an lvalue. PR c++/12344, c++/12236, c++/8656 * decl.c (start_function): Do not ignore attributes embedded in a function declarator. PR c++/12337 * g++.dg/init/new9.C: New test. PR c++/12334, c++/12236, c++/8656 * g++.dg/ext/attrib8.C: New test. From-SVN: r72183
2003-10-03decl.c (struct cp_binding_level): Move to name-lookup.hGabriel Dos Reis1-126/+1
* decl.c (struct cp_binding_level): Move to name-lookup.h (current_binding_level): Likewise. (class_binding_level): Likewise. * cp-tree.h (enum scope_kind): Likewise. From-SVN: r72076
2003-09-30* decl.c (duplicate_decls): Copy DECL_SAVED_INSNS too.Richard Henderson1-1/+4
From-SVN: r71959
2003-09-30decl.c (pop_binding): Don't mess with nullifying binding->scope here.Gabriel Dos Reis1-3/+0
* decl.c (pop_binding): Don't mess with nullifying binding->scope here. * name-lookup.c: Re-format. (cxx_binding_free): Nullify binding->scope. From-SVN: r71942
2003-09-28c-decl.c (finish_function): Convert definition to ISO C90.Andreas Jaeger1-1/+1
* c-decl.c (finish_function): Convert definition to ISO C90. * ifcvt.c (mark_loop_exit_edges): Likewise. * ra-rewrite.c (emit_colors): Likewise. For cp: * decl.c (cxx_builtin_type_decls): Convert to ISO C90 function definition. * init.c (push_base_cleanups): Likewise. * decl2.c (finish_file): Likewise. * mangle.c (init_mangle): Likewise. (dump_substitution_candidates): Likewise. * search.c: Likewise. From-SVN: r71872
2003-09-27name-lookup.h (get_global_value_if_present): New function.Gabriel Dos Reis1-10/+4
* name-lookup.h (get_global_value_if_present): New function. (is_typename_at_global_scope): Likewise. * except.c (do_begin_catch): Use get_global_value_if_present. (do_end_catch): Likewise. (do_allocate_exception): Likewise. (do_free_exception): Likewise. (build_throw): Likewise. * parser.c (cp_parser_member_declaration): Likewise. * rtti.c (throw_bad_cast): Likewise. (throw_bad_typeid): Likewise. * decl.c (check_tag_decl): Use is_typename_at_global_scope. (grokdeclarator): Likewise. * cp-tree.h (global_namespace): Move to name-lookup.h * call.c (call_builtin_trap): Tidy. From-SVN: r71858
2003-09-27cp-tree.h, [...]: Remove reference to macros BINDING_SCOPE, BINDING_VALUE ↵Gabriel Dos Reis1-61/+51
and BINDING_TYPE. * cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE. From-SVN: r71848
2003-09-26decl.c (pop_binding_level, [...]): Merge into leave_scope.Gabriel Dos Reis1-65/+43
* decl.c (pop_binding_level, suspend_binding_level, find_class_binding_level): Merge into leave_scope. Remove. (leave_scope): New function. (poplevel): Update. (poplevel_class): Likewise. (pop_namespace): Likewise. From-SVN: r71821
2003-09-23cp-tree.h (scope_kind): Add new enumerator.Gabriel Dos Reis1-106/+98
* cp-tree.h (scope_kind): Add new enumerator. (keep_next_level): Change parameter type to bool. (begin_scope): Change prototype. (pushlevel): Remove declaration. * decl.c (push_binding_level): Fold in begin_scope. Remove. (struct cp_binding_level): Remove tag_tranparent field. Make keep of bitsize one. (keep_next_level_flag): Make a bool. (cxx_scope_descriptor): Update scope names table (make_cxx_scope): Fold in begin_scope. Remove.. (namespace_scope_ht_size): New function. (begin_scope): Change prototype. Return a scope. Tidy. (kept_level_p): Update. (pushlevel): Remove. (maybe_push_cleanup_level): Simplify. (poplevel): Update for sk_cleanup and keep change. (print_binding_level): Likewise. (initial_push_namespace_scope): Fold in begin_scope. Remove. (push_namespace): Update. (pushtag): Likewise. (lookup_tag): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (cxx_init_decl_processing): Likewise. (start_function): Likewise. (begin_function_body): Likewise. (start_method): Likewise. * pt.c (push_inline_template_parms_recursive): Likewise. (begin_template_parm_list): Likewise. (begin_specialization): Likewise. * semantics.c (do_pushlevel): Likewise. (begin_compound_stmt): Likewise. (begin_stmt_expr): Likewise. From-SVN: r71683
2003-09-21Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.Richard Henderson1-10/+11
From-SVN: r71641
2003-09-21tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.Richard Henderson1-11/+10
* tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const. (TREE_FILENAME, TREE_LINENO): Likewise. (set_tree_locus, copy_tree_locus, set_tree_file_line): New. (TREE_LOCUS_SET_P): New. * c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c, diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c, print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c, tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c, config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match. ada/ * trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and change to const. cp/ * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, method.c, optimize.c, pt.c, semantics.c, tree.c: Update for DECL_SOURCE_LOCATION rename and change to const. f/ * com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and change to const. java/ * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, resource.c: Update for DECL_SOURCE_LOCATION rename and change to const. treelang/ * treetree.c: Update for DECL_SOURCE_LOCATION rename and change to const. From-SVN: r71636
2003-09-20c-format.c (gcc_diag_char_table): Add %J.Richard Henderson1-29/+21
* c-format.c (gcc_diag_char_table): Add %J. (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise. (check_format_types): Fix wanted_type name lookup. (init_dynamic_diag_info): Setup %J. * diagnostic.c (text_specifies_location): Implement %J. * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c, dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c, tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c, config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics. * tree-inline.c: Include intl.h (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason. * Makefile.in (tree-inline.o): Update. cp/ * decl.c, decl2.c, pt.c: Use %J in diagnostics. java/ * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics. testsuite/ * gcc.dg/format/gcc_diag-1.c: Add tests for %J. From-SVN: r71619
2003-09-19decl.c (cxx_scope_descriptor): Fix thinko.Gabriel Dos Reis1-1/+4
* decl.c (cxx_scope_descriptor): Fix thinko. (struct cp_binding_level): Adjust type of binding_depth field. From-SVN: r71557
2003-09-17re PR debug/12066 (g++ generates stabs for "char *" that gdb cannot read)Mark Mitchell1-0/+19
PR debug/12066 * dbxout.c (dbxout_init): Use a langhook to find builtin types. * langhooks-def.h (lhd_return_null_tree_v): New function. (LANG_HOOKS_BUILTIN_TYPE_DECLS): New macro. (LANG_HOOKS_DECLS): Add it to the intializer. * langhooks.c (lhd_return_null_tree_v): New function. * langhooks.h (lang_hooks_for_decls): Add builtin_type_decls. PR debug/12066 * cp-lang.c (LANG_HOOKS_BUILTIN_TYPE_DECLS): Define. * cp-tree.h (cxx_builtin_type_decls): Declare. * decl.c (builtin_type_decls): New variables. (cxx_builtin_type_decls): New function. (record_builtin_type): Add to builtin_type_decls. From-SVN: r71478
2003-09-15re PR c++/3907 (nested template parm collides with member name)Mark Mitchell1-175/+104
* coverage.c (create_coverage): Do not call pushlevel/poplevel. * langhooks-def.h (lhd_do_nothing_iii_return_null_tree): New function. * langhooks.c (lhd_do_nothing_iii_return_null_tree): Define it. PR c++/3907 * class.c (maybe_note_name_used_in_class): Refine test for whether or not we are in a class scope. * cp-tree.h (language_function): Remove x_expanding_p. (expanding_p): Remove. (doing_semantic_analysis_p): Remove. (scope_kind): Add sk_function_parms, sk_class, sk_namespace. (innermost_scope_kind): New method. * call.c (cxx_type_promotes_to): Use type_decays_to. * cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine. (LANG_HOOKS_POPLEVEL): Likewise. * decl.c (cp_binding_level): Remove parm_flag, template_parms_p, template_spec_p, namespace_p, is_for_scope, is_try_scope, and is_catch_scope. Add kind and explicit_spec_p. (cxx_scope_descriptor): Use a lookup table. (find_class_binding_level): Use "kind" field in binding_level, not the various flags. (pop_binding_level): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (template_parm_scope_p): Likewise. (innermost_scope_kind): New method. (current_tmpl_spec_kind): Use "kind" field in binding_level, not the various flags. (pushlevel): Remove check for doing_semantic_analysis_p. (begin_scope): Simplify. (add_decl_to_level): Use "kind" field in binding_level, not the various flags. (push_local_binding): Likewise. (pop_label): Remove check for doing_semantic_analysis_p. (poplevel): Use "kind" field in binding_level, not the various flags. (set_block): Remove check for doing_semantic_analysis_p. (pushlevel_class): Use "kind" field in binding_level, not the various flags. (poplevel_class): Likewise. (initial_push_namespace_scope): Likewise. (maybe_push_to_top_level): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (maybe_process_template_type_declaration): Likewise. (pushtag): Likewise. (pushdecl): Likewise. (pushdecl_with_scope): Likewise. (check_previous_goto_1): Likewise. (define_label): Likewise. (finish_case_label): Likewise. (lookup_tag): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_name_real): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (record_builtin_type): Likewise. (cp_make_fname_decl): Likewise. (maybe_inject_for_scope_var): Likewise. (cp_finish_decl): Remove check for doing_semantic_analysis_p. (start_function): Use begin_scope, not pushlevel. (finish_function): Use "kind" field in binding_level, not the various flags. (start_method): Use begin_scope, not pushlevel. (make_label_decl): Do not check expanding_p. (save_function-data): Do not set expanding_p. (cxx_push_function_context): Do not clear expanding_p. * semantics.c (cxx_expand_function_start): Do not set expanding_p. PR c++/3907 * g++.dg/parse/template12.C: New test. * g++.dg/abi/bitfield11.C: New test. * g++.dg/abi/bitfield12.C: Likewise. From-SVN: r71393
2003-09-08c-decl.c (c_expand_body_1): Push and pop function context here.Richard Henderson1-0/+1
gcc/ * c-decl.c (c_expand_body_1): Push and pop function context here. * tree-optimize.c (tree_rest_of_compilation): ... not here. Take nested argument instead of computing nesting ourselves. gcc/cp/ * decl.c (finish_function): Clear current_function_decl. * decl2.c (mark_used): Don't push/pop gc context. * optimize.c (optimize_function): Likewise. * tree.c (cp_cannot_inline_tree_fn): Likewise. * pt.c (instantiate_decl): Inc/dec function_depth instead. * semantics.c (expand_body): Update for tree_rest_of_compilation nested argument. From-SVN: r71208
2003-09-07re PR c++/11762 (namespace aliasing ICE in warn_extern_redeclared_static)Gabriel Dos Reis1-3/+6
* c-pretty-print.h (pp_c_left_brace): Declare. (pp_c_right_brace): Likewise. * c-pretty-print.c (pp_c_left_brace): Now a function (pp_c_right_brace): Likewise. cp/ PR c++/11762 * error.c (dump_decl): Handle namespace-alias-definition. * decl.c (warn_extern_redeclared_static): There is no point in checking changes in storage class specifier for a namespace declaration. (duplicate_decls): Tidy diagnostic message. * cxx-pretty-print.c (pp_cxx_left_brace): New macro. (pp_cxx_right_brace): Likewise. (pp_cxx_original_namespace_definition): New function. (pp_cxx_namespace_alias_definition): Likewise. (pp_cxx_declaration): Use them. Handle NAMESPACE_DECLs. From-SVN: r71175
2003-09-06cp-tree.h (add_binding): Remove declaration.Gabriel Dos Reis1-79/+3
* cp-tree.h (add_binding): Remove declaration. * name-lookup.h (supplement_binding): Declare. * decl.c (add_binding): Move to name-lookup.c. (push_local_binding): Adjust. (push_class_binding): Likewise. (set_identifier_type_value_with_scope): Likewise. * name-lookup.c (supplement_binding): Rename from add_binding. Return a bool. Improve documentation. (set_namespace_binding): Adjust. * Make-lang.in (cp/name-lookup.o): Depend on toplev.h From-SVN: r71144
2003-09-06re PR c++/11595 (crash on duplicate label definition)Steven Bosscher1-7/+4
PR c++/11595 * decl.c (define_label): Remove unreachable timevar pop. Always return the decl, even if the definition is invalid. From-SVN: r71138
2003-09-03targhooks.c: New file.DJ Delorie1-1/+1
* targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-01re PR c++/12114 ([3.3.2] Uninitialized memory accessed in dtor)Mark Mitchell1-15/+33
PR c++/12114 * g++.dg/init/ref9.C: New test. PR c++/11972 * g++.dg/template/nested4.C: New test. PR c++/12114 * cp-tree.h (initialize_reference): Change prototype. * call.c (initialize_reference): Add cleanup parameter. * decl.c (grok_reference_init): Likewise. (check_initializer): Likewise. (cp_finish_decl): Insert a CLEANUP_STMT if necessary. (duplicate_decls): When replacing an anticipated builtin, do not honor TREE_NOTHROW. * typeck.c (convert_for_initialization): Correct call to initialize_reference. PR c++/11972 * pt.c (dependent_type_p_r): Pass only the innermost template arguments to any_dependent_template_arguments_p. From-SVN: r70981
2003-08-29tree-optimize.c: New file.Richard Henderson1-7/+33
gcc/ * tree-optimize.c: New file. * Makefile.in (OBJS-archive): Add tree-optimize.o. (tree-optimize.o): New. * c-decl.c (store_parm_decls): Use allocate_struct_function. (finish_function): Don't free_after_parsing or free_after_compilation. (set_save_expr_context): Move to tree-optimize.c. (c_expand_body_1): Use tree_rest_of_compilation. * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New. * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New. * c-objc-common.c (expand_deferred_fns): Don't emit unused inlines; iterate until closure. * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_START, LANG_HOOKS_RTL_EXPAND_STMT, LANG_HOOKS_RTL_EXPAND_END): New. (LANG_HOOKS_RTL_EXPAND_INITIALIZER): New. * langhooks.h (struct lang_hooks_for_rtl_expansion): New. * toplev.h (tree_rest_of_compilation): Declare it. gcc/cp/ * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New. (LANG_HOOKS_RTL_EXPAND_STMT): New. * cp-tree.h (cxx_expand_function_start): Declare. * decl.c (start_function): Use allocate_struct_function. Move stmts_are_full_exprs_p assertion from expand_body. Do not free_after_parsing or free_after_compilation. (cxx_push_function_context): Move code to set struct function data from genrtl_start_function. * optimize.c (optimize_function): Don't inc/dec function_depth. * semantics.c (expand_body): Use tree_rest_of_compilation. (cxx_expand_function_start): Rename from genrtl_start_function, omit bits done by tree_rest_of_compilation. (genrtl_finish_function): Remove. (clear_decl_rtl): Move to ../tree-optimize.c. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r70933
2003-08-26re PR c++/11871 (Koenig lookup regression)Nathan Sidwell1-1/+3
cp: PR c++/11871 * decl.c (push_class_level_binding): Correct old_decl value from my 2003-07-29 reorganization. testsuite: PR c++/11871 * c++.dg/lookup/crash1.C: New test. From-SVN: r70803
2003-08-25re PR target/8795 ([PPC] Altivec related bugs concerning gcc 3.3 and mainline)Mark Mitchell1-13/+18
PR c++/8795 * tree.h (build_method_type_directly): Declare. * c-common.c (handle_vector_size_attributes): Handle METHOD_TYPEs. (vector_size_helper): Likewise. * tree.c (build_method_type_directly): New function. (build_method_type): Use it. PR c++/8795 * cp-tree.h (build_cplus_method_type): Remove. * call.c (standard_conversion): Use build_method_type_directly instead of build_cplus_method_type. * class.c (build_clone): Likewise. (adjust_clone_args): Likewise. * decl.c (build_ptrmem_type): Likewise. (grokdeclarator): Likewise. (check_function_type): Likewise. * decl2.c (grok_method_quals): Likewise. (maybe_retrofit_in_chrg): Likewise. * pt.c (copy_default_args_to_explicit_spec): Likewise. (tsubst_function_type): Likewise. (tsubst): Likewise. * tree.c (build_cplus_method_type): Remove. * typeck.c (merge_types): Use build_method_type_directly. PR c++/8795 * g++.dg/ext/altivec-1.C: New test. From-SVN: r70773
2003-08-23PR c++/641, c++/11876Kriang Lerdsuwanakij1-1/+2
PR c++/641, c++/11876 * friend.c (add_friend): Add complain parameter. (make_friend_class): Likewise. (do_friend): Adjust add_friend call. * decl.c (grokdeclarator): Adjust make_friend_class call. * parser.c (cp_parser_member_declaration): Likewise. (cp_parser_template_declaration_after_exp): Likewise. * pt.c (instantiate_class_template): Adjust make_friend_class and add_friend call. * cp-tree.h (make_friend_class): Adjust declaration. (add_friend): Likewise. * g++.dg/template/friend22.C: New test. * g++.dg/template/friend23.C: Likewise. From-SVN: r70732
2003-08-21re PR c++/11614 (Incorrect handling of pointers to arrays)Jason Merrill1-13/+9
PR c++/11614 * decl.c (grokdeclarator): Recognize a flexible array based on the type, not the form of the declarator. From-SVN: r70636
2003-08-20re PR c++/11946 (fun and merriment with enums as function arguments)Mark Mitchell1-115/+147
PR c++/11946 * convert.c (convert_to_integer): Use CONVERT_EXPR (instead of NOP_EXPR) when necessary. * c-common.c (c_common_signed_or_unsigned_type): Correctly handle types with precisions other than those given by native machine modes. PR c++/11684 * cp-tree.h (grok_op_properties): Change prototype. * decl.c (grok_op_properties): Add complain parameter. (grokfndecl): Pass it. * pt.c (tsubst_decl): Adjust accordingly. PR c++/10926 * decl.c (start_method): Return immediately if push_template_decl does not like the declaration. * pt.c (push_template_decl_real): Disallow member template destructors. PR c++/11036.C * cp-tree.h (add_binding): Add prototype. * class.c (add_method): Set TYPE_HAS_DESTRUCTOR if appropriate. (maybe_warn_about_overly_private_class): Use CLASSTYPE_DESTRUCTORS. (pushclass): Adjust call to set_identifier_type_value. * decl.c (add_binding): Give it external linkage. (push_local_binding): Adjust call to add_binding. (push_class_binding): Likewise. (set_identifier_type_value_with_scope): Change prototype. Use add_binding for global bindings. (set_identifier_type_value): Adjust accordingly. (pushtag): Likewise. (pushdecl): Use set_identifier_type_value, not set_identifier_type_value_with_scope. (pushdecl_namespace_level): Adjust calls to SET_IDENTIFIER_TYPE_VALUE to pass a DECL. (pushdecl_class_level): Likewise. (lookup_tag): Use select_decl. (select_decl): Improve comment. (record_builtin_type): Do not call pushdecl. (cxx_init_decl_processing): Do not call xref_tag for bad_alloc. (cp_finish_decl): Adjust call to set_identifier_type_value. (check_elaborated_type_specifier): Improve checks for invalid uses of typedefs. (xref_tag): Adjust call to check_elaborated_type_specifier. * decl2.c (grokclassfn): Do not set TYPE_HAS_DESTRUCTOR. * name-lookup.c (set_namespace_binding): Use add_binding. * parser.c (cp_parser_simple_type_specifier): Return a TYPE_DECL, rather than an IDENTIFIER_NODE, to represent built-in types, if requested by the caller. (cp_parser_postfix_expression): Adjust call. (cp_parser_type_specifier): Likewise. (cp_parser_elaborated_type_specifier): Adjust call to check_elaborated_type_specifier. * typeck2.c (build_functional_cast): Do not perform name lookups. PR c++/10717 * decl.c (expand_static_init): Remove unncessary code. PR c++/10926 * g++.dg/template/dtor2.C: New test. PR c++/11684 * g++.dg/template/operator1.C: New test. * g++.dg/parse/operator4.C: New test. PR c++/11946.C * g++.dg/expr/enum1.C: New test. * gcc.dg/c99-bool-1.c: Remove bogus warning. PR c++/11036.C * g++.dg/parse/elab2.C: New test. * g++.dg/parse/typedef4.C: Change error message. * g++.old-deja/g++.robertl/eb133.C: Remove bogus error markers. * g++.old-deja/g++.robertl/eb133a.C: Remove bogus error markers. * g++.old-deja/g++.robertl/eb133b.C: Remove bogus error markers. From-SVN: r70593
2003-08-18apparently missing part of 2003-08-15 checkinNathan Sidwell1-3/+2
apparently missing part of 2003-08-15 checkin * decl.c (make_typename_type): Use my_friendly_assert. From-SVN: r70539
2003-08-12re PR c++/11703 (Problem with using enum in placement delete)Mark Mitchell1-34/+3
PR c++/11703 * call.c (type_passed_as): Use TYPE_SIZE, not TYPE_PRECISION to determine whether or not to promote types. (convert_for_arg_passing): Likewise. * decl2.c (cp_build_parm_decl): Do not set DECL_ARG_TYPE in templates. * pt.c (tsubst_decl): Do not expect it to be set. PR c++/9512 PR c++/10923 * cp-tree.h (check_elaborated_type_specifier): Declare. (handle_class_head): Remove. (note_got_semicolon): Likewise. (note_list_got_semicolon): Likewise. (finish_class_definition): Likewise. * decl.c (check_elaborated_type_specifier): Make it public. Robustify. (handle_class_head): Remove. * parser.c (cp_parser_elaborated_type_specifier): Use check_elaborated_type_specifier. (cp_parser_class_specifier): Do not call finish_class_definition. (cp_parser_class_head): Or handle_class_head. Check for over-qualified names. * semantics.c (finish_class_definition): Remove. * parser.c (cp_parser_check_for_definition_in_return_type): New function. (cp_parser_simple_declaration): Adjust call to cp_parser_init_declarator. (cp_parser_decl_specifier_seq): Change type of declares_class_or_enum parameter. (cp_parser_explicit_instantiation): Adjust accordingly. (cp_parser_type_specifier): Change type of declares_class_or_enum parameter. (cp_parser_init_declarator): Add declares_class_or_enum parameter. (cp_parser_parameter_declaration): Adjust call to cp_parser_decl_specifier_seq. (cp_parser_function_definition): Likewise. (cp_parser_member_declaration): Likewise. (cp_parser_single_declaration): Likewise. * cp-tree.h (lang_type_class): Remove has_call_overloaded, has_array_ref_overloaded, has_arrow_overloaded, and got_semicolon. (TYPE_OVERLOADS_CALL_EXPR): Remove. (TYPE_OVERLOADS_ARRAY_REF): Likewise. (TYPE_OVERLOADS_ARROW): Likewise. (CLASSTYPE_GOT_SEMICOLON): Likewise. * class.c (check_bases): Do not set them. (finish_struct_1): Likewise. * decl.c (cp_finish_decl): Do not set CLASSTYPE_GOT_SEMICOLON. (build_ptrmemfunc_type): Likewise. (grok_op_properties): Do not set TYPE_OVERLOADS_*. (start_function): Do not check CLASSTYPE_GOT_SEMICOLON. * decl2.c (grokfield): Do not set CLASSTYPE_GOT_SEMICOLON. * lex.c (note_got_semicolon): Remove. (note_list_got_semicolon): Likewise. * parser.c (cp_parser_simple_declaration): Do not call note_list_got_semicolon. * pt.c (list_eq): Remove. (lookup_template_class): Do not set CLASSTYPE_GOT_SEMICOLON. (instantiate_class_template): Do not set TYPE_OVERLOADS*. (instantiate_class_template): Do not set CLASSTYPE_GOT_SEMICOLON. * ptree.c (cxx_print_type): Do not print them. * semantics.c (finish_member_class_template): Do not call note_list_got_semicolon. * g++.dg/parse/ret-type2.C: New test. PR c++/11703 * g++.dg/init/new8.C: New test. PR c++/10923 * g++.dg/parse/typedef5.C: New test. PR c++/9512 * g++.dg/parse/qualified2.C: New test. * g++.old-deja/g++.other/decl5.C: Mark one more instance of invalid code. From-SVN: r70391
2003-08-07decl.c (grokparms): Use cp_build_qualified_type instead TYPE_MAIN_VARIANT.Aldy Hernandez1-1/+1
2003-08-06 Aldy Hernandez <aldyh@redhat.com> * decl.c (grokparms): Use cp_build_qualified_type instead TYPE_MAIN_VARIANT. [[Split portion of a mixed commit.]] From-SVN: r70211.2
2003-08-05tree.h (DID_INLINE_FUNC): Remove macro.Steven Bosscher1-9/+2
2003-08-05 Steven Bosscher <steven@gcc.gnu.org> * tree.h (DID_INLINE_FUNC): Remove macro. (DECL_DECLARED_INLINE_P): Move from c-tree.h and cp/cp-tree.h, add tree check for FUNCTION_DECL. (DECL_ESTIMATED_INSNS): Move from c-common.h and java/java-tree.h. (struct tree_decl): Rename inlined_function_flag to declared_inline_flag. * c-common.h (c_lang_decl): Remove. (DECL_ESTIMATED_INSNS): Remove. * c-tree.h (struct lang_decl): Don't include c_lang_decl. (DECL_DECLARED_INLINE_P): Remove. * c-decl.c (grokdeclarator): Update comment. With -finline-functions, do not reset DECL_DECLARED_INLINE_P. Don't use DID_INLINE_FUNC. (finish_function): Make uninlinable a bool. Fixup call to tree_inlinable_function_p() and fix some code style issues. * cgraph.h (disgread_inline_limits): Fix spelling: `disregard'. * cgraph.c (dump_cgraph): Likewise. * cgraphunit.c (cgraph_decide_inlining): Likewise (cgraph_finalize_compilation_unit): Likewise. Also update call to tree_inlinable_function_p(). (cgraph_default_inline_p): Don't use DID_INLINE_FUNC. Instead look at DECL_DECLARED_INLINE and reverse logic. * print-tree.c (print_node): Likewise. * toplev.c (rest_of_handle_inlining): Don't use DID_INLINE_FUNC. * tree-inline.h (tree_inlinable_function_p): Make a bool. Update prototype. * tree-inline.c (inlinable_function_p): Split up in this function to check for basic inlining inhibiting conditions, and new limits_allow_inlining() function. Warn if inlining is impossible because the inline candidate calls alloca or uses sjlj exceptions. (limits_allow_inlining): this new function to check if the inlining limits are satisfied. Throttle from currfn_max_inline_insns, not from MAX_INLINE_INSNS_SINGLE. The latter only makes sense if MAX_INLINE_INSNS_AUTO and MAX_INLINE_INSNS_SINGLE are equal. Update prototypes. (tree_inlinable_function_p): Make a bool. Update call to inlinable_function_p (expand_call_inline): Use limits_allow_inlining() when not in unit-at-a-time mode to decide on inlining. Don't use DID_INLINE_FUNC, instead see if the function was declared `inline'. cp/ * cp-tree.h (struct lang_decl): Don't include c_lang_decl. (DECL_DECLARED_INLINE_P): Remove. * decl2.c (import_export_decl): Only look at DECL_DECLARED_INLINE_P if decl is a FUNCTION_DECL. This never made sense, but now it is required to avoid a tree check failure. * decl.c (grokfndecl): Don't touch DID_INLINE_FUNC. * optimize.c (maybe_clone_body): Likewise. java/ * java-tree.h (DECL_ESTIMATED_INSNS): Remove. From-SVN: r70174
2003-08-04c-common.c (flag_noniso_default_format_attributes): Delete.Roger Sayle1-13/+0
* c-common.c (flag_noniso_default_format_attributes): Delete. (built_in_attribute): Don't define/undefine DEF_FN_ATTR. (c_attrs_initialized): Delete. (c_common_nodes_and_builtins): Don't test c_attrs_initialized, always call c_init_attributes. (c_init_attributes): Don't define/undefine DEF_FN_ATTR. Don't set c_attrs_initialized when done. (c_common_insert_default_attributes): Delete. * c-common.h (flag_noniso_default_format_attributes): Delete. (c_coomon_insert_default_attributes): Delete prototype. * c-opts.c (set_std_c89, set_std_c99, set_std_cxx98): Dont set flag_noniso_default_format_attributes. * c-decl.c (c_insert_default_attributes): Delete. * c-tree.h (c_insert_default_attributes): Delete prototype. * attribs.c (decl_attributes): Don't call insert_default_attributes langhook. Update function description comment. * langhooks.h (lang_hooks): Remove insert_default_attributes field. * langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Delete. * c-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. * system.h: Poison LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES macro. cp/ * decl.c (cxx_insert_default_attributes): Delete. * cp-tree.h (cxx_insert_default_attributes): Don't prototype. * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. objc/ * objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. From-SVN: r70155
2003-08-02re PR c++/9447 (using Base<T>::member does not work)Nathan Sidwell1-1/+2
cp: PR c++/9447 * cp-tree.def (USING_DECL): Document its type. * class.c (pushclass): If we're entering a template, push any dependent using decls it has. * decl2.c (do_class_using_decl): Refactor. Type is NULL iff it is a dependent scope. * pt.c (tsubst_decl) <USING_DECL case>: Set type. (tsubst): Remove USING_DECL checks. (type_dependent_expression_p): Remove USING_DECL case. * semantics.c (finish_member_declaration): A USING_DECL's type indicates whether it is dependent. testsuite: PR c++/9447 * g++.dg/template/using7.C: New test. From-SVN: r70107
2003-08-01re PR c++/11697 (Failure to diagnose class template redeclaration via using ↵Mark Mitchell1-5/+6
declaration) PR c++/11697 * decl.c (decls_match): Don't ignore the types of template classes. PR c++/11744 * pt.c (tsubst_copy_and_build): Refine Koenig lookup logic. PR c++/11697 * g++.dg/template/using6.C: New test. PR c++/11744 * g++.dg/template/koenig2.C: New test. From-SVN: r70062