From c8094d835f3b458cc3d47195966d944c89208396 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Tue, 14 Jun 2005 20:01:59 +0000 Subject: [PATCH] Remove extra white spacing at end of lines. From-SVN: r100952 --- gcc/cp/ChangeLog | 34 +- gcc/cp/ChangeLog-1994 | 2 +- gcc/cp/ChangeLog-1999 | 356 +++++----- gcc/cp/ChangeLog-2003 | 41 +- gcc/cp/ChangeLog.tree-ssa | 6 +- gcc/cp/Make-lang.in | 4 +- gcc/cp/NEWS | 36 +- gcc/cp/call.c | 518 +++++++------- gcc/cp/class.c | 618 ++++++++--------- gcc/cp/cp-gimplify.c | 2 +- gcc/cp/cp-objcp-common.c | 2 +- gcc/cp/cp-tree.def | 32 +- gcc/cp/cp-tree.h | 14 +- gcc/cp/cvt.c | 82 +-- gcc/cp/cxx-pretty-print.c | 46 +- gcc/cp/cxx-pretty-print.h | 2 +- gcc/cp/decl.c | 92 +-- gcc/cp/decl.h | 4 +- gcc/cp/decl2.c | 184 ++--- gcc/cp/dump.c | 16 +- gcc/cp/error.c | 34 +- gcc/cp/except.c | 24 +- gcc/cp/expr.c | 4 +- gcc/cp/friend.c | 32 +- gcc/cp/g++spec.c | 12 +- gcc/cp/init.c | 178 ++--- gcc/cp/lex.c | 8 +- gcc/cp/mangle.c | 224 +++---- gcc/cp/method.c | 94 +-- gcc/cp/name-lookup.c | 206 +++--- gcc/cp/name-lookup.h | 2 +- gcc/cp/operators.def | 12 +- gcc/cp/optimize.c | 4 +- gcc/cp/parser.c | 192 +++--- gcc/cp/pt.c | 1342 ++++++++++++++++++------------------- gcc/cp/ptree.c | 2 +- gcc/cp/repo.c | 4 +- gcc/cp/rtti.c | 156 ++--- gcc/cp/search.c | 212 +++--- gcc/cp/semantics.c | 222 +++--- gcc/cp/typeck.c | 380 +++++------ gcc/cp/typeck2.c | 54 +- 42 files changed, 2745 insertions(+), 2744 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f97de6c375c..789815f7d2e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -117,7 +117,7 @@ * parser.c (cp_parser_postfix_expression): Allow non-constant expressions as arguments to __builtin_constant_p. * tree.c (builtin_valid_in_constant_expr_p): Use - DECL_IS_BUILTIN_CONSTANT_P. + DECL_IS_BUILTIN_CONSTANT_P. 2005-06-03 Mark Mitchell @@ -315,7 +315,7 @@ Mike Stump Yet more Objective-C++... - + * cp-objcp-common.h (cxx_get_alias_set): Move from here... (cxx_warn_unused_global_decl): Likewise. @@ -422,7 +422,7 @@ * typeck.c (build_unary_op): Do not resort to address arithmetic when taking the address of a COMPONENT_REF. - + 2005-05-08 Kazu Hirata * class.c (vtbl_init_data_s): Change the type of fns to @@ -593,7 +593,7 @@ * decl2.c (check_classfn): Adjust. * init.c (sort_mem_initializers, push_base_cleanups): Adjust. * method.c (do_build_copy_constructor): Adjust. - * name-lookup.c (new_class_binding, store_binding, + * name-lookup.c (new_class_binding, store_binding, store_bindings, store_class_bindings): Adjust. * name-lookup.h: Define VEC(cxx_saved_binding,gc), VEC(cp_class_binding,gc). @@ -649,7 +649,7 @@ * typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to which sizeof/alignof is dependent, rather than just whether we are processing_template_decl. - + 2005-04-17 Kazu Hirata * cp-tree.h (LOOKUP_GLOBAL): Remove. @@ -679,7 +679,7 @@ * decl2.c (determine_visibility): Don't use export_class_data. (import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and - TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY. + TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY. 2005-04-09 Kazu Hirata @@ -738,7 +738,7 @@ (cp_parser_type_specifier_seq): In a condition, do not allow invalid type-specifier combinations. (cp_parser_exception_declaration): Adjust call to - cp_parser_type_specifier_seq. + cp_parser_type_specifier_seq. * cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P. * cp-tree.h (struct tinst_level): Add in_system_header_p. @@ -1021,14 +1021,14 @@ (lookup_template_class, instantiate_class_template): Adjust call to pushtag. * semantics.c (begin_class_definition): Likewise. - * rtti.c (init_rtti_processing, build_dynamic_cast_1, + * rtti.c (init_rtti_processing, build_dynamic_cast_1, tinfo_base_init, emit_support_tinfos): Use ts_current instead of ts_global. 2005-03-13 Mark Mitchell PR c++/20157 - * pt.c (determine_specialization): Reject non-specializations. + * pt.c (determine_specialization): Reject non-specializations. 2005-03-11 Per Bothner @@ -1054,7 +1054,7 @@ 2005-03-09 Paolo Carlini - PR c++/16859 + PR c++/16859 * decl.c (complete_array_type): In pedantic mode, return 3 for an empty initializer list as the initializer for an array of unknown bound (8.5.1/4). @@ -1075,7 +1075,7 @@ (cp_finish_decl): Remove dead code. * init.c (build_vec_init): When determining whether or not the element type has an asignment operator, look through all array - dimensions. + dimensions. * typeck.c (target_type): Remove. 2005-03-07 Mark Mitchell @@ -1109,7 +1109,7 @@ PR c++/20232 * class.c (update_vtable_entry_for_fn): Don't crash on invalid - covariancy. + covariancy. * cp-tree.g (THUNK_TARGET): Expand comment. * method.c (use_thunk): Make sure we also use the target, if that @@ -1164,7 +1164,7 @@ PR c++/20152 * parser.c (cp_parser_class_head): Check for redefintions here. * semantics.c (begin_class_definition): Not here. - + PR c++/20153 * decl2.c (build_anon_union_vars): Add type parameter. (finish_anon_union): Pass it. @@ -1177,15 +1177,15 @@ * parser.c (cp_parser_direct_declarator): Always complain about non-constant array bounds when in a function scope. * semantics.c (finish_id_expression): Do not mark dependent names - as non-constant. + as non-constant. 2005-02-21 Douglas Gregor - + PR c++/19076 PR c++/6628 * cp-tree.h (cp_apply_type_quals_to_decl): Declared. * decl.c (grokdeclarator): Pedwarn about qualifying a function - type. + type. Add qualifiers when declaring a typedef of a function type. Member function pointers pick up the qualifiers of the typedef used to declare them. @@ -1196,7 +1196,7 @@ (start_preparsed_function): Use cp_apply_type_quals_to_decl. (grokclassfn): Use cp_apply_type_quals_to_decl. * error.c (dump_type_suffix): Print qualifiers for function - types. + types. * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl. (tsubst): When substituting a function type into a member pointer type, pass along the qualifiers. diff --git a/gcc/cp/ChangeLog-1994 b/gcc/cp/ChangeLog-1994 index 1ec125fa86d..24d635df7d3 100644 --- a/gcc/cp/ChangeLog-1994 +++ b/gcc/cp/ChangeLog-1994 @@ -805,7 +805,7 @@ Sat Oct 1 15:18:49 1994 Jason Merrill push_c_function_context. (pop_cp_function_context): Similarly. (finish_function): Reverse order of poplevel and pop_nested_class so - that current_class_decl is restored properly. + that current_class_decl is restored properly. (start_function): Likewise. (finish_function): Add parameter 'nested'. Don't call permanent_allocation if (nested). diff --git a/gcc/cp/ChangeLog-1999 b/gcc/cp/ChangeLog-1999 index b89cd350ae9..2342d11a730 100644 --- a/gcc/cp/ChangeLog-1999 +++ b/gcc/cp/ChangeLog-1999 @@ -7,7 +7,7 @@ (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. @@ -27,7 +27,7 @@ (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. @@ -56,10 +56,10 @@ (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. @@ -86,7 +86,7 @@ * 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 @@ -98,7 +98,7 @@ 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 @@ -127,7 +127,7 @@ 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 ... @@ -160,7 +160,7 @@ * 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. @@ -196,7 +196,7 @@ (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 + (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. @@ -209,7 +209,7 @@ (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. @@ -244,7 +244,7 @@ * 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. @@ -367,7 +367,7 @@ (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'. @@ -375,7 +375,7 @@ * 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 @@ -418,7 +418,7 @@ 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. @@ -441,7 +441,7 @@ * 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. @@ -449,7 +449,7 @@ (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 @@ -483,7 +483,7 @@ * 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. @@ -497,7 +497,7 @@ 1999-11-25 Mark Mitchell - * Make-lang.in (CXX_SRCS): Add optimize.c. + * 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. @@ -505,9 +505,9 @@ (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. + (optimize.o): New target. * class.c: Don't include splay-tree.h. - * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT. + * 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. @@ -517,7 +517,7 @@ (optimize_function): Likewise. (cplus_unsave_expr_now): Remove. (copy_tree_r): Declare. - (remap_save_expr): Likewise. + (remap_save_expr): Likewise. * decl.c (local_variable_p): Don't make it static. (local_variable_p_walkfn): New function. @@ -530,19 +530,19 @@ (start_function): Set the DECL_CONTEXT for automatically generated labels. (finish_constructor_body): Use CTOR_STMT to mark the end of a - constructor. + constructor. * decl2.c: Don't include splay-tree.h. - (flag_inline_trees): Define. + (flag_inline_trees): Define. * dump.c: Don't include - splay-tree.h. + 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. + (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. + (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 @@ -564,11 +564,11 @@ (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. + for dwarf2. (maybe_suppress_debug_info): Likewise. Start by clearing TYPE_DECL_SUPPRESS_DEBUG. @@ -599,7 +599,7 @@ (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. @@ -617,7 +617,7 @@ 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. @@ -659,7 +659,7 @@ 1999-11-15 Jason Merrill * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic. - * pt.c (tsubst, case INTEGER_TYPE): Call it. + * 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 @@ -674,7 +674,7 @@ * 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, + * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p, note_debug_info_needed): #if 0 out. 1999-11-14 Mark Mitchell @@ -684,7 +684,7 @@ 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. @@ -779,7 +779,7 @@ (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. @@ -858,7 +858,7 @@ Thu Nov 11 12:42:11 MST 1999 Diego Novillo (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 @@ -913,7 +913,7 @@ Wed Nov 10 12:43:21 1999 Philippe De Muyter * 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. @@ -933,7 +933,7 @@ Wed Nov 10 12:43:21 1999 Philippe De Muyter * 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. @@ -953,7 +953,7 @@ Wed Nov 10 12:43:21 1999 Philippe De Muyter (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 @@ -962,7 +962,7 @@ Wed Nov 10 12:43:21 1999 Philippe De Muyter 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. @@ -1002,7 +1002,7 @@ Sat Oct 30 22:42:50 1999 Stephen L Moshier 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. @@ -1014,7 +1014,7 @@ Sat Oct 30 22:42:50 1999 Stephen L Moshier * 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 @@ -1059,7 +1059,7 @@ Sat Oct 30 22:42:50 1999 Stephen L Moshier (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. @@ -1068,7 +1068,7 @@ 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. + * typeck.c (build_function_call_real): Similarly. 1999-10-26 Mark Mitchell @@ -1078,7 +1078,7 @@ Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com) 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. @@ -1092,7 +1092,7 @@ Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com) (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 @@ -1114,12 +1114,12 @@ Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com) (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 @@ -1147,7 +1147,7 @@ Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com) * 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". @@ -1179,7 +1179,7 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke * 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. @@ -1197,12 +1197,12 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke 1999-10-09 Mark Mitchell - * cp-tree.h (make_rtl_for_local_static): New function. + * 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. @@ -1212,12 +1212,12 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke * 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. @@ -1258,7 +1258,7 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke (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. @@ -1283,21 +1283,21 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke (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 @@ -1306,7 +1306,7 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke (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. @@ -1350,7 +1350,7 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke (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 + (start_function): Rearrange slightly to call begin_stmt_tree earlier. (save_function_data): Tweak. (finish_function): Adjust call to finish_stmt_tree. @@ -1372,17 +1372,17 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke (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 @@ -1410,7 +1410,7 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke (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, + (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. @@ -1432,7 +1432,7 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke (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. @@ -1492,7 +1492,7 @@ Thu Sep 30 00:13:27 1999 Dirk Zoller (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 @@ -1513,7 +1513,7 @@ Thu Sep 30 00:13:27 1999 Dirk Zoller * 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. @@ -1613,7 +1613,7 @@ Thu Sep 30 00:13:27 1999 Dirk Zoller (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 @@ -1645,7 +1645,7 @@ Thu Sep 30 00:13:27 1999 Dirk Zoller 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. @@ -1692,7 +1692,7 @@ Fri Sep 24 10:48:10 1999 Bernd Schmidt (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 @@ -1706,21 +1706,21 @@ Fri Sep 24 10:48:10 1999 Bernd Schmidt 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. + macros. * ptree.c (print_lang_decl): Test for function or variable before accessing template info. @@ -1730,7 +1730,7 @@ Fri Sep 24 10:48:10 1999 Bernd Schmidt * 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 + * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned int' for wchar_t. 1999-09-23 Martin v. Löwis @@ -1870,7 +1870,7 @@ Fri Sep 24 10:48:10 1999 Bernd Schmidt * 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. @@ -1885,7 +1885,7 @@ Fri Sep 24 10:48:10 1999 Bernd Schmidt * 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. @@ -1909,7 +1909,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt 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 @@ -1929,7 +1929,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt 1999-09-17 Mark Mitchell - Turn on function-at-a-time processing. + 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. @@ -1941,7 +1941,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. - (do_poplevel): Likewise. + (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. @@ -1965,7 +1965,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt (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. + x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. @@ -1979,13 +1979,13 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt (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. + function. + * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local - variables. + variables. * method.c (emit_thunk): Call expand_body for the thunk. - (sythesize_method): Likewise. + (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. @@ -1995,7 +1995,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt (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. + * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. @@ -2018,7 +2018,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt 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. @@ -2087,7 +2087,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt * 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. @@ -2122,7 +2122,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt 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. @@ -2141,14 +2141,14 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt 1999-09-14 Mark Mitchell - * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the + * 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. @@ -2195,7 +2195,7 @@ Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi * 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. @@ -2223,7 +2223,7 @@ Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi 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. @@ -2254,9 +2254,9 @@ Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi * 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_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. @@ -2301,7 +2301,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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. @@ -2314,7 +2314,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * 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 + (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 @@ -2345,7 +2345,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * semantics.c (RECHAIN_STMTS): Remove `last' parameter. (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with - RECHAIN_STMTS. + RECHAIN_STMTS. (RECHAIN_STMST_FROM_CHAIN): Likewise. * parse.y (simple_stmt): Fix typo in last change. @@ -2366,7 +2366,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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. @@ -2393,10 +2393,10 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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_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 + (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 @@ -2422,11 +2422,11 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * 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 + * 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 + * 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. @@ -2442,7 +2442,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * 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. @@ -2456,7 +2456,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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 @@ -2480,7 +2480,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * 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. @@ -2498,7 +2498,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (retrofit_lang_decl): Likewise. (copy_lang_decl): Likewise. - * cp-tree.h (saved_scope): Remove old_binding_level and + * 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. @@ -2511,7 +2511,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (grokvardecl): Don't complete types here. * decl.c (start_function): Clear last_dtor_insn and - last_parm_cleanup_insn. + last_parm_cleanup_insn. (push_cp_function_context): Just copy over a little of the old context, not all of it. @@ -2555,7 +2555,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * 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. @@ -2635,7 +2635,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (binding_init): Remove. (init_cplus_unsave): Rename to ... (init_tree): This. Add GC roots. - + 1999-09-05 Mark Mitchell Get ready for garbage collection. @@ -2678,7 +2678,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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, + 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, @@ -2717,7 +2717,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * decl2.c: Don't include varray.h. (current_namespace): Remove. (init_decl2): Add GC roots. - * except.c (Terminate): Remove. + * except.c (Terminate): Remove. (init_exception_processing): Use terminate_node instead. (build_terminate_handler): Likewise. * init.c (nc_nelts_field_id): Remove. @@ -2752,7 +2752,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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 @@ -2773,7 +2773,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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. @@ -2793,7 +2793,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt 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. + 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. @@ -2807,7 +2807,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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. @@ -2841,7 +2841,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt 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. + 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. @@ -2849,7 +2849,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt 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. @@ -2915,12 +2915,12 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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. + arguments. (arg_assoc): Likewise. * pt.c (mangle_class_name_for_template): Allow member template template arguments. @@ -2992,7 +2992,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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 @@ -3020,7 +3020,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * 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, @@ -3057,7 +3057,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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. @@ -3090,7 +3090,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt 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 @@ -3102,15 +3102,15 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (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. @@ -3209,7 +3209,7 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt * 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. @@ -3254,12 +3254,12 @@ Mon Aug 23 22:17:20 1999 Mumit Khan * 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'. - + last statement is not an expression-statement has type `void'. + 1999-08-20 Mark Mitchell * semantics.c (finish_stmt_expr): Fix typo in comment. @@ -3269,7 +3269,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan 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 () @@ -3305,7 +3305,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan (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. @@ -3388,7 +3388,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan (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. @@ -3484,7 +3484,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan 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. @@ -3492,7 +3492,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan 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. @@ -3500,7 +3500,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan 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 + (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. @@ -3580,7 +3580,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan (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. @@ -3627,11 +3627,11 @@ Mon Aug 23 22:17:20 1999 Mumit Khan * 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. + throughout. * parse.c: Regenerated. - + * Make-lang.in (CXX_SRCS): Remove sig.c. * Makefile.in (CXX_OBJS): Remove sig.o. (sig.o): Remove. @@ -3718,12 +3718,12 @@ Mon Aug 23 22:17:20 1999 Mumit Khan * hash.h: Regenerated. * init.c (build_new_1): Remove support for signatures. * lang-options.h: Remove -fhandle-signatures, - -fno-handle-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. + signatures. (hack_identifier): Likewise. * parse.y (base_class): Likewise. (base_class.1): Likewise. @@ -3750,7 +3750,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan (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. @@ -3869,7 +3869,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan * 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. + from pointer to member of virtual base. * typeck.c (get_delta_difference): Likewise. 1999-08-06 Alexandre Oliva @@ -3892,13 +3892,13 @@ Mon Aug 23 22:17:20 1999 Mumit Khan `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 + * 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) @@ -3932,7 +3932,7 @@ Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) 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 @@ -3995,7 +3995,7 @@ Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) (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. @@ -4059,7 +4059,7 @@ Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) (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. @@ -4101,7 +4101,7 @@ Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) * 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 @@ -4165,7 +4165,7 @@ Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) (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. @@ -4181,7 +4181,7 @@ Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) * 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. @@ -4251,7 +4251,7 @@ Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com) (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 @@ -4361,7 +4361,7 @@ 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. @@ -4385,7 +4385,7 @@ Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com) * 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 + (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. @@ -4430,7 +4430,7 @@ Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com) 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 + * 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 @@ -4469,7 +4469,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva (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. + Same. 1999-07-01 Mark Mitchell @@ -4491,7 +4491,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva * error.c (dump_type_real): Handle TREE_LIST again. - * typeck.c (comp_target_parms): Don't complain about + * 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 @@ -4500,7 +4500,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva 1999-06-21 Mark Mitchell * init.c (expand_aggr_vbase_init): Rename to - construct_virtual_bases. Conditionalize construction here, + construct_virtual_bases. Conditionalize construction here, rather than ... (emit_base_init): Here. @@ -4515,16 +4515,16 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva * 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. (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 @@ -4558,7 +4558,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva (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 @@ -4637,7 +4637,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva * 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 + allocation to match practice throughout the rest of the compiler. 1999-05-30 Mark Mitchell @@ -4679,7 +4679,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva (DECL_SAVED_TREE): Document. (DECL_TEMPLATE_INJECT): Remove. * class.c (finish_struct): Remove code to deal with - DECL_TEMPLATE_INJECT. + DECL_TEMPLATE_INJECT. * decl.c (maybe_process_template_type_declaration): Handle all new types in templates uniformly. @@ -4689,7 +4689,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva forward-declarations. (instantiate_class_template): Remove code processing DECL_TEMPLATE_INJECT. - + * pt.c (lookup_template_class): Tweak lookup to find member templates. @@ -4697,7 +4697,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva 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 @@ -4707,7 +4707,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva * 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. @@ -4720,12 +4720,12 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva * 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. @@ -4746,7 +4746,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva 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. @@ -4768,7 +4768,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva (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. @@ -4883,7 +4883,7 @@ Tue May 18 00:21:34 1999 Zack Weinberg * 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. @@ -4935,7 +4935,7 @@ Tue May 18 00:21:34 1999 Zack Weinberg convert_for_initialization): Likewise. * class.c (instantiate_type): Handle seeing a baselink under an OFFSET_REF. - * error.c (dump_expr): Likewise. + * 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. @@ -4986,7 +4986,7 @@ Tue May 18 00:21:34 1999 Zack Weinberg 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 diff --git a/gcc/cp/ChangeLog-2003 b/gcc/cp/ChangeLog-2003 index f0500f4b147..07ed1edbfcc 100644 --- a/gcc/cp/ChangeLog-2003 +++ b/gcc/cp/ChangeLog-2003 @@ -190,7 +190,7 @@ other parsing fails. (cp_parser_enclosed_template_argument_list): If the argument list is parsed correctly, but the next token is '>>', emit a diagnostic. - (cp_parser_next_token_ends_template_argument): Accept '>>' as + (cp_parser_next_token_ends_template_argument): Accept '>>' as delimiter of template argument, it will be later detected as a typo. 2003-12-17 Kelley Cook @@ -396,7 +396,7 @@ PR c/13134 * decl.c (duplicate_decls): Copy visibility flag when appropriate. - + 2003-12-09 Giovanni Bajo * init.c (build_new_1): Deal with an OVERLOAD set when @@ -414,7 +414,7 @@ PR c++/11929 * call.c (magic_varargs_p): New fn. - (build_over_call): Do no ellipsis conversions for arguments to + (build_over_call): Do no ellipsis conversions for arguments to functions with magic varargs. * name-lookup.c, init.c, except.c: Revert Giovanni's patch from @@ -460,7 +460,7 @@ PR c++/13305 * parser.c (cp_parser_elaborated_type_specifier): Accept attributes. - + 2003-12-05 Mark Mitchell PR c++/13314 @@ -514,7 +514,7 @@ 2003-12-02 Richard Henderson * name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD. - * parser.c (struct cp_token): Likewise. + * parser.c (struct cp_token): Likewise. (struct cp_parser_token_tree_map_node): Likewise. * lex.c (struct resword): Move const after ENUM_BITFIELD. @@ -709,7 +709,7 @@ * decl.c (duplicate_decls): copy DECL_VISIBILITY field. * method.c (use_thunk): give thunk same visibility as function. * optimize.c (maybe_clone_body): copy DECL_VISIBILITY field. - + 2003-11-05 Kriang Lerdsuwanakij PR c++/11616 @@ -799,7 +799,8 @@ mangle a non-existant middle operator to the ?: operator. 2003-10-21 Robert Bowdidge - * decl.c (cp_finish_decl): Remove clause intended for asm directives + + * decl.c (cp_finish_decl): Remove clause intended for asm directives in struct or class fields: this code is never executed. 2003-10-22 Kriang Lerdsuwanakij @@ -961,7 +962,7 @@ 2003-10-13 Gabriel Dos Reis - Break out decl.c (2/n) + Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. @@ -1056,7 +1057,7 @@ (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h - + 2003-10-12 Steven Bosscher * cvt.c (ocp_convert): Move warning to C common code. @@ -1096,7 +1097,7 @@ pp_cxx_flag_qualified_id and pp_cxx_flag_global_scope. * cxx-pretty-print.c (pp_cxx_id_expression): Always display qualified entities using qualified names. - + PR c++/12337 * init.c (build_new_1): Make sure that the expression returned is not an lvalue. @@ -1122,7 +1123,7 @@ 2003-10-03 Gabriel Dos Reis * name-lookup.c (binding_entry_free): Nullify name and type - fields. + fields. 2003-10-02 Mark Mitchell @@ -1143,7 +1144,7 @@ 2003-09-30 Gabriel Dos Reis * decl.c (pop_binding): Don't mess with nullifying binding->scope - here. + here. * name-lookup.c: Re-format. (cxx_binding_free): Nullify binding->scope. @@ -1286,7 +1287,7 @@ 2003-09-19 Gabriel Dos Reis * decl.c (cxx_scope_descriptor): Fix thinko. - (struct cp_binding_level): Adjust type of binding_depth field. + (struct cp_binding_level): Adjust type of binding_depth field. 2003-09-18 Danny Smith @@ -1317,7 +1318,7 @@ 2003-09-18 Gabriel Dos Reis * error.c (dump_type): Simplify. Use pp_type_specifier_seq for - "C" types. + "C" types. * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko. 2003-09-17 Richard Henderson @@ -1397,7 +1398,7 @@ the various flags. (set_block): Remove check for doing_semantic_analysis_p. (pushlevel_class): Use "kind" field in binding_level, not - the various flags. + the various flags. (poplevel_class): Likewise. (initial_push_namespace_scope): Likewise. (maybe_push_to_top_level): Likewise. @@ -1427,7 +1428,7 @@ (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. - + 2003-09-14 Mark Mitchell * class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for @@ -1487,7 +1488,7 @@ 2003-09-09 Richard Henderson - * semantics.c (expand_or_defer_fn): Update call to + * semantics.c (expand_or_defer_fn): Update call to cgraph_finalize_function. * semantics.c (expand_or_defer_fn): Use cgraph_finalize_function @@ -1540,7 +1541,7 @@ * 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. + declaration. (duplicate_decls): Tidy diagnostic message. * cxx-pretty-print.c (pp_cxx_left_brace): New macro. (pp_cxx_right_brace): Likewise. @@ -1571,7 +1572,7 @@ (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. + Return a bool. Improve documentation. (set_namespace_binding): Adjust. * Make-lang.in (cp/name-lookup.o): Depend on toplev.h @@ -1785,7 +1786,7 @@ PR c++/11811 * cxx-pretty-print.c (pp_cxx_canonical_template_parameter): New - function. + function. * cxx-pretty-print.h: Declare. * error.c (dump_template_parameter): Use it. (dump_type): Likewise. diff --git a/gcc/cp/ChangeLog.tree-ssa b/gcc/cp/ChangeLog.tree-ssa index a52dea67450..a85593c3d57 100644 --- a/gcc/cp/ChangeLog.tree-ssa +++ b/gcc/cp/ChangeLog.tree-ssa @@ -49,7 +49,7 @@ * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to the proper type. - + 2004-02-24 Jason Merrill PR c++/13944 @@ -89,7 +89,7 @@ * call.c, cvt.c, init.c, typeck.c: Use TREE_NO_WARNING instead of TREE_NO_UNUSED_WARNING. * cvt.c (convert_to_void): Also use it for "has no effect" warning. - + 2004-01-30 Frank Ch. Eigler * cp-mudflap.c (mflang_flush_calls): Mark static ctor as TREE_USED. @@ -138,7 +138,7 @@ * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill. * cp-tree.h (cxx_callgraph_analyze_expr): Kill. * decl2.c (cxx_callgraph_analyze_expr): Kill. - + 2003-12-14 Jan Hubicka * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill. diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 050e9dcdb09..abd39d4b43e 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -60,7 +60,7 @@ g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) $(CON $(INCLUDES) $(srcdir)/cp/g++spec.c) # Create the compiler driver for g++. -GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o +GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS) @@ -181,7 +181,7 @@ c++.install-common: installdirs doc/g++.1: doc/gcc.1 cp doc/gcc.1 doc/g++.1 -c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext) +c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext) $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs -rm -f $@ diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS index 75a5823fc96..29b76117367 100644 --- a/gcc/cp/NEWS +++ b/gcc/cp/NEWS @@ -9,15 +9,15 @@ * G++ no longer allows in-class initializations of static data members that do not have arithmetic or enumeration type. For example: - struct S { + struct S { static const char* const p = "abc"; }; - is no longer accepted. + is no longer accepted. Use the standards-conformant form: - struct S { + struct S { static const char* const p; }; @@ -39,12 +39,12 @@ pointer to cv-qualified member function types. * The C++ ABI has been changed to correctly handle this code: - + struct A { void operator delete[] (void *, size_t); }; - struct B : public A { + struct B : public A { }; new B[10]; @@ -52,17 +52,17 @@ The amount of storage allocated for the array will be greater than it was in 3.0, in order to store the number of elements in the array, so that the correct size can be passed to `operator delete[]' - when the array is deleted. Previously, the value passed to + when the array is deleted. Previously, the value passed to `operator delete[]' was unpredictable. This change will only affect code that declares a two-argument `operator delete[]' with a second parameter of type `size_t' - in a base class, and does not override that definition in a + in a base class, and does not override that definition in a derived class. * The C++ ABI has been changed so that: - struct A { + struct A { void operator delete[] (void *, size_t); void operator delete[] (void *); }; @@ -109,7 +109,7 @@ are those whose types involve non-type template arguments whose mangled representations require more than one digit. -* Support for assignment to `this' has been removed. This idiom +* Support for assignment to `this' has been removed. This idiom was used in the very early days of C++, before users were allowed to overload `operator new'; it is no longer allowed by the C++ standard. @@ -124,15 +124,15 @@ * G++ previously allowed `sizeof (X::Y)' where Y was a non-static member of X, even if the `sizeof' expression occurred outside - of a non-static member function of X (or one of its derived classes, + of a non-static member function of X (or one of its derived classes, or a member-initializer for X or one of its derived classes.) This extension has been removed. -* G++ no longer allows you to overload the conditional operator (i.e., +* G++ no longer allows you to overload the conditional operator (i.e., the `?:' operator.) * The "named return value" extension: - + int f () return r { r = 3; } has been deprecated, and will be removed in a future version of G++. @@ -175,7 +175,7 @@ *** Changes in EGCS 1.1: -* Namespaces are fully supported. The library has not yet been converted +* Namespaces are fully supported. The library has not yet been converted to use namespace std, however, and the old std-faking code is still on by default. To turn it off, you can use -fhonor-std. @@ -252,7 +252,7 @@ http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res - + Guiding declarations are no longer supported. Function declarations, + + Guiding declarations are no longer supported. Function declarations, including friend declarations, do not refer to template instantiations. You can restore the old behavior with -fguiding-decls until you fix your code. @@ -315,7 +315,7 @@ converting from a bound member function pointer to function pointer). - + A flag -Weffc++ has been added for violations of some of the style + + A flag -Weffc++ has been added for violations of some of the style guidelines in Scott Meyers' _Effective C++_ books. + -Woverloaded-virtual now warns if a virtual function in a base @@ -336,13 +336,13 @@ * __FUNCTION__ and __PRETTY_FUNCTION__ are now treated as variables by the parser; previously they were treated as string constants. So code like - `printf (__FUNCTION__ ": foo")' must be rewritten to + `printf (__FUNCTION__ ": foo")' must be rewritten to `printf ("%s: foo", __FUNCTION__)'. This is necessary for templates. * local static variables in extern inline functions will be shared between translation units. -* -fvtable-thunks is supported for all targets, and is the default for +* -fvtable-thunks is supported for all targets, and is the default for Linux with glibc 2.x (also called libc 6.x). * bool is now always the same size as another built-in type. Previously, @@ -395,7 +395,7 @@ * Joe Buck , the maintainer of the g++ FAQ. * Brendan Kehoe , who coordinates testing of g++. * Jason Merrill , the g++ maintainer. -* Mark Mitchell , who implemented member function +* Mark Mitchell , who implemented member function templates and explicit qualification of function templates. * Mike Stump , the previous g++ maintainer, who did most of the exception handling work. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 01d4046e0bf..f6873cc1854 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1,5 +1,5 @@ /* Functions related to invoking methods and overloaded functions. - Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and modified by Brendan Kehoe (brendan@cygnus.com). @@ -42,7 +42,7 @@ Boston, MA 02111-1307, USA. */ /* The various kinds of conversion. */ -typedef enum conversion_kind { +typedef enum conversion_kind { ck_identity, ck_lvalue, ck_qual, @@ -93,7 +93,7 @@ struct conversion { used. */ BOOL_BITFIELD check_copy_constructor_p : 1; /* If KIND is ck_ptr or ck_pmem, true to indicate that a conversion - from a pointer-to-derived to pointer-to-base is being performed. */ + from a pointer-to-derived to pointer-to-base is being performed. */ BOOL_BITFIELD base_p : 1; /* The type of the expression resulting from the conversion. */ tree type; @@ -148,12 +148,12 @@ static tree build_this (tree); static struct z_candidate *splice_viable (struct z_candidate *, bool, bool *); static bool any_strictly_viable (struct z_candidate *); static struct z_candidate *add_template_candidate - (struct z_candidate **, tree, tree, tree, tree, tree, + (struct z_candidate **, tree, tree, tree, tree, tree, tree, tree, int, unification_kind_t); static struct z_candidate *add_template_candidate_real - (struct z_candidate **, tree, tree, tree, tree, tree, + (struct z_candidate **, tree, tree, tree, tree, tree, tree, tree, int, tree, unification_kind_t); -static struct z_candidate *add_template_conv_candidate +static struct z_candidate *add_template_conv_candidate (struct z_candidate **, tree, tree, tree, tree, tree, tree); static void add_builtin_candidates (struct z_candidate **, enum tree_code, enum tree_code, @@ -162,12 +162,12 @@ static void add_builtin_candidate (struct z_candidate **, enum tree_code, enum tree_code, tree, tree, tree, tree *, tree *, int); static bool is_complete (tree); -static void build_builtin_candidate +static void build_builtin_candidate (struct z_candidate **, tree, tree, tree, tree *, tree *, int); -static struct z_candidate *add_conv_candidate +static struct z_candidate *add_conv_candidate (struct z_candidate **, tree, tree, tree, tree, tree); -static struct z_candidate *add_function_candidate +static struct z_candidate *add_function_candidate (struct z_candidate **, tree, tree, tree, tree, tree, int); static conversion *implicit_conversion (tree, tree, tree, int); static conversion *standard_conversion (tree, tree, tree, int); @@ -176,8 +176,8 @@ static conversion *build_conv (conversion_kind, tree, conversion *); static bool is_subseq (conversion *, conversion *); static tree maybe_handle_ref_bind (conversion **); static void maybe_handle_implicit_object (conversion **); -static struct z_candidate *add_candidate - (struct z_candidate **, tree, tree, size_t, +static struct z_candidate *add_candidate + (struct z_candidate **, tree, tree, size_t, conversion **, tree, tree, int); static tree source_type (conversion *); static void add_warning (struct z_candidate *, struct z_candidate *); @@ -226,11 +226,11 @@ check_dtor_name (tree basetype, tree name) else { /* In the case of: - + template struct S { ~S(); }; int i; i.~S(); - + NAME will be a class template. */ gcc_assert (DECL_CLASS_TEMPLATE_P (name)); return false; @@ -340,7 +340,7 @@ build_call (tree function, tree parms) function = build3 (CALL_EXPR, result_type, function, parms, NULL_TREE); TREE_HAS_CONSTRUCTOR (function) = is_constructor; TREE_NOTHROW (function) = nothrow; - + return function; } @@ -485,7 +485,7 @@ void validate_conversion_obstack (void) { if (conversion_obstack_initialized) - gcc_assert ((obstack_next_free (&conversion_obstack) + gcc_assert ((obstack_next_free (&conversion_obstack) == obstack_base (&conversion_obstack))); } @@ -544,7 +544,7 @@ static conversion * build_identity_conv (tree type, tree expr) { conversion *c; - + c = alloc_conversion (ck_identity); c->type = type; c->u.expr = expr; @@ -632,7 +632,7 @@ standard_conversion (tree to, tree from, tree expr, int flags) conversion. */ conversion *part_conv = standard_conversion (TREE_TYPE (to), TREE_TYPE (from), NULL_TREE, flags); - + if (part_conv) { conv = build_conv (part_conv->kind, to, conv); @@ -680,7 +680,7 @@ standard_conversion (tree to, tree from, tree expr, int flags) && TREE_CODE (TREE_TYPE (from)) != FUNCTION_TYPE) { from = build_pointer_type - (cp_build_qualified_type (void_type_node, + (cp_build_qualified_type (void_type_node, cp_type_quals (TREE_TYPE (from)))); conv = build_conv (ck_ptr, from, conv); } @@ -694,7 +694,7 @@ standard_conversion (tree to, tree from, tree expr, int flags) (TYPE_PTRMEM_POINTED_TO_TYPE (from), TYPE_PTRMEM_POINTED_TO_TYPE (to)))) { - from = build_ptrmem_type (tbase, + from = build_ptrmem_type (tbase, TYPE_PTRMEM_POINTED_TO_TYPE (from)); conv = build_conv (ck_pmem, from, conv); } @@ -704,7 +704,7 @@ standard_conversion (tree to, tree from, tree expr, int flags) else if (IS_AGGR_TYPE (TREE_TYPE (from)) && IS_AGGR_TYPE (TREE_TYPE (to)) /* [conv.ptr] - + An rvalue of type "pointer to cv D," where D is a class type, can be converted to an rvalue of type "pointer to cv B," where B is a base class (clause @@ -716,7 +716,7 @@ standard_conversion (tree to, tree from, tree expr, int flags) access or uniqueness. */ && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from))) { - from = + from = cp_build_qualified_type (TREE_TYPE (to), cp_type_quals (TREE_TYPE (from))); from = build_pointer_type (from); @@ -767,7 +767,7 @@ standard_conversion (tree to, tree from, tree expr, int flags) return 0; from = cp_build_qualified_type (tbase, cp_type_quals (fbase)); - from = build_method_type_directly (from, + from = build_method_type_directly (from, TREE_TYPE (fromfn), TREE_CHAIN (TYPE_ARG_TYPES (fromfn))); from = build_ptrmemfunc_type (build_pointer_type (from)); @@ -788,12 +788,12 @@ standard_conversion (tree to, tree from, tree expr, int flags) conv = build_conv (ck_std, to, conv); if (fcode == POINTER_TYPE || TYPE_PTRMEM_P (from) - || (TYPE_PTRMEMFUNC_P (from) + || (TYPE_PTRMEMFUNC_P (from) && conv->rank < cr_pbool)) conv->rank = cr_pbool; return conv; } - + return NULL; } /* We don't check for ENUMERAL_TYPE here because there are no standard @@ -917,7 +917,7 @@ convert_class_to_reference (tree t, tree s, tree expr) { tree f = OVL_CURRENT (fns); tree t2 = TREE_TYPE (TREE_TYPE (f)); - + cand = NULL; /* If this is a template function, try to get an exact @@ -933,7 +933,7 @@ convert_class_to_reference (tree t, tree s, tree expr) TREE_PURPOSE (conversions), LOOKUP_NORMAL, DEDUCE_CONV); - + if (cand) { /* Now, see if the conversion function really returns @@ -952,23 +952,23 @@ convert_class_to_reference (tree t, tree s, tree expr) } else if (TREE_CODE (t2) == REFERENCE_TYPE && reference_compatible_p (t, TREE_TYPE (t2))) - cand = add_function_candidate (&candidates, f, s, arglist, - TYPE_BINFO (s), + cand = add_function_candidate (&candidates, f, s, arglist, + TYPE_BINFO (s), TREE_PURPOSE (conversions), LOOKUP_NORMAL); - + if (cand) { conversion *identity_conv; /* Build a standard conversion sequence indicating the binding from the reference type returned by the function to the desired REFERENCE_TYPE. */ - identity_conv - = build_identity_conv (TREE_TYPE (TREE_TYPE + identity_conv + = build_identity_conv (TREE_TYPE (TREE_TYPE (TREE_TYPE (cand->fn))), NULL_TREE); cand->second_conv - = (direct_reference_binding + = (direct_reference_binding (reference_type, identity_conv)); cand->second_conv->bad_p |= cand->convs[0]->bad_p; } @@ -1005,7 +1005,7 @@ convert_class_to_reference (tree t, tree s, tree expr) if (cand->viable == -1) conv->bad_p = true; - + return cand->second_conv; } @@ -1023,15 +1023,15 @@ direct_reference_binding (tree type, conversion *conv) t = TREE_TYPE (type); - /* [over.ics.rank] - + /* [over.ics.rank] + When a parameter of reference type binds directly (_dcl.init.ref_) to an argument expression, the implicit conversion sequence is the identity conversion, unless the argument expression has a type that is a derived class of the parameter type, in which case the implicit conversion sequence is a derived-to-base Conversion. - + If the parameter binds directly to the result of applying a conversion function to the argument expression, the implicit conversion sequence is a user-defined conversion sequence @@ -1094,11 +1094,11 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) { /* [dcl.init.ref] - If the initializer expression - + If the initializer expression + -- is an lvalue (but not an lvalue for a bit-field), and "cv1 T1" is reference-compatible with "cv2 T2," - + the reference is bound directly to the initializer expression lvalue. */ conv = build_identity_conv (from, expr); @@ -1117,7 +1117,7 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) a temporary, so we just issue an error when the conversion actually occurs. */ conv->need_temporary_p = true; - + return conv; } else if (CLASS_TYPE_P (from) && !(flags & LOOKUP_NO_CONVERSION)) @@ -1131,7 +1131,7 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) "cv1 T1" is reference-compatible with "cv3 T3". (this conversion is selected by enumerating the applicable conversion functions (_over.match.ref_) and choosing the - best one through overload resolution. (_over.match_). + best one through overload resolution. (_over.match_). the reference is bound to the lvalue result of the conversion in the second case. */ @@ -1146,7 +1146,7 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) return NULL; /* [over.ics.rank] - + When a parameter of reference type is not bound directly to an argument expression, the conversion sequence is the one required to convert the argument expression to the underlying type of the @@ -1163,16 +1163,16 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) return NULL; /* [dcl.init.ref] - + If the initializer expression is an rvalue, with T2 a class type, and "cv1 T1" is reference-compatible with "cv2 T2", the reference is bound in one of the following ways: - + -- The reference is bound to the object represented by the rvalue - or to a sub-object within that object. + or to a sub-object within that object. -- ... - + We use the first alternative. The implicit conversion sequence is supposed to be same as we would obtain by generating a temporary. Fortunately, if the types are reference compatible, @@ -1256,13 +1256,13 @@ implicit_conversion (tree to, tree from, tree expr, int flags) functions. */ static struct z_candidate * -add_candidate (struct z_candidate **candidates, - tree fn, tree args, - size_t num_convs, conversion **convs, - tree access_path, tree conversion_path, +add_candidate (struct z_candidate **candidates, + tree fn, tree args, + size_t num_convs, conversion **convs, + tree access_path, tree conversion_path, int viable) { - struct z_candidate *cand + struct z_candidate *cand = conversion_obstack_alloc (sizeof (struct z_candidate)); cand->fn = fn; @@ -1286,8 +1286,8 @@ add_candidate (struct z_candidate **candidates, comes from for purposes of overload resolution. */ static struct z_candidate * -add_function_candidate (struct z_candidate **candidates, - tree fn, tree ctype, tree arglist, +add_function_candidate (struct z_candidate **candidates, + tree fn, tree ctype, tree arglist, tree access_path, tree conversion_path, int flags) { @@ -1311,7 +1311,7 @@ add_function_candidate (struct z_candidate **candidates, orig_arglist = arglist; arglist = skip_artificial_parms_for (fn, arglist); } - else + else orig_arglist = arglist; len = list_length (arglist); @@ -1410,7 +1410,7 @@ add_function_candidate (struct z_candidate **candidates, } out: - return add_candidate (candidates, fn, orig_arglist, len, convs, + return add_candidate (candidates, fn, orig_arglist, len, convs, access_path, conversion_path, viable); } @@ -1488,7 +1488,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, if (!sufficient_parms_p (parmnode)) viable = 0; - return add_candidate (candidates, totype, arglist, len, convs, + return add_candidate (candidates, totype, arglist, len, convs, access_path, conversion_path, viable); } @@ -1536,10 +1536,10 @@ build_builtin_candidate (struct z_candidate **candidates, tree fnname, convs[0] = t; else viable = 0; - } + } - add_candidate (candidates, fnname, /*args=*/NULL_TREE, - num_convs, convs, + add_candidate (candidates, fnname, /*args=*/NULL_TREE, + num_convs, convs, /*access_path=*/NULL_TREE, /*conversion_path=*/NULL_TREE, viable); @@ -1571,9 +1571,9 @@ promoted_arithmetic_type_p (tree type) /* Create any builtin operator overload candidates for the operator in question given the converted operand types TYPE1 and TYPE2. The other args are passed through from add_builtin_candidates to - build_builtin_candidate. - - TYPE1 and TYPE2 may not be permissible, and we must filter them. + build_builtin_candidate. + + TYPE1 and TYPE2 may not be permissible, and we must filter them. If CODE is requires candidates operands of the same type of the kind of which TYPE1 and TYPE2 are, we add both candidates CODE (TYPE1, TYPE1) and CODE (TYPE2, TYPE2). */ @@ -1642,7 +1642,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, && (TYPE_PTROB_P (type1) || TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)) break; - return; + return; /* 9 For every type T, there exist candidate operator functions of the form T* operator+(T*); @@ -1910,9 +1910,9 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, /* [over.built] For every pair of promoted arithmetic types L and R, there - exist candidate operator functions of the form + exist candidate operator functions of the form - LR operator?(bool, L, R); + LR operator?(bool, L, R); where LR is the result of the usual arithmetic conversions between types L and R. @@ -1930,7 +1930,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, if (!(TYPE_PTR_P (type1) || TYPE_PTR_TO_MEMBER_P (type1)) || !(TYPE_PTR_P (type2) || TYPE_PTR_TO_MEMBER_P (type2))) return; - + /* We don't check that the two types are the same; the logic below will actually create two candidates; one in which both parameter types are TYPE1, and one in which both parameter @@ -1980,7 +1980,7 @@ type_decays_to (tree type) one of the input types converts to. 3) arithmetic candidates. According to the standard, we should generate all of these, but I'm trying not to... - + Here we generate a superset of the possible candidates for this particular case. That is a subset of the full set the standard defines, plus some other cases which the standard disallows. add_builtin_candidate will @@ -2055,7 +2055,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, case GE_EXPR: enum_p = 1; /* Fall through. */ - + default: ref1 = 0; } @@ -2199,7 +2199,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, /* In [class.copy]: A member function template is never instantiated to perform the - copy of a class object to an object of its class type. + copy of a class object to an object of its class type. It's a little unclear what this means; the standard explicitly does allow a template to be used to copy a class. For example, @@ -2211,14 +2211,14 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, }; const A f (); void g () { A a (f ()); } - + the member template will be used to make the copy. The section quoted above appears in the paragraph that forbids constructors whose only parameter is (a possibly cv-qualified variant of) the class type, and a logical interpretation is that the intent was to forbid the instantiation of member templates which would then have that form. */ - if (DECL_CONSTRUCTOR_P (fn) && list_length (arglist) == 2) + if (DECL_CONSTRUCTOR_P (fn) && list_length (arglist) == 2) { tree arg_types = FUNCTION_FIRST_USER_PARMTYPE (fn); if (arg_types && same_type_p (TYPE_MAIN_VARIANT (TREE_VALUE (arg_types)), @@ -2232,7 +2232,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, conversion_path, arglist); else cand = add_function_candidate (candidates, fn, ctype, - arglist, access_path, + arglist, access_path, conversion_path, flags); if (DECL_TI_TEMPLATE (fn) != tmpl) /* This situation can occur if a member template of a template @@ -2266,9 +2266,9 @@ add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype, tree access_path, tree conversion_path, int flags, unification_kind_t strict) { - return + return add_template_candidate_real (candidates, tmpl, ctype, - explicit_targs, arglist, return_type, + explicit_targs, arglist, return_type, access_path, conversion_path, flags, NULL_TREE, strict); } @@ -2279,7 +2279,7 @@ add_template_conv_candidate (struct z_candidate **candidates, tree tmpl, tree obj, tree arglist, tree return_type, tree access_path, tree conversion_path) { - return + return add_template_candidate_real (candidates, tmpl, NULL_TREE, NULL_TREE, arglist, return_type, access_path, conversion_path, 0, obj, DEDUCE_CONV); @@ -2304,8 +2304,8 @@ splice_viable (struct z_candidate *cands, last_viable = &viable; *any_viable_p = false; - cand = &cands; - while (*cand) + cand = &cands; + while (*cand) { struct z_candidate *c = *cand; if (strict_p ? c->viable == 1 : c->viable) @@ -2460,7 +2460,7 @@ merge_conversion_sequences (conversion *user_seq, conversion *std_seq) gcc_assert (user_seq->kind == ck_user); /* Find the end of the second conversion sequence. */ - t = &(std_seq); + t = &(std_seq); while ((*t)->kind != ck_identity) t = &((*t)->u.next); @@ -2526,18 +2526,18 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) if (DECL_NONCONVERTING_P (ctor)) continue; - if (TREE_CODE (ctor) == TEMPLATE_DECL) + if (TREE_CODE (ctor) == TEMPLATE_DECL) cand = add_template_candidate (&candidates, ctor, totype, - NULL_TREE, args, NULL_TREE, + NULL_TREE, args, NULL_TREE, TYPE_BINFO (totype), TYPE_BINFO (totype), flags, DEDUCE_CALL); - else + else cand = add_function_candidate (&candidates, ctor, totype, - args, TYPE_BINFO (totype), + args, TYPE_BINFO (totype), TYPE_BINFO (totype), - flags); + flags); if (cand) cand->second_conv = build_identity_conv (totype, NULL_TREE); @@ -2558,11 +2558,11 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) look for a temporary binding. */ if (TREE_CODE (totype) == REFERENCE_TYPE) convflags |= LOOKUP_NO_TEMP_BIND; - + for (fns = TREE_VALUE (conv_fns); fns; fns = OVL_NEXT (fns)) { tree fn = OVL_CURRENT (fns); - + /* [over.match.funcs] For conversion functions, the function is considered to be a member of the class of the implicit object argument for the purpose of defining the type of @@ -2571,29 +2571,29 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) So we pass fromtype as CTYPE to add_*_candidate. */ if (TREE_CODE (fn) == TEMPLATE_DECL) - cand = add_template_candidate (&candidates, fn, fromtype, + cand = add_template_candidate (&candidates, fn, fromtype, NULL_TREE, - args, totype, - TYPE_BINFO (fromtype), + args, totype, + TYPE_BINFO (fromtype), conversion_path, flags, DEDUCE_CONV); - else + else cand = add_function_candidate (&candidates, fn, fromtype, args, TYPE_BINFO (fromtype), conversion_path, - flags); + flags); if (cand) { conversion *ics - = implicit_conversion (totype, + = implicit_conversion (totype, TREE_TYPE (TREE_TYPE (cand->fn)), 0, convflags); cand->second_conv = ics; - + if (!ics) cand->viable = 0; else if (candidates->viable == 1 && ics->bad_p) @@ -2671,7 +2671,7 @@ resolve_args (tree args) for (t = args; t; t = TREE_CHAIN (t)) { tree arg = TREE_VALUE (t); - + if (arg == error_mark_node) return error_mark_node; else if (VOID_TYPE_P (TREE_TYPE (arg))) @@ -2690,14 +2690,14 @@ resolve_args (tree args) that overload resolution fails, *CANDIDATES will be the set of candidates considered, and ANY_VIABLE_P will be set to true or false to indicate whether or not any of the candidates were - viable. + viable. The ARGS should already have gone through RESOLVE_ARGS before this function is called. */ static struct z_candidate * -perform_overload_resolution (tree fn, - tree args, +perform_overload_resolution (tree fn, + tree args, struct z_candidate **candidates, bool *any_viable_p) { @@ -2709,7 +2709,7 @@ perform_overload_resolution (tree fn, *any_viable_p = true; /* Check FN and ARGS. */ - gcc_assert (TREE_CODE (fn) == FUNCTION_DECL + gcc_assert (TREE_CODE (fn) == FUNCTION_DECL || TREE_CODE (fn) == TEMPLATE_DECL || TREE_CODE (fn) == OVERLOAD || TREE_CODE (fn) == TEMPLATE_ID_EXPR); @@ -2739,7 +2739,7 @@ perform_overload_resolution (tree fn, /* Return an expression for a call to FN (a namespace-scope function, or a static member function) with the ARGS. */ - + tree build_new_function_call (tree fn, tree args) { @@ -2816,7 +2816,7 @@ build_operator_new_call (tree fnname, tree args, tree *size, tree *cookie_size) /* Figure out what function is being called. */ cand = perform_overload_resolution (fns, args, &candidates, &any_viable_p); - + /* If no suitable function could be found, issue an error message and give up. */ if (!cand) @@ -2857,7 +2857,7 @@ build_operator_new_call (tree fnname, tree args, tree *size, tree *cookie_size) /* Skip the size_t parameter. */ arg_types = TREE_CHAIN (arg_types); /* Check the remaining parameters (if any). */ - if (arg_types + if (arg_types && TREE_CHAIN (arg_types) == void_list_node && same_type_p (TREE_VALUE (arg_types), ptr_type_node)) @@ -2919,7 +2919,7 @@ build_object_call (tree obj, tree args) tree fn = OVL_CURRENT (fns); if (TREE_CODE (fn) == TEMPLATE_DECL) add_template_candidate (&candidates, fn, base, NULL_TREE, - mem_args, NULL_TREE, + mem_args, NULL_TREE, TYPE_BINFO (type), TYPE_BINFO (type), LOOKUP_NORMAL, DEDUCE_CALL); @@ -2947,8 +2947,8 @@ build_object_call (tree obj, tree args) for (; fns; fns = OVL_NEXT (fns)) { tree fn = OVL_CURRENT (fns); - if (TREE_CODE (fn) == TEMPLATE_DECL) - add_template_conv_candidate + if (TREE_CODE (fn) == TEMPLATE_DECL) + add_template_conv_candidate (&candidates, fn, obj, args, totype, /*access_path=*/NULL_TREE, /*conversion_path=*/NULL_TREE); @@ -3012,12 +3012,12 @@ op_error (enum tree_code code, enum tree_code code2, error ("%s for ternary % in %<%E ? %E : %E%>", problem, arg1, arg2, arg3); break; - + case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: error ("%s for % in %<%E%s%>", problem, opname, arg1, opname); break; - + case ARRAY_REF: error ("%s for % in %<%E[%E]%>", problem, arg1, arg2); break; @@ -3026,7 +3026,7 @@ op_error (enum tree_code code, enum tree_code code2, case IMAGPART_EXPR: error ("%s for %qs in %<%s %E%>", problem, opname, opname, arg1); break; - + default: if (arg2) error ("%s for % in %<%E %s %E%>", @@ -3057,7 +3057,7 @@ conditional_conversion (tree e1, tree e2) reference must bind directly (_dcl.init.ref_) to E1. */ if (real_lvalue_p (e2)) { - conv = implicit_conversion (build_reference_type (t2), + conv = implicit_conversion (build_reference_type (t2), t1, e1, LOOKUP_NO_TEMP_BIND); @@ -3081,7 +3081,7 @@ conditional_conversion (tree e1, tree e2) if (good_base && at_least_as_qualified_p (t2, t1)) { conv = build_identity_conv (t1, e1); - if (!same_type_p (TYPE_MAIN_VARIANT (t1), + if (!same_type_p (TYPE_MAIN_VARIANT (t1), TYPE_MAIN_VARIANT (t2))) conv = build_conv (ck_base, t2, conv); else @@ -3132,7 +3132,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) } /* [expr.cond] - + The first expr ession is implicitly converted to bool (clause _conv_). */ arg1 = perform_implicit_conversion (boolean_type_node, arg1); @@ -3174,12 +3174,12 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) type of the other and is an rvalue. --Both the second and the third operands have type void; the - result is of type void and is an rvalue. + result is of type void and is an rvalue. We must avoid calling force_rvalue for expressions of type "void" because it will complain that their value is being used. */ - if (TREE_CODE (arg2) == THROW_EXPR + if (TREE_CODE (arg2) == THROW_EXPR && TREE_CODE (arg3) != THROW_EXPR) { if (!VOID_TYPE_P (arg3_type)) @@ -3187,7 +3187,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) arg3_type = TREE_TYPE (arg3); result_type = arg3_type; } - else if (TREE_CODE (arg2) != THROW_EXPR + else if (TREE_CODE (arg2) != THROW_EXPR && TREE_CODE (arg3) == THROW_EXPR) { if (!VOID_TYPE_P (arg2_type)) @@ -3217,7 +3217,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) { conversion *conv2; conversion *conv3; - + /* Get the high-water mark for the CONVERSION_OBSTACK. */ p = conversion_obstack_alloc (0); @@ -3262,7 +3262,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) /* If, after the conversion, both operands have class type, treat the cv-qualification of both operands as if it were the - union of the cv-qualification of the operands. + union of the cv-qualification of the operands. The standard is not clear about what to do in this circumstance. For example, if the first operand has type @@ -3278,7 +3278,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) if ((conv2 || conv3) && CLASS_TYPE_P (arg2_type) && TYPE_QUALS (arg2_type) != TYPE_QUALS (arg3_type)) - arg2_type = arg3_type = + arg2_type = arg3_type = cp_build_qualified_type (arg2_type, TYPE_QUALS (arg2_type) | TYPE_QUALS (arg3_type)); @@ -3288,8 +3288,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) If the second and third operands are lvalues and have the same type, the result is of that type and is an lvalue. */ - if (real_lvalue_p (arg2) - && real_lvalue_p (arg3) + if (real_lvalue_p (arg2) + && real_lvalue_p (arg3) && same_type_p (arg2_type, arg3_type)) { result_type = arg2_type; @@ -3317,8 +3317,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) args[0] = arg2; args[1] = arg3; args[2] = arg1; - add_builtin_candidates (&candidates, - COND_EXPR, + add_builtin_candidates (&candidates, + COND_EXPR, NOP_EXPR, ansi_opname (COND_EXPR), args, @@ -3377,9 +3377,9 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) if (arg2 == error_mark_node || arg3 == error_mark_node) return error_mark_node; - + /* [expr.cond] - + After those conversions, one of the following shall hold: --The second and third operands have the same type; the result is of @@ -3391,15 +3391,15 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) --The second and third operands have arithmetic or enumeration type; the usual arithmetic conversions are performed to bring them to a common type, and the result is of that type. */ - else if ((ARITHMETIC_TYPE_P (arg2_type) + else if ((ARITHMETIC_TYPE_P (arg2_type) || TREE_CODE (arg2_type) == ENUMERAL_TYPE) && (ARITHMETIC_TYPE_P (arg3_type) || TREE_CODE (arg3_type) == ENUMERAL_TYPE)) { /* In this case, there is always a common type. */ - result_type = type_after_usual_arithmetic_conversions (arg2_type, + result_type = type_after_usual_arithmetic_conversions (arg2_type, arg3_type); - + if (TREE_CODE (arg2_type) == ENUMERAL_TYPE && TREE_CODE (arg3_type) == ENUMERAL_TYPE) warning (0, "enumeral mismatch in conditional expression: %qT vs %qT", @@ -3410,7 +3410,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) || (TREE_CODE (arg3_type) == ENUMERAL_TYPE && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) warning (0, "enumeral and non-enumeral type in conditional expression"); - + arg2 = perform_implicit_conversion (result_type, arg2); arg3 = perform_implicit_conversion (result_type, arg3); } @@ -3430,9 +3430,9 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) them to a common type, whose cv-qualification shall match the cv-qualification of either the second or the third operand. The result is of the common type. */ - else if ((null_ptr_cst_p (arg2) + else if ((null_ptr_cst_p (arg2) && (TYPE_PTR_P (arg3_type) || TYPE_PTR_TO_MEMBER_P (arg3_type))) - || (null_ptr_cst_p (arg3) + || (null_ptr_cst_p (arg3) && (TYPE_PTR_P (arg2_type) || TYPE_PTR_TO_MEMBER_P (arg2_type))) || (TYPE_PTR_P (arg2_type) && TYPE_PTR_P (arg3_type)) || (TYPE_PTRMEM_P (arg2_type) && TYPE_PTRMEM_P (arg3_type)) @@ -3453,7 +3453,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) } valid_operands: - result = fold_if_not_in_template (build3 (COND_EXPR, result_type, arg1, + result = fold_if_not_in_template (build3 (COND_EXPR, result_type, arg1, arg2, arg3)); /* We can't use result_type below, as fold might have returned a throw_expr. */ @@ -3463,7 +3463,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) sometimes wrap them in NOP_EXPRs so the test would fail. */ if (!lvalue_p && CLASS_TYPE_P (TREE_TYPE (result))) result = get_target_expr (result); - + /* If this expression is an rvalue, but might be mistaken for an lvalue, we must add a NON_LVALUE_EXPR. */ if (!lvalue_p && real_lvalue_p (result)) @@ -3499,7 +3499,7 @@ prep_operand (tree operand) ACCESS_PATH, and FLAGS are as for add_function_candidate. */ static void -add_candidates (tree fns, tree args, +add_candidates (tree fns, tree args, tree explicit_targs, bool template_only, tree conversion_path, tree access_path, int flags, @@ -3512,7 +3512,7 @@ add_candidates (tree fns, tree args, /* Delay creating the implicit this parameter until it is needed. */ non_static_args = NULL_TREE; - while (fns) + while (fns) { tree fn; tree fn_args; @@ -3534,8 +3534,8 @@ add_candidates (tree fns, tree args, fn_args = args; if (TREE_CODE (fn) == TEMPLATE_DECL) - add_template_candidate (candidates, - fn, + add_template_candidate (candidates, + fn, ctype, explicit_targs, fn_args, @@ -3571,8 +3571,8 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, bool strict_p; bool any_viable_p; - if (error_operand_p (arg1) - || error_operand_p (arg2) + if (error_operand_p (arg1) + || error_operand_p (arg2) || error_operand_p (arg3)) return error_mark_node; @@ -3586,7 +3586,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, fnname = ansi_opname (code); arg1 = prep_operand (arg1); - + switch (code) { case NEW_EXPR: @@ -3605,7 +3605,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, arg2 = prep_operand (arg2); arg3 = prep_operand (arg3); - + if (code == COND_EXPR) { if (arg2 == NULL_TREE @@ -3649,7 +3649,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, goto user_defined_result_ready; } if (fns) - add_candidates (BASELINK_FUNCTIONS (fns), arglist, + add_candidates (BASELINK_FUNCTIONS (fns), arglist, NULL_TREE, false, BASELINK_BINFO (fns), TYPE_BINFO (TREE_TYPE (arg1)), @@ -3691,7 +3691,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, default: strict_p = pedantic; break; - } + } candidates = splice_viable (candidates, strict_p, &any_viable_p); if (!any_viable_p) @@ -3705,12 +3705,12 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, if (flags & LOOKUP_COMPLAIN) pedwarn ("no %<%D(int)%> declared for postfix %qs, " "trying prefix operator instead", - fnname, + fnname, operator_name_info[code].name); if (code == POSTINCREMENT_EXPR) code = PREINCREMENT_EXPR; else - code = PREDECREMENT_EXPR; + code = PREDECREMENT_EXPR; result = build_new_op (code, flags, arg1, NULL_TREE, NULL_TREE, overloaded_p); break; @@ -3771,12 +3771,12 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, case LE_EXPR: case EQ_EXPR: case NE_EXPR: - if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE - && TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE + if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE + && TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE && (TYPE_MAIN_VARIANT (TREE_TYPE (arg1)) != TYPE_MAIN_VARIANT (TREE_TYPE (arg2)))) { - warning (0, "comparison between %q#T and %q#T", + warning (0, "comparison between %q#T and %q#T", TREE_TYPE (arg1), TREE_TYPE (arg2)); } break; @@ -3909,7 +3909,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, fnname = ansi_opname (code); - if (CLASS_TYPE_P (type) + if (CLASS_TYPE_P (type) && COMPLETE_TYPE_P (complete_type (type)) && !global_p) /* In [class.free] @@ -3917,7 +3917,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, If the result of the lookup is ambiguous or inaccessible, or if the lookup selects a placement deallocation function, the program is ill-formed. - + Therefore, we ask lookup_fnfields to complain about ambiguity. */ { fns = lookup_fnfields (TYPE_BINFO (type), fnname, 1); @@ -3959,12 +3959,12 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, the first pass, we look for a one-operator (or placement) operator delete. If we're not doing placement delete, then on the second pass we look for a two-argument delete. */ - for (pass = 0; pass < (placement ? 1 : 2); ++pass) + for (pass = 0; pass < (placement ? 1 : 2); ++pass) { /* Go through the `operator delete' functions looking for one with a matching type. */ - for (fn = BASELINK_P (fns) ? BASELINK_FUNCTIONS (fns) : fns; - fn; + for (fn = BASELINK_P (fns) ? BASELINK_FUNCTIONS (fns) : fns; + fn; fn = OVL_NEXT (fn)) { tree t; @@ -4016,7 +4016,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, if (pass == 0) args = tree_cons (NULL_TREE, addr, args); else - args = tree_cons (NULL_TREE, addr, + args = tree_cons (NULL_TREE, addr, build_tree_list (NULL_TREE, size)); if (placement) @@ -4048,7 +4048,7 @@ bool enforce_access (tree basetype_path, tree decl) { gcc_assert (TREE_CODE (basetype_path) == TREE_BINFO); - + if (!accessible_p (basetype_path, decl, true)) { if (TREE_PRIVATE (decl)) @@ -4072,7 +4072,7 @@ check_constructor_callable (tree type, tree expr) { build_special_member_call (NULL_TREE, complete_ctor_identifier, - build_tree_list (NULL_TREE, expr), + build_tree_list (NULL_TREE, expr), type, LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING | LOOKUP_NO_CONVERSION @@ -4086,15 +4086,15 @@ check_constructor_callable (tree type, tree expr) to NULL. */ static tree -build_temp (tree expr, tree type, int flags, +build_temp (tree expr, tree type, int flags, void (**diagnostic_fn)(const char *, ...)) { int savew, savee; - + savew = warningcount, savee = errorcount; expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, - build_tree_list (NULL_TREE, expr), + build_tree_list (NULL_TREE, expr), type, flags); if (warningcount > savew) *diagnostic_fn = warning0; @@ -4104,7 +4104,7 @@ build_temp (tree expr, tree type, int flags, *diagnostic_fn = NULL; return expr; } - + /* Perform the conversions in CONVS on the expression EXPR. FN and ARGNUM are used for diagnostics. ARGNUM is zero based, -1 @@ -4117,7 +4117,7 @@ build_temp (tree expr, tree type, int flags, conversions to inaccessible bases are permitted. */ static tree -convert_like_real (conversion *convs, tree expr, tree fn, int argnum, +convert_like_real (conversion *convs, tree expr, tree fn, int argnum, int inner, bool issue_conversion_warnings, bool c_cast_p) { @@ -4151,7 +4151,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, pedwarn (" initializing argument %P of %qD", argnum, fn); return cp_convert (totype, expr); } - + if (issue_conversion_warnings) { tree t = non_reference (totype); @@ -4180,7 +4180,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, variable. */ else if (TYPE_UNSIGNED (t) && TREE_CODE (t) != BOOLEAN_TYPE) { - if (TREE_CODE (expr) == INTEGER_CST && TREE_NEGATED_INT (expr)) + if (TREE_CODE (expr) == INTEGER_CST && TREE_NEGATED_INT (expr)) { if (fn) warning (0, "passing negative value %qE for argument %P to %qD", @@ -4188,7 +4188,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, else warning (0, "converting negative value %qE to %qT", expr, t); } - + overflow_warning (expr); } } @@ -4233,23 +4233,23 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, if (IS_AGGR_TYPE (totype) && (inner >= 0 || !lvalue_p (expr))) { - expr = (build_temp - (expr, totype, + expr = (build_temp + (expr, totype, /* Core issue 84, now a DR, says that we don't allow UDCs for these args (which deliberately breaks copy-init of an auto_ptr from an auto_ptr). */ LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING|LOOKUP_NO_CONVERSION, &diagnostic_fn)); - + if (diagnostic_fn) { if (fn) - diagnostic_fn + diagnostic_fn (" initializing argument %P of %qD from result of %qD", argnum, fn, convfn); else - diagnostic_fn + diagnostic_fn (" initializing temporary from result of %qD", convfn); } expr = build_cplus_new (totype, expr); @@ -4343,8 +4343,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, copy constructor, and we'll end up with an infinite loop. If we can use a bitwise copy, then we'll be OK. */ - if ((lvalue & clk_packed) - && CLASS_TYPE_P (type) + if ((lvalue & clk_packed) + && CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)) { error ("cannot bind packed field %qE to %qT", @@ -4363,7 +4363,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, /* Convert it to a pointer to the type referred to by the reference. This will adjust the pointer if a derived to base conversion is being performed. */ - expr = cp_convert (build_pointer_type (TREE_TYPE (ref_type)), + expr = cp_convert (build_pointer_type (TREE_TYPE (ref_type)), expr); /* Convert the pointer to the desired reference type. */ return build_nop (ref_type, expr); @@ -4432,15 +4432,15 @@ convert_arg_to_ellipsis (tree arg) arg = perform_integral_promotions (arg); arg = require_complete_type (arg); - + if (arg != error_mark_node && !pod_type_p (TREE_TYPE (arg))) { /* Undefined behavior [expr.call] 5.2.2/7. We used to just warn here and do a bitwise copy, but now cp_expr_size will abort if we - try to do that. - If the call appears in the context of a sizeof expression, - there is no need to emit a warning, since the expression won't be + try to do that. + If the call appears in the context of a sizeof expression, + there is no need to emit a warning, since the expression won't be evaluated. We keep the builtin_trap just as a safety check. */ if (!skip_evaluation) warning (0, "cannot pass objects of non-POD type %q#T through %<...%>; " @@ -4460,12 +4460,12 @@ build_x_va_arg (tree expr, tree type) { if (processing_template_decl) return build_min (VA_ARG_EXPR, type, expr); - + type = complete_type_or_else (type, NULL_TREE); if (expr == error_mark_node || !type) return error_mark_node; - + if (! pod_type_p (type)) { /* Undefined behavior [expr.call] 5.2.2/7. */ @@ -4477,7 +4477,7 @@ build_x_va_arg (tree expr, tree type) expr = build_indirect_ref (expr, NULL); return expr; } - + return build_va_arg (expr, type); } @@ -4497,7 +4497,7 @@ cxx_type_promotes_to (tree type) promote = type_promotes_to (type); if (same_type_p (type, promote)) promote = type; - + return promote; } @@ -4699,7 +4699,7 @@ build_over_call (struct z_candidate *cand, int flags) parm = TREE_CHAIN (parm); /* We should never try to call the abstract constructor. */ gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (fn)); - + if (DECL_HAS_VTT_PARM_P (fn)) { converted_args = tree_cons @@ -4707,7 +4707,7 @@ build_over_call (struct z_candidate *cand, int flags) arg = TREE_CHAIN (arg); parm = TREE_CHAIN (parm); } - } + } /* Bypass access control for 'this' parameter. */ else if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE) { @@ -4715,7 +4715,7 @@ build_over_call (struct z_candidate *cand, int flags) tree argtype = TREE_TYPE (TREE_VALUE (arg)); tree converted_arg; tree base_binfo; - + if (convs[i]->bad_p) pedwarn ("passing %qT as % argument of %q#D discards qualifiers", TREE_TYPE (argtype), fn); @@ -4734,7 +4734,7 @@ build_over_call (struct z_candidate *cand, int flags) cand->conversion_path, 1); /* Check that the base class is accessible. */ - if (!accessible_base_p (TREE_TYPE (argtype), + if (!accessible_base_p (TREE_TYPE (argtype), BINFO_TYPE (cand->conversion_path), true)) error ("%qT is not an accessible base of %qT", BINFO_TYPE (cand->conversion_path), @@ -4746,7 +4746,7 @@ build_over_call (struct z_candidate *cand, int flags) TREE_TYPE (parmtype), ba_unique, NULL); converted_arg = build_base_path (PLUS_EXPR, converted_arg, base_binfo, 1); - + converted_args = tree_cons (NULL_TREE, converted_arg, converted_args); parm = TREE_CHAIN (parm); arg = TREE_CHAIN (arg); @@ -4769,9 +4769,9 @@ build_over_call (struct z_candidate *cand, int flags) /* Default arguments */ for (; parm && parm != void_list_node; parm = TREE_CHAIN (parm), i++) - converted_args - = tree_cons (NULL_TREE, - convert_default_arg (TREE_VALUE (parm), + converted_args + = tree_cons (NULL_TREE, + convert_default_arg (TREE_VALUE (parm), TREE_PURPOSE (parm), fn, i - is_method), converted_args); @@ -4812,7 +4812,7 @@ build_over_call (struct z_candidate *cand, int flags) if (TREE_CODE (targ) == ADDR_EXPR) { targ = TREE_OPERAND (targ, 0); - if (!same_type_ignoring_top_level_qualifiers_p + if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (TREE_TYPE (arg)), TREE_TYPE (targ))) targ = NULL_TREE; } @@ -4883,7 +4883,7 @@ build_over_call (struct z_candidate *cand, int flags) t = convert (TREE_TYPE (TREE_VALUE (args)), t); val = build_indirect_ref (t, 0); } - + return val; } @@ -4896,7 +4896,7 @@ build_over_call (struct z_candidate *cand, int flags) DECL_CONTEXT (fn), ba_any, NULL); gcc_assert (binfo && binfo != error_mark_node); - + *p = build_base_path (PLUS_EXPR, *p, binfo, 1); if (TREE_SIDE_EFFECTS (*p)) *p = save_expr (*p); @@ -4928,7 +4928,7 @@ build_cxx_call (tree fn, tree args) /* If this call might throw an exception, note that fact. */ fndecl = get_callee_fndecl (fn); - if ((!fndecl || !TREE_NOTHROW (fndecl)) + if ((!fndecl || !TREE_NOTHROW (fndecl)) && at_function_scope_p () && cfun) cp_function_chain->can_throw = 1; @@ -4961,7 +4961,7 @@ build_java_interface_fn_ref (tree fn, tree instance) tree lookup_args, lookup_fn, method, idx; tree klass_ref, iface, iface_ref; int i; - + if (!java_iface_lookup_fn) { tree endlink = build_void_list_node (); @@ -4969,15 +4969,15 @@ build_java_interface_fn_ref (tree fn, tree instance) tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, java_int_type_node, endlink))); - java_iface_lookup_fn + java_iface_lookup_fn = builtin_function ("_Jv_LookupInterfaceMethodIdx", build_function_type (ptr_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); } - /* Look up the pointer to the runtime java.lang.Class object for `instance'. + /* Look up the pointer to the runtime java.lang.Class object for `instance'. This is the first entry in the vtable. */ - klass_ref = build_vtbl_ref (build_indirect_ref (instance, 0), + klass_ref = build_vtbl_ref (build_indirect_ref (instance, 0), integer_zero_node); /* Get the java.lang.Class pointer for the interface being called. */ @@ -4986,13 +4986,13 @@ build_java_interface_fn_ref (tree fn, tree instance) if (!iface_ref || TREE_CODE (iface_ref) != VAR_DECL || DECL_CONTEXT (iface_ref) != iface) { - error ("could not find class$ field in java interface type %qT", + error ("could not find class$ field in java interface type %qT", iface); return error_mark_node; } iface_ref = build_address (iface_ref); iface_ref = convert (build_pointer_type (iface), iface_ref); - + /* Determine the itable index of FN. */ i = 1; for (method = TYPE_METHODS (iface); method; method = TREE_CHAIN (method)) @@ -5005,10 +5005,10 @@ build_java_interface_fn_ref (tree fn, tree instance) } idx = build_int_cst (NULL_TREE, i); - lookup_args = tree_cons (NULL_TREE, klass_ref, + lookup_args = tree_cons (NULL_TREE, klass_ref, tree_cons (NULL_TREE, iface_ref, build_tree_list (NULL_TREE, idx))); - lookup_fn = build1 (ADDR_EXPR, + lookup_fn = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (java_iface_lookup_fn)), java_iface_lookup_fn); return build3 (CALL_EXPR, ptr_type_node, lookup_fn, lookup_args, NULL_TREE); @@ -5016,7 +5016,7 @@ build_java_interface_fn_ref (tree fn, tree instance) /* Returns the value to use for the in-charge parameter when making a call to a function with the indicated NAME. - + FIXME:Can't we find a neater way to do this mapping? */ tree @@ -5051,7 +5051,7 @@ in_charge_arg_for_name (tree name) store the newly constructed object into a VAR_DECL. */ tree -build_special_member_call (tree instance, tree name, tree args, +build_special_member_call (tree instance, tree name, tree args, tree binfo, int flags) { tree fns; @@ -5072,7 +5072,7 @@ build_special_member_call (tree instance, tree name, tree args, binfo = TYPE_BINFO (binfo); } - + gcc_assert (binfo != NULL_TREE); class_type = BINFO_TYPE (binfo); @@ -5085,13 +5085,13 @@ build_special_member_call (tree instance, tree name, tree args, } else { - if (name == complete_dtor_identifier + if (name == complete_dtor_identifier || name == base_dtor_identifier || name == deleting_dtor_identifier) gcc_assert (args == NULL_TREE); /* Convert to the base class, if necessary. */ - if (!same_type_ignoring_top_level_qualifiers_p + if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (instance), BINFO_TYPE (binfo))) { if (name != ansi_assopname (NOP_EXPR)) @@ -5108,11 +5108,11 @@ build_special_member_call (tree instance, tree name, tree args, binfo, /*nonnull=*/1); } } - + gcc_assert (instance != NULL_TREE); fns = lookup_fnfields (binfo, name, 1); - + /* When making a call to a constructor or destructor for a subobject that uses virtual base classes, pass down a pointer to a VTT for the subobject. */ @@ -5140,14 +5140,14 @@ build_special_member_call (tree instance, tree name, tree args, args = tree_cons (NULL_TREE, sub_vtt, args); } - return build_new_method_call (instance, fns, args, - TYPE_BINFO (BINFO_TYPE (binfo)), + return build_new_method_call (instance, fns, args, + TYPE_BINFO (BINFO_TYPE (binfo)), flags); } /* Return the NAME, as a C string. The NAME indicates a function that is a member of TYPE. *FREE_P is set to true if the caller must - free the memory returned. + free the memory returned. Rather than go through all of this, we should simply set the names of constructors and destructors appropriately, and dispense with @@ -5163,7 +5163,7 @@ name_as_c_string (tree name, tree type, bool *free_p) /* Constructors and destructors are special. */ if (IDENTIFIER_CTOR_OR_DTOR_P (name)) { - pretty_name + pretty_name = (char *) IDENTIFIER_POINTER (constructor_name (type)); /* For a destructor, add the '~'. */ if (name == complete_dtor_identifier @@ -5193,7 +5193,7 @@ name_as_c_string (tree name, tree type, bool *free_p) /* Build a call to "INSTANCE.FN (ARGS)". */ tree -build_new_method_call (tree instance, tree fns, tree args, +build_new_method_call (tree instance, tree fns, tree args, tree conversion_path, int flags) { struct z_candidate *candidates = 0, *cand; @@ -5216,7 +5216,7 @@ build_new_method_call (tree instance, tree fns, tree args, gcc_assert (instance != NULL_TREE); - if (error_operand_p (instance) + if (error_operand_p (instance) || error_operand_p (fns) || args == error_mark_node) return error_mark_node; @@ -5322,16 +5322,16 @@ build_new_method_call (tree instance, tree fns, tree args, if (TREE_CODE (t) == TEMPLATE_DECL) /* A member template. */ - add_template_candidate (&candidates, t, + add_template_candidate (&candidates, t, class_type, explicit_targs, this_arglist, optype, - access_binfo, + access_binfo, conversion_path, flags, DEDUCE_CALL); else if (! template_only) - add_function_candidate (&candidates, t, + add_function_candidate (&candidates, t, class_type, this_arglist, access_binfo, @@ -5384,15 +5384,15 @@ build_new_method_call (tree instance, tree fns, tree args, || DECL_DESTRUCTOR_P (current_function_decl))) /* This is not an error, it is runtime undefined behavior. */ - warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ? + warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ? "abstract virtual %q#D called from constructor" : "abstract virtual %q#D called from destructor"), cand->fn); - + if (TREE_CODE (TREE_TYPE (cand->fn)) == METHOD_TYPE && is_dummy_object (instance_ptr)) { - error ("cannot call member function %qD without object", + error ("cannot call member function %qD without object", cand->fn); call = error_mark_node; } @@ -5408,9 +5408,9 @@ build_new_method_call (tree instance, tree fns, tree args, out to be a static member function, `a' is none-the-less evaluated. */ if (TREE_CODE (TREE_TYPE (cand->fn)) != METHOD_TYPE - && !is_dummy_object (instance_ptr) + && !is_dummy_object (instance_ptr) && TREE_SIDE_EFFECTS (instance)) - call = build2 (COMPOUND_EXPR, TREE_TYPE (call), + call = build2 (COMPOUND_EXPR, TREE_TYPE (call), instance, call); } } @@ -5461,7 +5461,7 @@ is_subseq (conversion *ics1, conversion *ics2) if (ics2->kind == ics1->kind && same_type_p (ics2->type, ics1->type) - && same_type_p (ics2->u.next->type, + && same_type_p (ics2->u.next->type, ics1->u.next->type)) return true; } @@ -5495,7 +5495,7 @@ maybe_handle_implicit_object (conversion **ics) if ((*ics)->this_p) { /* [over.match.funcs] - + For non-static member functions, the type of the implicit object parameter is "reference to cv X" where X is the class of which the function is a @@ -5515,7 +5515,7 @@ maybe_handle_implicit_object (conversion **ics) if (t->kind == ck_ptr) t = t->u.next; t = build_identity_conv (TREE_TYPE (t->type), NULL_TREE); - t = direct_reference_binding (reference_type, t); + t = direct_reference_binding (reference_type, t); *ics = t; } } @@ -5582,13 +5582,13 @@ compare_ics (conversion *ics1, conversion *ics2) --a standard conversion sequence (_over.ics.scs_) is a better conversion sequence than a user-defined conversion sequence or an ellipsis conversion sequence, and - + --a user-defined conversion sequence (_over.ics.user_) is a better conversion sequence than an ellipsis conversion sequence (_over.ics.ellipsis_). */ rank1 = CONVERSION_RANK (ics1); rank2 = CONVERSION_RANK (ics2); - + if (rank1 > rank2) return -1; else if (rank1 < rank2) @@ -5644,24 +5644,24 @@ compare_ics (conversion *ics1, conversion *ics2) conversion *t1; conversion *t2; - /* We're dealing with two standard conversion sequences. + /* We're dealing with two standard conversion sequences. [over.ics.rank] - + Standard conversion sequence S1 is a better conversion sequence than standard conversion sequence S2 if - + --S1 is a proper subsequence of S2 (comparing the conversion sequences in the canonical form defined by _over.ics.scs_, excluding any Lvalue Transformation; the identity conversion sequence is considered to be a subsequence of any non-identity conversion sequence */ - + t1 = ics1; while (t1->kind != ck_identity) t1 = t1->u.next; from_type1 = t1->type; - + t2 = ics2; while (t2->kind != ck_identity) t2 = t2->u.next; @@ -5696,7 +5696,7 @@ compare_ics (conversion *ics1, conversion *ics2) --A conversion that is not a conversion of a pointer, or pointer to member, to bool is better than another conversion that is such - a conversion. + a conversion. The ICS_STD_RANK automatically handles the pointer-to-bool rule, so that we do not have to check it explicitly. */ @@ -5739,10 +5739,10 @@ compare_ics (conversion *ics1, conversion *ics2) && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type1)) && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type2))) { - /* This was one of the pointer or pointer-like conversions. + /* This was one of the pointer or pointer-like conversions. [over.ics.rank] - + --If class B is derived directly or indirectly from class A, conversion of B* to A* is better than conversion of B* to void*, and conversion of A* to void* is better than @@ -5781,10 +5781,10 @@ compare_ics (conversion *ics1, conversion *ics2) --If class B is derived directly or indirectly from class A and class C is derived directly or indirectly from B, - + --conversion of C* to B* is better than conversion of C* to - A*, - + A*, + --conversion of B* to A* is better than conversion of C* to A* */ if (same_type_p (deref_from_type1, deref_from_type2)) @@ -5813,7 +5813,7 @@ compare_ics (conversion *ics1, conversion *ics2) tree from = non_reference (from_type1); /* [over.ics.rank] - + --binding of an expression of type C to a reference of type B& is better than binding an expression of type C to a reference of type A& @@ -5837,7 +5837,7 @@ compare_ics (conversion *ics1, conversion *ics2) --binding of an expression of type B to a reference of type A& is better than binding an expression of type C to a - reference of type A&, + reference of type A&, --conversion of B to A is better than conversion of C to A */ if (is_properly_derived_from (from_type1, to) @@ -5862,13 +5862,13 @@ compare_ics (conversion *ics1, conversion *ics2) return comp_cv_qual_signature (to_type1, to_type2); /* [over.ics.rank] - + --S1 and S2 are reference bindings (_dcl.init.ref_), and the types to which the references refer are the same type except for top-level cv-qualifiers, and the type to which the reference initialized by S2 refers is more cv-qualified than the type to which the reference initialized by S1 refers */ - + if (target_type1 && target_type2 && same_type_ignoring_top_level_qualifiers_p (to_type1, to_type2)) return comp_cv_qualification (target_type2, target_type1); @@ -5954,7 +5954,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) int static_2 = DECL_STATIC_FUNCTION_P (cand2->fn); gcc_assert (static_1 != static_2); - + if (static_1) off2 = 1; else @@ -6023,12 +6023,12 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) { struct z_candidate *w, *l; bool give_warning = false; - + if (winner == 1) w = cand1, l = cand2; else w = cand2, l = cand1; - + /* We don't want to complain about `X::operator T1 ()' beating `X::operator T2 () const', when T2 is a no less cv-qualified version of T1. */ @@ -6037,7 +6037,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) { tree t = TREE_TYPE (TREE_TYPE (l->fn)); tree f = TREE_TYPE (TREE_TYPE (w->fn)); - + if (TREE_CODE (t) == TREE_CODE (f) && POINTER_TYPE_P (t)) { t = TREE_TYPE (t); @@ -6048,7 +6048,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) } else give_warning = true; - + if (!give_warning) /*NOP*/; else if (warn) @@ -6071,17 +6071,17 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) /* or, if not that, F1 is a non-template function and F2 is a template function specialization. */ - + if (!cand1->template_decl && cand2->template_decl) return 1; else if (cand1->template_decl && !cand2->template_decl) return -1; - + /* or, if not that, F1 and F2 are template functions and the function template for F1 is more specialized than the template for F2 according to the partial ordering rules. */ - + if (cand1->template_decl && cand2->template_decl) { winner = more_specialized_fn @@ -6116,18 +6116,18 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) if (winner) return winner; } - + /* Check whether we can discard a builtin candidate, either because we have two identical ones or matching builtin and non-builtin candidates. (Pedantically in the latter case the builtin which matched the user function should not be added to the overload set, but we spot it here. - + [over.match.oper] ... the builtin candidates include ... - do not have the same parameter type list as any non-template non-member candidate. */ - + if (TREE_CODE (cand1->fn) == IDENTIFIER_NODE || TREE_CODE (cand2->fn) == IDENTIFIER_NODE) { @@ -6154,7 +6154,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) if (DECL_P (cand1->fn) && DECL_P (cand2->fn) && equal_functions (cand1->fn, cand2->fn)) return 1; - + tweak: /* Extension: If the worst conversion for one candidate is worse than the @@ -6238,8 +6238,8 @@ tourney (struct z_candidate *candidates) /* Make sure the champ is better than all the candidates it hasn't yet been compared to. */ - for (challenger = candidates; - challenger != champ + for (challenger = candidates; + challenger != champ && !(champ_compared_to_predecessor && challenger->next == champ); challenger = challenger->next) { @@ -6341,7 +6341,7 @@ perform_implicit_conversion (tree type, tree expr) cast. */ tree -perform_direct_initialization_if_possible (tree type, +perform_direct_initialization_if_possible (tree type, tree expr, bool c_cast_p) { @@ -6374,7 +6374,7 @@ perform_direct_initialization_if_possible (tree type, if (!conv || conv->bad_p) expr = NULL_TREE; else - expr = convert_like_real (conv, expr, NULL_TREE, 0, 0, + expr = convert_like_real (conv, expr, NULL_TREE, 0, 0, /*issue_conversion_warnings=*/false, c_cast_p); @@ -6389,7 +6389,7 @@ perform_direct_initialization_if_possible (tree type, with the indicated TYPE; this variable will store the value to which the reference is bound. */ -tree +tree make_temporary_var_for_ref_to_temp (tree decl, tree type) { tree var; @@ -6456,7 +6456,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) type, TREE_TYPE (expr)); else error ("invalid initialization of reference of type " - "%qT from expression of type %qT", type, + "%qT from expression of type %qT", type, TREE_TYPE (expr)); return error_mark_node; } @@ -6475,12 +6475,12 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) full-expression in which they are created. In that case, we store the converted expression into a new - VAR_DECL in a new scope. + VAR_DECL in a new scope. However, we want to be careful not to create temporaries when they are not required. For example, given: - struct B {}; + struct B {}; struct D : public B {}; D f(); const B& b = f(); @@ -6580,7 +6580,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) /* Use its address to initialize the reference variable. */ expr = build_address (var); if (base_conv_type) - expr = convert_to_base (expr, + expr = convert_to_base (expr, build_pointer_type (base_conv_type), /*check_access=*/true, /*nonnull=*/true); @@ -6591,7 +6591,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) expr = build_unary_op (ADDR_EXPR, expr, 0); /* If a BASE_CONV was required, perform it now. */ if (base_conv_type) - expr = (perform_implicit_conversion + expr = (perform_implicit_conversion (build_pointer_type (base_conv_type), expr)); expr = build_nop (type, expr); } diff --git a/gcc/cp/class.c b/gcc/cp/class.c index a790b561316..a53cbbc83a9 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -263,7 +263,7 @@ build_base_path (enum tree_code code, && SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), probe)) || (code == PLUS_EXPR && SAME_BINFO_TYPE_P (BINFO_TYPE (d_binfo), probe))); - + if (binfo == d_binfo) /* Nothing to do. */ return expr; @@ -339,10 +339,10 @@ build_base_path (enum tree_code code, else v_offset = build_vfield_ref (build_indirect_ref (expr, NULL), TREE_TYPE (TREE_TYPE (expr))); - + v_offset = build2 (PLUS_EXPR, TREE_TYPE (v_offset), v_offset, BINFO_VPTR_FIELD (v_binfo)); - v_offset = build1 (NOP_EXPR, + v_offset = build1 (NOP_EXPR, build_pointer_type (ptrdiff_type_node), v_offset); v_offset = build_indirect_ref (v_offset, NULL); @@ -350,7 +350,7 @@ build_base_path (enum tree_code code, TREE_INVARIANT (v_offset) = 1; offset = convert_to_integer (ptrdiff_type_node, - size_diffop (offset, + size_diffop (offset, BINFO_OFFSET (v_binfo))); if (!integer_zerop (offset)) @@ -370,20 +370,20 @@ build_base_path (enum tree_code code, } target_type = code == PLUS_EXPR ? BINFO_TYPE (binfo) : BINFO_TYPE (d_binfo); - + target_type = cp_build_qualified_type (target_type, cp_type_quals (TREE_TYPE (TREE_TYPE (expr)))); ptr_target_type = build_pointer_type (target_type); if (want_pointer) target_type = ptr_target_type; - + expr = build1 (NOP_EXPR, ptr_target_type, expr); if (!integer_zerop (offset)) expr = build2 (code, ptr_target_type, expr, offset); else null_test = NULL; - + if (!want_pointer) expr = build_indirect_ref (expr, NULL); @@ -410,9 +410,9 @@ build_simple_base_path (tree expr, tree binfo) if (d_binfo == NULL_TREE) { tree temp; - + gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) == type); - + /* Transform `(a, b).x' into `(*(a, &b)).x', `(a ? b : c).x' into `(*(a ? &b : &c)).x', and so on. A COND_EXPR is only an lvalue in the frontend; only _DECLs and _REFs are lvalues @@ -443,7 +443,7 @@ build_simple_base_path (tree expr, tree binfo) cp_build_qualified_type (type, type_quals), expr, field, NULL_TREE); expr = fold_if_not_in_template (expr); - + /* Mark the expression const or volatile, as appropriate. Even though we've dealt with the type above, we still have to mark the expression itself. */ @@ -451,7 +451,7 @@ build_simple_base_path (tree expr, tree binfo) TREE_READONLY (expr) = 1; if (type_quals & TYPE_QUAL_VOLATILE) TREE_THIS_VOLATILE (expr) = 1; - + return expr; } @@ -481,7 +481,7 @@ convert_to_base (tree object, tree type, bool check_access, bool nonnull) object_type = TREE_TYPE (object); binfo = lookup_base (object_type, type, - check_access ? ba_check : ba_unique, + check_access ? ba_check : ba_unique, NULL); if (!binfo || binfo == error_mark_node) return error_mark_node; @@ -507,7 +507,7 @@ convert_to_base_statically (tree expr, tree base) pointer_type = build_pointer_type (expr_type); expr = build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1); if (!integer_zerop (BINFO_OFFSET (base))) - expr = build2 (PLUS_EXPR, pointer_type, expr, + expr = build2 (PLUS_EXPR, pointer_type, expr, build_nop (pointer_type, BINFO_OFFSET (base))); expr = build_nop (build_pointer_type (BINFO_TYPE (base)), expr); expr = build1 (INDIRECT_REF, BINFO_TYPE (base), expr); @@ -576,7 +576,7 @@ build_vtbl_ref_1 (tree instance, tree idx) if (!vtbl) vtbl = build_vfield_ref (instance, basetype); - + assemble_external (vtbl); aref = build_array_ref (vtbl, idx); @@ -694,10 +694,10 @@ build_vtable (tree class_type, tree name, tree vtable_type) is rather important that such things be ignored because any effort to actually generate DWARF for them will run into trouble when/if we encounter code like: - + #pragma interface struct S { virtual void member (); }; - + because the artificial declaration of the vtable itself (as manufactured by the g++ front end) will say that the vtable is a static member of `S' but only *after* the debug output for @@ -720,14 +720,14 @@ build_vtable (tree class_type, tree name, tree vtable_type) impossible to actually build the vtable, but is useful to get at those which are known to exist in the runtime. */ -tree +tree get_vtable_decl (tree type, int complete) { tree decl; if (CLASSTYPE_VTABLES (type)) return CLASSTYPE_VTABLES (type); - + decl = build_vtable (type, get_vtable_name (type), vtbl_type_node); CLASSTYPE_VTABLES (type) = decl; @@ -753,14 +753,14 @@ build_primary_vtable (tree binfo, tree type) tree virtuals; decl = get_vtable_decl (type, /*complete=*/0); - + if (binfo) { if (BINFO_NEW_VTABLE_MARKED (binfo)) /* We have already created a vtable for this base, so there's no need to do it again. */ return 0; - + virtuals = copy_list (BINFO_VIRTUALS (binfo)); TREE_TYPE (decl) = TREE_TYPE (get_vtbl_decl_for_binfo (binfo)); DECL_SIZE (decl) = TYPE_SIZE (TREE_TYPE (decl)); @@ -810,7 +810,7 @@ build_secondary_vtable (tree binfo) /* Remember that we've created a vtable for this BINFO, so that we don't try to do so again. */ SET_BINFO_NEW_VTABLE_MARKED (binfo); - + /* Make fresh virtual list, so we can smash it later. */ BINFO_VIRTUALS (binfo) = copy_list (BINFO_VIRTUALS (binfo)); @@ -847,9 +847,9 @@ make_new_vtable (tree t, tree binfo) static void modify_vtable_entry (tree t, - tree binfo, - tree fndecl, - tree delta, + tree binfo, + tree fndecl, + tree delta, tree *virtuals) { tree v; @@ -922,7 +922,7 @@ add_method (tree type, tree method, tree using_decl) else if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (method)) { slot = CLASSTYPE_DESTRUCTOR_SLOT; - + if (TYPE_FOR_JAVA (type)) { if (!DECL_ARTIFICIAL (method)) @@ -939,7 +939,7 @@ add_method (tree type, tree method, tree using_decl) insert_p = true; /* See if we already have an entry with this name. */ - for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT; + for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT; VEC_iterate (tree, method_vec, slot, m); ++slot) { @@ -965,7 +965,7 @@ add_method (tree type, tree method, tree using_decl) } } current_fns = insert_p ? NULL_TREE : VEC_index (tree, method_vec, slot); - + if (processing_template_decl) /* TYPE is a template class. Don't issue any errors now; wait until instantiation time to complain. */ @@ -1006,20 +1006,20 @@ add_method (tree type, tree method, tree using_decl) && (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1))) != TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2))))) same = 0; - + /* For templates, the template parms must be identical. */ if (TREE_CODE (fn) == TEMPLATE_DECL && !comp_template_parms (DECL_TEMPLATE_PARMS (fn), DECL_TEMPLATE_PARMS (method))) same = 0; - + if (! DECL_STATIC_FUNCTION_P (fn)) parms1 = TREE_CHAIN (parms1); if (! DECL_STATIC_FUNCTION_P (method)) parms2 = TREE_CHAIN (parms2); - if (same && compparms (parms1, parms2) - && (!DECL_CONV_FN_P (fn) + if (same && compparms (parms1, parms2) + && (!DECL_CONV_FN_P (fn) || same_type_p (TREE_TYPE (TREE_TYPE (fn)), TREE_TYPE (TREE_TYPE (method))))) { @@ -1039,7 +1039,7 @@ add_method (tree type, tree method, tree using_decl) cp_error_at ("%q#D cannot be overloaded", method); cp_error_at ("with %q#D", fn); } - + /* We don't call duplicate_decls here to merge the declarations because that will confuse things if the methods have inline definitions. In particular, we @@ -1049,9 +1049,9 @@ add_method (tree type, tree method, tree using_decl) } } - /* Add the new binding. */ + /* Add the new binding. */ overload = build_overload (method, current_fns); - + if (!conv_p && slot >= CLASSTYPE_FIRST_CONVERSION_SLOT && !complete_p) push_class_level_binding (DECL_NAME (method), overload); @@ -1129,7 +1129,7 @@ handle_using_decl (tree using_decl, tree t) tree old_value; gcc_assert (!processing_template_decl && decl); - + old_value = lookup_member (t, name, /*protect=*/0, /*want_type=*/false); if (old_value) { @@ -1141,9 +1141,9 @@ handle_using_decl (tree using_decl, tree t) else old_value = NULL_TREE; } - + cp_emit_debug_info_for_using (decl, current_class_type); - + if (is_overloaded_fn (decl)) flist = decl; @@ -1168,7 +1168,7 @@ handle_using_decl (tree using_decl, tree t) cp_error_at (" because of local member %q#D with same name", old_value); return; } - + /* Make type T see field decl FDECL with access ACCESS. */ if (flist) for (; flist; flist = OVL_NEXT (flist)) @@ -1202,7 +1202,7 @@ check_bases (tree t, tree basetype = TREE_TYPE (base_binfo); gcc_assert (COMPLETE_TYPE_P (basetype)); - + /* Effective C++ rule 14. We only need to check TYPE_POLYMORPHIC_P here because the case of virtual functions but non-virtual dtor is handled in finish_struct_1. */ @@ -1240,13 +1240,13 @@ check_bases (tree t, /* A lot of properties from the bases also apply to the derived class. */ TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (basetype); - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (basetype); - TYPE_HAS_COMPLEX_ASSIGN_REF (t) + TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (basetype); TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (basetype); TYPE_POLYMORPHIC_P (t) |= TYPE_POLYMORPHIC_P (basetype); - CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) + CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) |= CLASSTYPE_CONTAINS_EMPTY_CLASS_P (basetype); } } @@ -1277,7 +1277,7 @@ determine_primary_bases (tree t) { tree parent = BINFO_INHERITANCE_CHAIN (base_binfo); tree parent_primary = CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (parent)); - + if (parent_primary && SAME_BINFO_TYPE_P (BINFO_TYPE (base_binfo), BINFO_TYPE (parent_primary))) @@ -1296,10 +1296,10 @@ determine_primary_bases (tree t) else { tree delta; - + BINFO_PRIMARY_P (this_primary) = 1; BINFO_INHERITANCE_CHAIN (this_primary) = base_binfo; - + /* A virtual binfo might have been copied from within another hierarchy. As we're about to use it as a primary base, make sure the offsets match. */ @@ -1307,7 +1307,7 @@ determine_primary_bases (tree t) BINFO_OFFSET (base_binfo)), convert (ssizetype, BINFO_OFFSET (this_primary))); - + propagate_binfo_offsets (this_primary, delta); } } @@ -1346,13 +1346,13 @@ determine_primary_bases (tree t) /* Remember the first candidate. */ primary = base_binfo; } - + found: /* If we've got a primary base, use it. */ if (primary) { tree basetype = BINFO_TYPE (primary); - + CLASSTYPE_PRIMARY_BINFO (t) = primary; if (BINFO_PRIMARY_P (primary)) /* We are stealing a primary base. */ @@ -1368,12 +1368,12 @@ determine_primary_bases (tree t) base, make sure the offsets match. */ delta = size_diffop (ssize_int (0), convert (ssizetype, BINFO_OFFSET (primary))); - + propagate_binfo_offsets (primary, delta); } - + primary = TYPE_BINFO (basetype); - + TYPE_VFIELD (t) = TYPE_VFIELD (basetype); BINFO_VTABLE (type_binfo) = BINFO_VTABLE (primary); BINFO_VIRTUALS (type_binfo) = BINFO_VIRTUALS (primary); @@ -1387,7 +1387,7 @@ static void finish_struct_bits (tree t) { tree variants; - + /* Fix up variants (if any). */ for (variants = TYPE_NEXT_VARIANT (t); variants; @@ -1397,11 +1397,11 @@ finish_struct_bits (tree t) the TYPE_LANG_SPECIFIC component, so they are not shared. */ TYPE_HAS_CONSTRUCTOR (variants) = TYPE_HAS_CONSTRUCTOR (t); TYPE_NEEDS_CONSTRUCTING (variants) = TYPE_NEEDS_CONSTRUCTING (t); - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (variants) + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (variants) = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t); TYPE_POLYMORPHIC_P (variants) = TYPE_POLYMORPHIC_P (t); - + TYPE_BINFO (variants) = TYPE_BINFO (t); /* Copy whatever these are holding today. */ @@ -1422,7 +1422,7 @@ finish_struct_bits (tree t) recalculate what's really an abstract virtual at this point (by looking in the vtables). */ get_pure_virtuals (t); - + /* If this type has a copy constructor or a destructor, force its mode to be BLKmode, and force its TREE_ADDRESSABLE bit to be nonzero. This will cause it to be passed by invisible reference @@ -1440,7 +1440,7 @@ finish_struct_bits (tree t) } /* Issue warnings about T having private constructors, but no friends, - and so forth. + and so forth. HAS_NONPRIVATE_METHOD is nonzero if T has any non-private methods or static members. HAS_NONPRIVATE_STATIC_FN is nonzero if T has any @@ -1461,10 +1461,10 @@ maybe_warn_about_overly_private_class (tree t) /* We will have warned when the template was declared; there's no need to warn on every instantiation. */ || CLASSTYPE_TEMPLATE_INSTANTIATION (t)) - /* There's no reason to even consider warning about this + /* There's no reason to even consider warning about this class. */ return; - + /* We only issue one warning, if more than one applies, because otherwise, on code like: @@ -1484,25 +1484,25 @@ maybe_warn_about_overly_private_class (tree t) for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn)) /* We're not interested in compiler-generated methods; they don't provide any way to call private members. */ - if (!DECL_ARTIFICIAL (fn)) + if (!DECL_ARTIFICIAL (fn)) { if (!TREE_PRIVATE (fn)) { - if (DECL_STATIC_FUNCTION_P (fn)) + if (DECL_STATIC_FUNCTION_P (fn)) /* A non-private static member function is just like a friend; it can create and invoke private member functions, and be accessed without a class instance. */ return; - + has_nonprivate_method = 1; /* Keep searching for a static member function. */ } else if (!DECL_CONSTRUCTOR_P (fn) && !DECL_DESTRUCTOR_P (fn)) has_member_fn = 1; - } + } - if (!has_nonprivate_method && has_member_fn) + if (!has_nonprivate_method && has_member_fn) { /* There are no non-private methods, and there's at least one private member function that isn't a constructor or @@ -1512,14 +1512,14 @@ maybe_warn_about_overly_private_class (tree t) constructors/destructors.) */ unsigned i; tree binfo = TYPE_BINFO (t); - + for (i = 0; i != BINFO_N_BASE_BINFOS (binfo); i++) if (BINFO_BASE_ACCESS (binfo, i) != access_private_node) { has_nonprivate_method = 1; break; } - if (!has_nonprivate_method) + if (!has_nonprivate_method) { warning (0, "all member functions in class %qT are private", t); return; @@ -1540,21 +1540,21 @@ maybe_warn_about_overly_private_class (tree t) if (TYPE_HAS_CONSTRUCTOR (t)) { int nonprivate_ctor = 0; - + /* If a non-template class does not define a copy constructor, one is defined for it, enabling it to avoid this warning. For a template class, this does not happen, and so we would normally get a warning on: - template class C { private: C(); }; - + template class C { private: C(); }; + To avoid this asymmetry, we check TYPE_HAS_INIT_REF. All complete non-template or fully instantiated classes have this flag set. */ if (!TYPE_HAS_INIT_REF (t)) nonprivate_ctor = 1; - else - for (fn = CLASSTYPE_CONSTRUCTORS (t); fn; fn = OVL_NEXT (fn)) + else + for (fn = CLASSTYPE_CONSTRUCTORS (t); fn; fn = OVL_NEXT (fn)) { tree ctor = OVL_CURRENT (fn); /* Ideally, we wouldn't count copy constructors (or, in @@ -1591,7 +1591,7 @@ method_name_cmp (const void* m1_p, const void* m2_p) { const tree *const m1 = m1_p; const tree *const m2 = m2_p; - + if (*m1 == NULL_TREE && *m2 == NULL_TREE) return 0; if (*m1 == NULL_TREE) @@ -1630,7 +1630,7 @@ resort_method_name_cmp (const void* m1_p, const void* m2_p) /* Resort TYPE_METHOD_VEC because pointers have been reordered. */ -void +void resort_type_method_vec (void* obj, void* orig_obj ATTRIBUTE_UNUSED , gt_pointer_operator new_value, @@ -1678,7 +1678,7 @@ finish_struct_methods (tree t) len = VEC_length (tree, method_vec); /* Clear DECL_IN_AGGR_P for all functions. */ - for (fn_fields = TYPE_METHODS (t); fn_fields; + for (fn_fields = TYPE_METHODS (t); fn_fields; fn_fields = TREE_CHAIN (fn_fields)) DECL_IN_AGGR_P (fn_fields) = 0; @@ -1708,7 +1708,7 @@ layout_vtable_decl (tree binfo, int n) tree atype; tree vtable; - atype = build_cplus_array_type (vtable_entry_type, + atype = build_cplus_array_type (vtable_entry_type, build_index_type (size_int (n - 1))); layout_type (atype); @@ -1759,7 +1759,7 @@ same_signature_p (tree fndecl, tree base_fndecl) /* Returns TRUE if DERIVED is a binfo containing the binfo BASE as a subobject. */ - + static bool base_derived_from (tree derived, tree base) { @@ -1794,7 +1794,7 @@ typedef struct find_final_overrider_data_s { Returns true if an overrider was found; false otherwise. */ static bool -dfs_find_final_overrider_1 (tree binfo, +dfs_find_final_overrider_1 (tree binfo, find_final_overrider_data *ffod, unsigned depth) { @@ -1814,7 +1814,7 @@ dfs_find_final_overrider_1 (tree binfo, if (method) { tree *candidate = &ffod->candidates; - + /* Remove any candidates overridden by this new function. */ while (*candidate) { @@ -1828,7 +1828,7 @@ dfs_find_final_overrider_1 (tree binfo, else candidate = &TREE_CHAIN (*candidate); } - + /* Add the new function. */ ffod->candidates = tree_cons (method, binfo, ffod->candidates); return true; @@ -1876,7 +1876,7 @@ find_final_overrider (tree derived, tree binfo, tree fn) struct T { virtual void f (); }; struct U : public S, public T { }; - even though calling `f' in `U' is ambiguous. But, + even though calling `f' in `U' is ambiguous. But, struct R { virtual void f(); }; struct S : virtual public R { virtual void f (); }; @@ -1884,8 +1884,8 @@ find_final_overrider (tree derived, tree binfo, tree fn) struct U : public S, public T { }; is not -- there's no way to decide whether to put `S::f' or - `T::f' in the vtable for `R'. - + `T::f' in the vtable for `R'. + The solution is to look at all paths to BINFO. If we find different overriders along any two, then there is a problem. */ if (DECL_THUNK_P (fn)) @@ -1901,11 +1901,11 @@ find_final_overrider (tree derived, tree binfo, tree fn) dfs_find_final_overrider_post, &ffod); VEC_free (tree, heap, ffod.path); - + /* If there was no winner, issue an error message. */ if (!ffod.candidates || TREE_CHAIN (ffod.candidates)) { - error ("no unique final overrider for %qD in %qT", fn, + error ("no unique final overrider for %qD in %qT", fn, BINFO_TYPE (derived)); return error_mark_node; } @@ -1970,11 +1970,11 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, if (overrider == error_mark_node) return; overrider_target = overrider_fn = TREE_PURPOSE (overrider); - + /* Check for adjusting covariant return types. */ over_return = TREE_TYPE (TREE_TYPE (overrider_target)); base_return = TREE_TYPE (TREE_TYPE (target_fn)); - + if (POINTER_TYPE_P (over_return) && TREE_CODE (over_return) == TREE_CODE (base_return) && CLASS_TYPE_P (TREE_TYPE (over_return)) @@ -1988,7 +1988,7 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, over_return = TREE_TYPE (over_return); base_return = TREE_TYPE (base_return); - + if (DECL_THUNK_P (fn)) { gcc_assert (DECL_RESULT_THUNK_P (fn)); @@ -2031,14 +2031,14 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, if (SAME_BINFO_TYPE_P (BINFO_TYPE (thunk_binfo), BINFO_TYPE (base_binfo))) break; - + /* See if virtual inheritance is involved. */ for (virtual_offset = thunk_binfo; virtual_offset; virtual_offset = BINFO_INHERITANCE_CHAIN (virtual_offset)) if (BINFO_VIRTUAL_P (virtual_offset)) break; - + if (virtual_offset || (thunk_binfo && !BINFO_OFFSET_ZEROP (thunk_binfo))) { @@ -2061,7 +2061,7 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, fixed_offset = offset; } } - + if (fixed_offset || virtual_offset) /* Replace the overriding function with a covariant thunk. We will emit the overriding function in its own slot as @@ -2071,7 +2071,7 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, } else gcc_assert (!DECL_THUNK_P (fn)); - + /* Assume that we will produce a thunk that convert all the way to the final overrider, and not to an intermediate virtual base. */ virtual_base = NULL_TREE; @@ -2118,14 +2118,14 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, && (unsigned) list_length (BINFO_VIRTUALS (probe)) > ix) if (BINFO_VIRTUAL_P (probe)) virtual_base = probe; - + if (virtual_base) /* Even if we find a virtual base, the correct delta is between the overrider and the binfo we're building a vtable for. */ goto virtual_covariant; } - + /* Compute the constant adjustment to the `this' pointer. The `this' pointer, when this function is called, will point at BINFO (or one of its primary bases, which are at the same offset). */ @@ -2152,7 +2152,7 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, modify_vtable_entry (t, binfo, overrider_fn, delta, virtuals); if (virtual_base) - BV_VCALL_INDEX (*virtuals) + BV_VCALL_INDEX (*virtuals) = get_vcall_index (overrider_target, BINFO_TYPE (virtual_base)); else BV_VCALL_INDEX (*virtuals) = NULL_TREE; @@ -2172,7 +2172,7 @@ dfs_modify_vtables (tree binfo, void* data) /* A base without a vtable needs no modification, and its bases are uninteresting. */ return dfs_skip_bases; - + if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), t) && !CLASSTYPE_HAS_PRIMARY_BASE_P (t)) /* Don't do the primary vtable, if it's new. */ @@ -2186,7 +2186,7 @@ dfs_modify_vtables (tree binfo, void* data) return NULL_TREE; make_new_vtable (t, binfo); - + /* Now, go through each of the virtual functions in the virtual function table for BINFO. Find the final overrider, and update the BINFO_VIRTUALS list appropriately. */ @@ -2195,8 +2195,8 @@ dfs_modify_vtables (tree binfo, void* data) virtuals; ix++, virtuals = TREE_CHAIN (virtuals), old_virtuals = TREE_CHAIN (old_virtuals)) - update_vtable_entry_for_fn (t, - binfo, + update_vtable_entry_for_fn (t, + binfo, BV_FN (old_virtuals), &virtuals, ix); @@ -2328,7 +2328,7 @@ warn_hidden (tree t) size_t i; /* We go through each separately named virtual function. */ - for (i = CLASSTYPE_FIRST_CONVERSION_SLOT; + for (i = CLASSTYPE_FIRST_CONVERSION_SLOT; VEC_iterate (tree, method_vec, i, fns); ++i) { @@ -2366,8 +2366,8 @@ warn_hidden (tree t) if (DECL_VINDEX (fndecl)) { tree *prev = &base_fndecls; - - while (*prev) + + while (*prev) /* If the method from the base class has the same signature as the method from the derived class, it has been overridden. */ @@ -2380,7 +2380,7 @@ warn_hidden (tree t) /* Now give a warning for all base functions without overriders, as they are hidden. */ - while (base_fndecls) + while (base_fndecls) { /* Here we know it is a hider, and no overrider exists. */ cp_warning_at ("%qD was hidden", TREE_VALUE (base_fndecls)); @@ -2418,7 +2418,7 @@ finish_struct_anon (tree t) though, so we explicitly tolerate that. We use TYPE_ANONYMOUS_P rather than ANON_AGGR_TYPE_P so that we also allow unnamed types used for defining fields. */ - if (DECL_ARTIFICIAL (elt) + if (DECL_ARTIFICIAL (elt) && (!DECL_IMPLICIT_TYPEDEF_P (elt) || TYPE_ANONYMOUS_P (TREE_TYPE (elt)))) continue; @@ -2449,7 +2449,7 @@ finish_struct_anon (tree t) will be used later during class template instantiation. When FRIEND_P is zero, T can be a static member data (VAR_DECL), a non-static member data (FIELD_DECL), a member function - (FUNCTION_DECL), a nested type (RECORD_TYPE, ENUM_TYPE), + (FUNCTION_DECL), a nested type (RECORD_TYPE, ENUM_TYPE), a typedef (TYPE_DECL) or a member class template (TEMPLATE_DECL) When FRIEND_P is nonzero, T is either a friend class (RECORD_TYPE, TEMPLATE_DECL) or a friend function @@ -2473,7 +2473,7 @@ maybe_add_class_template_decl_list (tree type, tree t, int friend_p) a const reference, respectively. */ static void -add_implicitly_declared_members (tree t, +add_implicitly_declared_members (tree t, int cant_have_const_cctor, int cant_have_const_assignment) { @@ -2519,7 +2519,7 @@ add_implicitly_declared_members (tree t, } /* If we can't get away with being lazy, generate the destructor - now. */ + now. */ if (!lazy_p) lazily_declare_fn (sfk_destructor, t); } @@ -2648,7 +2648,7 @@ check_bitfield_decl (tree field) cp_warning_at ("%qD is too small to hold all values of %q#T", field, type); } - + /* Remove the bit-field width indicator so that the rest of the compiler does not treat that value as an initializer. */ DECL_INITIAL (field) = NULL_TREE; @@ -2701,7 +2701,7 @@ check_field_decl (tree field, /* Never let anything with uninheritable virtuals make it through without complaint. */ abstract_virtuals_error (field, type); - + if (TREE_CODE (t) == UNION_TYPE) { if (TYPE_NEEDS_CONSTRUCTING (type)) @@ -2717,7 +2717,7 @@ check_field_decl (tree field, else { TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (type); - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type); TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (type); TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (type); @@ -2816,7 +2816,7 @@ check_field_decls (tree t, tree *access_decls, /* If one of the data members contains an empty class, so does T. */ element_type = strip_array_types (type); - if (CLASS_TYPE_P (element_type) + if (CLASS_TYPE_P (element_type) && CLASSTYPE_CONTAINS_EMPTY_CLASS_P (element_type)) CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) = 1; } @@ -2888,7 +2888,7 @@ check_field_decls (tree t, tree *access_decls, if (type == error_mark_node) continue; - + if (TREE_CODE (x) == CONST_DECL || TREE_CODE (x) == VAR_DECL) continue; @@ -3000,7 +3000,7 @@ check_field_decls (tree t, tree *access_decls, -- Warn only if there is a non-trivial destructor. We assume that the user at least implemented the cleanup correctly, and a destructor is needed to free dynamic memory. - + This seems enough for practical purposes. */ if (warn_ecpp && has_pointers @@ -3009,7 +3009,7 @@ check_field_decls (tree t, tree *access_decls, && !(TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t))) { warning (0, "%q#T has pointer data members", t); - + if (! TYPE_HAS_INIT_REF (t)) { warning (0, " but does not override %<%T(const %T&)%>", t, t); @@ -3043,10 +3043,10 @@ record_subobject_offset (tree type, tree offset, splay_tree offsets) /* Record the location of this empty object in OFFSETS. */ n = splay_tree_lookup (offsets, (splay_tree_key) offset); if (!n) - n = splay_tree_insert (offsets, + n = splay_tree_insert (offsets, (splay_tree_key) offset, (splay_tree_value) NULL_TREE); - n->value = ((splay_tree_value) + n->value = ((splay_tree_value) tree_cons (NULL_TREE, type, (tree) n->value)); @@ -3090,11 +3090,11 @@ check_subobject_offset (tree type, tree offset, splay_tree offsets) is returned. Otherwise, returns zero. */ static int -walk_subobject_offsets (tree type, - subobject_offset_fn f, - tree offset, - splay_tree offsets, - tree max_offset, +walk_subobject_offsets (tree type, + subobject_offset_fn f, + tree offset, + splay_tree offsets, + tree max_offset, int vbases_p) { int r = 0; @@ -3105,7 +3105,7 @@ walk_subobject_offsets (tree type, if (max_offset && INT_CST_LT (max_offset, offset)) return 0; - if (!TYPE_P (type)) + if (!TYPE_P (type)) { if (abi_version_at_least (2)) type_binfo = type; @@ -3134,12 +3134,12 @@ walk_subobject_offsets (tree type, { tree binfo_offset; - if (abi_version_at_least (2) + if (abi_version_at_least (2) && BINFO_VIRTUAL_P (binfo)) continue; - if (!vbases_p - && BINFO_VIRTUAL_P (binfo) + if (!vbases_p + && BINFO_VIRTUAL_P (binfo) && !BINFO_PRIMARY_P (binfo)) continue; @@ -3154,7 +3154,7 @@ walk_subobject_offsets (tree type, class yet, but the offsets for direct non-virtual bases can be calculated by going back to the TYPE. */ orig_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), i); - binfo_offset = size_binop (PLUS_EXPR, + binfo_offset = size_binop (PLUS_EXPR, offset, BINFO_OFFSET (orig_binfo)); } @@ -3164,7 +3164,7 @@ walk_subobject_offsets (tree type, binfo_offset, offsets, max_offset, - (abi_version_at_least (2) + (abi_version_at_least (2) ? /*vbases_p=*/0 : vbases_p)); if (r) return r; @@ -3201,12 +3201,12 @@ walk_subobject_offsets (tree type, virtual. (If it is non-virtual, then it was walked above.) */ tree vbase = get_primary_binfo (type_binfo); - + if (vbase && BINFO_VIRTUAL_P (vbase) && BINFO_PRIMARY_P (vbase) && BINFO_INHERITANCE_CHAIN (vbase) == type_binfo) { - r = (walk_subobject_offsets + r = (walk_subobject_offsets (vbase, f, offset, offsets, max_offset, /*vbases_p=*/0)); if (r) @@ -3253,7 +3253,7 @@ walk_subobject_offsets (tree type, /* Step through each of the elements in the array. */ for (index = size_zero_node; /* G++ 3.2 had an off-by-one error here. */ - (abi_version_at_least (2) + (abi_version_at_least (2) ? !INT_CST_LT (TYPE_MAX_VALUE (domain), index) : INT_CST_LT (index, TYPE_MAX_VALUE (domain))); index = size_binop (PLUS_EXPR, index, size_one_node)) @@ -3266,7 +3266,7 @@ walk_subobject_offsets (tree type, /*vbases_p=*/1); if (r) return r; - offset = size_binop (PLUS_EXPR, offset, + offset = size_binop (PLUS_EXPR, offset, TYPE_SIZE_UNIT (TREE_TYPE (type))); /* If this new OFFSET is bigger than the MAX_OFFSET, then there's no point in iterating through the remaining @@ -3284,9 +3284,9 @@ walk_subobject_offsets (tree type, examined. */ static void -record_subobject_offsets (tree type, - tree offset, - splay_tree offsets, +record_subobject_offsets (tree type, + tree offset, + splay_tree offsets, int vbases_p) { walk_subobject_offsets (type, record_subobject_offset, offset, @@ -3299,8 +3299,8 @@ record_subobject_offsets (tree type, static int layout_conflict_p (tree type, - tree offset, - splay_tree offsets, + tree offset, + splay_tree offsets, int vbases_p) { splay_tree_node max_node; @@ -3325,15 +3325,15 @@ layout_conflict_p (tree type, the position of the DECL. */ static void -layout_nonempty_base_or_field (record_layout_info rli, - tree decl, - tree binfo, +layout_nonempty_base_or_field (record_layout_info rli, + tree decl, + tree binfo, splay_tree offsets) { tree offset = NULL_TREE; bool field_p; tree type; - + if (binfo) { /* For the purposes of determining layout conflicts, we want to @@ -3363,11 +3363,11 @@ layout_nonempty_base_or_field (record_layout_info rli, /* We have to check to see whether or not there is already something of the same type at the offset we're about to use. For example, consider: - + struct S {}; struct T : public S { int i; }; struct U : public S, public T {}; - + Here, we put S at offset zero in U. Then, we can't put T at offset zero -- its S component would be at the same address as the S we already allocated. So, we have to skip ahead. @@ -3383,7 +3383,7 @@ layout_nonempty_base_or_field (record_layout_info rli, virtual base. */ if (!abi_version_at_least (2) && binfo && BINFO_VIRTUAL_P (binfo)) break; - if (layout_conflict_p (field_p ? type : binfo, offset, + if (layout_conflict_p (field_p ? type : binfo, offset, offsets, field_p)) { /* Strip off the size allocated to this field. That puts us @@ -3393,8 +3393,8 @@ layout_nonempty_base_or_field (record_layout_info rli, /* Bump up by the alignment required for the type. */ rli->bitpos - = size_binop (PLUS_EXPR, rli->bitpos, - bitsize_int (binfo + = size_binop (PLUS_EXPR, rli->bitpos, + bitsize_int (binfo ? CLASSTYPE_ALIGN (type) : TYPE_ALIGN (type))); normalize_rli (rli); @@ -3411,9 +3411,9 @@ layout_nonempty_base_or_field (record_layout_info rli, this point because their BINFO_OFFSET is copied from another hierarchy. Therefore, we may not need to add the entire OFFSET. */ - propagate_binfo_offsets (binfo, + propagate_binfo_offsets (binfo, size_diffop (convert (ssizetype, offset), - convert (ssizetype, + convert (ssizetype, BINFO_OFFSET (binfo)))); } @@ -3454,22 +3454,22 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets) "change in a future version of GCC", BINFO_TYPE (binfo)); } - + /* This is an empty base class. We first try to put it at offset zero. */ if (layout_conflict_p (binfo, BINFO_OFFSET (binfo), - offsets, + offsets, /*vbases_p=*/0)) { /* That didn't work. Now, we move forward from the next available spot in the class. */ atend = true; propagate_binfo_offsets (binfo, convert (ssizetype, eoc)); - while (1) + while (1) { if (!layout_conflict_p (binfo, - BINFO_OFFSET (binfo), + BINFO_OFFSET (binfo), offsets, /*vbases_p=*/0)) /* We finally found a spot where there's no overlap. */ @@ -3487,7 +3487,7 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets) any base class. OFFSETS gives the location of empty base subobjects. T is the most derived type. Return nonzero if the new object cannot be nearly-empty. A new FIELD_DECL is inserted at - *NEXT_FIELD, unless BINFO is for an empty base class. + *NEXT_FIELD, unless BINFO is for an empty base class. Returns the location at which the next field should be inserted. */ @@ -3502,7 +3502,7 @@ build_base_field (record_layout_info rli, tree binfo, /* This error is now reported in xref_tag, thus giving better location information. */ return next_field; - + /* Place the base class. */ if (!is_empty_class (basetype)) { @@ -3511,7 +3511,7 @@ build_base_field (record_layout_info rli, tree binfo, /* The containing class is non-empty because it has a non-empty base class. */ CLASSTYPE_EMPTY_P (t) = 0; - + /* Create the FIELD_DECL. */ decl = build_decl (FIELD_DECL, NULL_TREE, CLASSTYPE_AS_BASE (basetype)); DECL_ARTIFICIAL (decl) = 1; @@ -3552,7 +3552,7 @@ build_base_field (record_layout_info rli, tree binfo, /* The check above (used in G++ 3.2) is insufficient because an empty class placed at offset zero might itself have an empty base at a nonzero offset. */ - else if (walk_subobject_offsets (basetype, + else if (walk_subobject_offsets (basetype, empty_base_at_nonzero_offset_p, size_zero_node, /*offsets=*/NULL, @@ -3566,7 +3566,7 @@ build_base_field (record_layout_info rli, tree binfo, "future version of GCC", t); } } - + /* We do not create a FIELD_DECL for empty base classes because it might overlap some other field. We want to be able to create CONSTRUCTORs for the class by iterating over the @@ -3582,7 +3582,7 @@ build_base_field (record_layout_info rli, tree binfo, /* Record the offsets of BINFO and its base subobjects. */ record_subobject_offsets (binfo, BINFO_OFFSET (binfo), - offsets, + offsets, /*vbases_p=*/0); return next_field; @@ -3712,14 +3712,14 @@ build_clone (tree fn, tree name) parmtypes = TREE_CHAIN (parmtypes); /* If this is subobject constructor or destructor, add the vtt parameter. */ - TREE_TYPE (clone) + TREE_TYPE (clone) = build_method_type_directly (basetype, TREE_TYPE (TREE_TYPE (clone)), parmtypes); if (exceptions) TREE_TYPE (clone) = build_exception_variant (TREE_TYPE (clone), exceptions); - TREE_TYPE (clone) + TREE_TYPE (clone) = cp_build_type_attribute_variant (TREE_TYPE (clone), TYPE_ATTRIBUTES (TREE_TYPE (fn))); } @@ -3759,7 +3759,7 @@ build_clone (tree fn, tree name) /* Create the RTL for this function. */ SET_DECL_RTL (clone, NULL_RTX); rest_of_decl_compilation (clone, /*top_level=*/1, at_eof); - + /* Make it easy to find the CLONE given the FN. */ TREE_CHAIN (clone) = TREE_CHAIN (fn); TREE_CHAIN (fn) = clone; @@ -3769,7 +3769,7 @@ build_clone (tree fn, tree name) { tree result; - DECL_TEMPLATE_RESULT (clone) + DECL_TEMPLATE_RESULT (clone) = build_clone (DECL_TEMPLATE_RESULT (clone), name); result = DECL_TEMPLATE_RESULT (clone); DECL_TEMPLATE_INFO (result) = copy_node (DECL_TEMPLATE_INFO (result)); @@ -3815,7 +3815,7 @@ clone_function_decl (tree fn, int update_method_vec_p) version. We clone the deleting version first because that means it will go second on the TYPE_METHODS list -- and that corresponds to the correct layout order in the virtual - function table. + function table. For a non-virtual destructor, we do not build a deleting destructor. */ @@ -3848,7 +3848,7 @@ void adjust_clone_args (tree decl) { tree clone; - + for (clone = TREE_CHAIN (decl); clone && DECL_CLONED_FUNCTION (clone); clone = TREE_CHAIN (clone)) { @@ -3857,7 +3857,7 @@ adjust_clone_args (tree decl) tree decl_parms, clone_parms; clone_parms = orig_clone_parms; - + /* Skip the 'this' parameter. */ orig_clone_parms = TREE_CHAIN (orig_clone_parms); orig_decl_parms = TREE_CHAIN (orig_decl_parms); @@ -3866,18 +3866,18 @@ adjust_clone_args (tree decl) orig_decl_parms = TREE_CHAIN (orig_decl_parms); if (DECL_HAS_VTT_PARM_P (decl)) orig_decl_parms = TREE_CHAIN (orig_decl_parms); - + clone_parms = orig_clone_parms; if (DECL_HAS_VTT_PARM_P (clone)) clone_parms = TREE_CHAIN (clone_parms); - + for (decl_parms = orig_decl_parms; decl_parms; decl_parms = TREE_CHAIN (decl_parms), clone_parms = TREE_CHAIN (clone_parms)) { gcc_assert (same_type_p (TREE_TYPE (decl_parms), TREE_TYPE (clone_parms))); - + if (TREE_PURPOSE (decl_parms) && !TREE_PURPOSE (clone_parms)) { /* A default parameter has been added. Adjust the @@ -3901,7 +3901,7 @@ adjust_clone_args (tree decl) if (exceptions) type = build_exception_variant (type, exceptions); TREE_TYPE (clone) = type; - + clone_parms = NULL_TREE; break; } @@ -3936,11 +3936,11 @@ remove_zero_width_bit_fields (tree t) { tree *fieldsp; - fieldsp = &TYPE_FIELDS (t); + fieldsp = &TYPE_FIELDS (t); while (*fieldsp) { if (TREE_CODE (*fieldsp) == FIELD_DECL - && DECL_C_BIT_FIELD (*fieldsp) + && DECL_C_BIT_FIELD (*fieldsp) && DECL_INITIAL (*fieldsp)) *fieldsp = TREE_CHAIN (*fieldsp); else @@ -3969,7 +3969,7 @@ type_requires_array_cookie (tree type) argument is of type `size_t', then we have to pass the size of the array to the deallocation function, so we will need to store a cookie. */ - fns = lookup_fnfields (TYPE_BINFO (type), + fns = lookup_fnfields (TYPE_BINFO (type), ansi_opname (VEC_DELETE_EXPR), /*protect=*/0); /* If there are no `operator []' members, or the lookup is @@ -4051,7 +4051,7 @@ check_bases_and_members (tree t) CLASSTYPE_NON_AGGREGATE (t) |= (TYPE_HAS_CONSTRUCTOR (t) || TYPE_POLYMORPHIC_P (t)); CLASSTYPE_NON_POD_P (t) - |= (CLASSTYPE_NON_AGGREGATE (t) + |= (CLASSTYPE_NON_AGGREGATE (t) || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) || TYPE_HAS_ASSIGN_REF (t)); TYPE_HAS_COMPLEX_ASSIGN_REF (t) @@ -4097,7 +4097,7 @@ create_vtable_ptr (tree t, tree* virtuals_p) && TREE_CODE (DECL_VINDEX (fn)) != INTEGER_CST) { tree new_virtual = make_node (TREE_LIST); - + BV_FN (new_virtual) = fn; BV_DELTA (new_virtual) = integer_zero_node; BV_VCALL_INDEX (new_virtual) = NULL_TREE; @@ -4105,7 +4105,7 @@ create_vtable_ptr (tree t, tree* virtuals_p) TREE_CHAIN (new_virtual) = *virtuals_p; *virtuals_p = new_virtual; } - + /* If we couldn't find an appropriate base class, create a new field here. Even if there weren't any new virtual functions, we might need a new virtual function table if we're supposed to include vptrs in @@ -4124,7 +4124,7 @@ create_vtable_ptr (tree t, tree* virtuals_p) the derived class vtable pointer, since they have different types. Thus, in a derived class destructor, where the base class constructor was inlined, we could generate bad code for - setting up the vtable pointer. + setting up the vtable pointer. Therefore, we use one type for all vtable pointers. We still use a type-correct type; it's just doesn't indicate the array @@ -4139,9 +4139,9 @@ create_vtable_ptr (tree t, tree* virtuals_p) DECL_ARTIFICIAL (field) = 1; DECL_FIELD_CONTEXT (field) = t; DECL_FCONTEXT (field) = t; - + TYPE_VFIELD (t) = field; - + /* This class is non-empty. */ CLASSTYPE_EMPTY_P (t) = 0; @@ -4213,7 +4213,7 @@ propagate_binfo_offsets (tree binfo, tree offset) /* Update BINFO's offset. */ BINFO_OFFSET (binfo) - = convert (sizetype, + = convert (sizetype, size_binop (PLUS_EXPR, convert (ssizetype, BINFO_OFFSET (binfo)), offset)); @@ -4223,7 +4223,7 @@ propagate_binfo_offsets (tree binfo, tree offset) if (primary_binfo && BINFO_INHERITANCE_CHAIN (primary_binfo) == binfo) propagate_binfo_offsets (primary_binfo, offset); - + /* Scan all of the bases, pushing the BINFO_OFFSET adjust downwards. */ for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) @@ -4301,7 +4301,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets) the results which is not particularly tractable. */ if (warn_abi && first_vbase - && (tree_int_cst_lt + && (tree_int_cst_lt (size_binop (CEIL_DIV_EXPR, round_up (CLASSTYPE_SIZE (t), CLASSTYPE_ALIGN (basetype)), @@ -4398,7 +4398,7 @@ warn_about_ambiguous_bases (tree t) /* If there are no repeated bases, nothing can be ambiguous. */ if (!CLASSTYPE_REPEATED_BASE_P (t)) return; - + /* Check direct bases. */ for (binfo = TYPE_BINFO (t), i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) @@ -4416,7 +4416,7 @@ warn_about_ambiguous_bases (tree t) VEC_iterate (tree, vbases, i, binfo); i++) { basetype = BINFO_TYPE (binfo); - + if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL)) warning (0, "virtual base %qT inaccessible in %qT due to ambiguity", basetype, t); @@ -4445,7 +4445,7 @@ include_empty_classes (record_layout_info rli) because we are willing to overlay multiple bases at the same offset. However, now we need to make sure that RLI is big enough to reflect the entire class. */ - eoc = end_of_class (rli->t, + eoc = end_of_class (rli->t, CLASSTYPE_AS_BASE (rli->t) != NULL_TREE); rli_size = rli_size_unit_so_far (rli); if (TREE_CODE (rli_size) == INTEGER_CST @@ -4462,8 +4462,8 @@ include_empty_classes (record_layout_info rli) /* The size should have been rounded to a whole byte. */ gcc_assert (tree_int_cst_equal (rli->bitpos, round_down (rli->bitpos, BITS_PER_UNIT))); - rli->bitpos - = size_binop (PLUS_EXPR, + rli->bitpos + = size_binop (PLUS_EXPR, rli->bitpos, size_binop (MULT_EXPR, convert (bitsizetype, @@ -4519,10 +4519,10 @@ layout_class_type (tree t, tree *virtuals_p) next_field = &TYPE_FIELDS (t); /* Build FIELD_DECLs for all of the non-virtual base-types. */ - empty_base_offsets = splay_tree_new (splay_tree_compare_integer_csts, + empty_base_offsets = splay_tree_new (splay_tree_compare_integer_csts, NULL, NULL); build_base_fields (rli, empty_base_offsets, next_field); - + /* Layout the non-static data members. */ for (field = non_static_data_members; field; field = TREE_CHAIN (field)) { @@ -4535,13 +4535,13 @@ layout_class_type (tree t, tree *virtuals_p) { place_field (rli, field); /* If the static data member has incomplete type, keep track - of it so that it can be completed later. (The handling + of it so that it can be completed later. (The handling of pending statics in finish_record_layout is insufficient; consider: struct S1; struct S2 { static S1 s1; }; - + At this point, finish_record_layout will be called, but S1 is still incomplete.) */ if (TREE_CODE (field) == VAR_DECL) @@ -4556,7 +4556,7 @@ layout_class_type (tree t, tree *virtuals_p) } type = TREE_TYPE (field); - + padding = NULL_TREE; /* If this field is a bit-field whose width is greater than its @@ -4573,7 +4573,7 @@ layout_class_type (tree t, tree *virtuals_p) of the field. Then, we are supposed to use the left over bits as additional padding. */ for (itk = itk_char; itk != itk_none; ++itk) - if (INT_CST_LT (DECL_SIZE (field), + if (INT_CST_LT (DECL_SIZE (field), TYPE_SIZE (integer_types[itk]))) break; @@ -4597,7 +4597,7 @@ layout_class_type (tree t, tree *virtuals_p) if (warn_abi && TREE_CODE (t) == UNION_TYPE) warning (0, "size assigned to %qT may not be " "ABI-compliant and may change in a future " - "version of GCC", + "version of GCC", t); padding = size_binop (MINUS_EXPR, DECL_SIZE (field), TYPE_SIZE (integer_type)); @@ -4643,7 +4643,7 @@ layout_class_type (tree t, tree *virtuals_p) /* Remember the location of any empty classes in FIELD. */ if (abi_version_at_least (2)) - record_subobject_offsets (TREE_TYPE (field), + record_subobject_offsets (TREE_TYPE (field), byte_position(field), empty_base_offsets, /*vbases_p=*/1); @@ -4652,7 +4652,7 @@ layout_class_type (tree t, tree *virtuals_p) and yet it starts in the middle of a byte, we have failed to comply with the ABI. */ if (warn_abi - && DECL_C_BIT_FIELD (field) + && DECL_C_BIT_FIELD (field) /* The TREE_NO_WARNING flag gets set by Objective-C when laying out an Objective-C class. The ObjC ABI differs from the C++ ABI, and so we do not want a warning @@ -4663,12 +4663,12 @@ layout_class_type (tree t, tree *virtuals_p) DECL_FIELD_BIT_OFFSET (field), bitsize_unit_node))) cp_warning_at ("offset of %qD is not ABI-compliant and may " - "change in a future version of GCC", + "change in a future version of GCC", field); /* G++ used to use DECL_FIELD_OFFSET as if it were the byte offset of the field. */ - if (warn_abi + if (warn_abi && !tree_int_cst_equal (DECL_FIELD_OFFSET (field), byte_position (field)) && contains_empty_class_p (TREE_TYPE (field))) @@ -4683,16 +4683,16 @@ layout_class_type (tree t, tree *virtuals_p) { tree padding_field; - padding_field = build_decl (FIELD_DECL, + padding_field = build_decl (FIELD_DECL, NULL_TREE, - char_type_node); + char_type_node); DECL_BIT_FIELD (padding_field) = 1; DECL_SIZE (padding_field) = padding; DECL_CONTEXT (padding_field) = t; DECL_ARTIFICIAL (padding_field) = 1; DECL_IGNORED_P (padding_field) = 1; layout_nonempty_base_or_field (rli, padding_field, - NULL_TREE, + NULL_TREE, empty_base_offsets); } @@ -4723,7 +4723,7 @@ layout_class_type (tree t, tree *virtuals_p) if (CLASSTYPE_NON_POD_P (t) || CLASSTYPE_EMPTY_P (t)) { base_t = make_node (TREE_CODE (t)); - + /* Set the size and alignment for the new type. In G++ 3.2, all empty classes were considered to have size zero when used as base classes. */ @@ -4748,14 +4748,14 @@ layout_class_type (tree t, tree *virtuals_p) rli_size_so_far, rather than rli_size_unit_so_far, is used to compute TYPE_SIZE_UNIT. */ eoc = end_of_class (t, /*include_virtuals_p=*/0); - TYPE_SIZE_UNIT (base_t) + TYPE_SIZE_UNIT (base_t) = size_binop (MAX_EXPR, convert (sizetype, size_binop (CEIL_DIV_EXPR, rli_size_so_far (rli), bitsize_int (BITS_PER_UNIT))), eoc); - TYPE_SIZE (base_t) + TYPE_SIZE (base_t) = size_binop (MAX_EXPR, rli_size_so_far (rli), size_binop (MULT_EXPR, @@ -4771,7 +4771,7 @@ layout_class_type (tree t, tree *virtuals_p) if (TREE_CODE (field) == FIELD_DECL) { *next_field = build_decl (FIELD_DECL, - DECL_NAME (field), + DECL_NAME (field), TREE_TYPE (field)); DECL_CONTEXT (*next_field) = base_t; DECL_FIELD_OFFSET (*next_field) = DECL_FIELD_OFFSET (field); @@ -4804,13 +4804,13 @@ layout_class_type (tree t, tree *virtuals_p) base subobject fields. */ layout_virtual_bases (rli, empty_base_offsets); - /* Make sure that empty classes are reflected in RLI at this + /* Make sure that empty classes are reflected in RLI at this point. */ include_empty_classes(rli); /* Make sure not to create any structures with zero size. */ if (integer_zerop (rli_size_unit_so_far (rli)) && CLASSTYPE_EMPTY_P (t)) - place_field (rli, + place_field (rli, build_decl (FIELD_DECL, NULL_TREE, char_type_node)); /* Let the back-end lay out the type. */ @@ -4884,7 +4884,7 @@ finish_struct_1 (tree t) CLASSTYPE_PRIMARY_BINFO (t) = NULL_TREE; fixup_inline_methods (t); - + /* Make assumptions about the class; we'll reset the flags if necessary. */ CLASSTYPE_EMPTY_P (t) = 1; @@ -4951,9 +4951,9 @@ finish_struct_1 (tree t) = chainon (BINFO_VIRTUALS (TYPE_BINFO (t)), virtuals); /* Set DECL_VINDEX for all functions declared in this class. */ - for (vindex = 0, fn = BINFO_VIRTUALS (TYPE_BINFO (t)); - fn; - fn = TREE_CHAIN (fn), + for (vindex = 0, fn = BINFO_VIRTUALS (TYPE_BINFO (t)); + fn; + fn = TREE_CHAIN (fn), vindex += (TARGET_VTABLE_USES_DESCRIPTORS ? TARGET_VTABLE_USES_DESCRIPTORS : 1)) { @@ -5003,7 +5003,7 @@ finish_struct_1 (tree t) /* Make the rtl for any new vtables we have created, and unmark the base types we marked. */ finish_vtbls (t); - + /* Build the VTT for T. */ build_vtt (t); @@ -5020,10 +5020,10 @@ finish_struct_1 (tree t) if it were virtual, we would have created it by now. */ !dtor || (!DECL_VINDEX (dtor) - && (!TREE_PRIVATE (dtor) - || CLASSTYPE_FRIEND_CLASSES (t) + && (!TREE_PRIVATE (dtor) + || CLASSTYPE_FRIEND_CLASSES (t) || DECL_FRIENDLIST (TYPE_MAIN_DECL (t))))) - warning (0, "%q#T has virtual functions but non-virtual destructor", + warning (0, "%q#T has virtual functions but non-virtual destructor", t); } @@ -5035,7 +5035,7 @@ finish_struct_1 (tree t) maybe_suppress_debug_info (t); dump_class_hierarchy (t); - + /* Finish debugging output for this type. */ rest_of_type_compilation (t, ! LOCAL_CLASS_P (t)); } @@ -5058,8 +5058,8 @@ unreverse_member_declarations (tree t) /* Actually, for the TYPE_FIELDS, only the non TYPE_DECLs are in reverse order, so we can't just use nreverse. */ prev = NULL_TREE; - for (x = TYPE_FIELDS (t); - x && TREE_CODE (x) != TYPE_DECL; + for (x = TYPE_FIELDS (t); + x && TREE_CODE (x) != TYPE_DECL; x = next) { next = TREE_CHAIN (x); @@ -5224,7 +5224,7 @@ fixed_type_or_null (tree instance, int* nonnull, int* cdtorp) { if (nonnull) *nonnull = 1; - + /* if we're in a ctor or dtor, we know our type. */ if (DECL_LANG_SPECIFIC (current_function_decl) && (DECL_CONSTRUCTOR_P (current_function_decl) @@ -5240,11 +5240,11 @@ fixed_type_or_null (tree instance, int* nonnull, int* cdtorp) /* Reference variables should be references to objects. */ if (nonnull) *nonnull = 1; - + /* DECL_VAR_MARKED_P is used to prevent recursion; a variable's initializer may refer to the variable itself. */ - if (TREE_CODE (instance) == VAR_DECL + if (TREE_CODE (instance) == VAR_DECL && DECL_INITIAL (instance) && !DECL_VAR_MARKED_P (instance)) { @@ -5282,7 +5282,7 @@ resolves_to_fixed_type_p (tree instance, int* nonnull) { tree t = TREE_TYPE (instance); int cdtorp = 0; - + tree fixed = fixed_type_or_null (instance, nonnull, &cdtorp); if (fixed == NULL_TREE) return 0; @@ -5299,7 +5299,7 @@ init_class_processing (void) { current_class_depth = 0; current_class_stack_size = 10; - current_class_stack + current_class_stack = xmalloc (current_class_stack_size * sizeof (struct class_stack_node)); local_classes = VEC_alloc (tree, gc, 8); @@ -5322,8 +5322,8 @@ restore_class_cache (void) push_binding_level (previous_class_level); class_binding_level = previous_class_level; /* Restore IDENTIFIER_TYPE_VALUE. */ - for (type = class_binding_level->type_shadowed; - type; + for (type = class_binding_level->type_shadowed; + type; type = TREE_CHAIN (type)) SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (type), TREE_TYPE (type)); } @@ -5343,7 +5343,7 @@ pushclass (tree type) type = TYPE_MAIN_VARIANT (type); /* Make sure there is enough room for the new entry on the stack. */ - if (current_class_depth + 1 >= current_class_stack_size) + if (current_class_depth + 1 >= current_class_stack_size) { current_class_stack_size *= 2; current_class_stack @@ -5367,8 +5367,8 @@ pushclass (tree type) /* By default, things in classes are private, while things in structures or unions are public. */ - current_access_specifier = (CLASSTYPE_DECLARED_CLASS (type) - ? access_private_node + current_access_specifier = (CLASSTYPE_DECLARED_CLASS (type) + ? access_private_node : access_public_node); if (previous_class_level @@ -5379,7 +5379,7 @@ pushclass (tree type) invalidate_class_lookup_cache (); } - if (!previous_class_level + if (!previous_class_level || type != previous_class_level->this_entity || current_class_depth > 1) pushlevel_class (); @@ -5396,7 +5396,7 @@ invalidate_class_lookup_cache (void) { previous_class_level = NULL; } - + /* Get out of the current class scope. If we were in a class scope previously, that is the one popped to. */ @@ -5468,14 +5468,14 @@ push_nested_class (tree type) tree context; /* A namespace might be passed in error cases, like A::B:C. */ - if (type == NULL_TREE - || type == error_mark_node + if (type == NULL_TREE + || type == error_mark_node || TREE_CODE (type) == NAMESPACE_DECL || ! IS_AGGR_TYPE (type) || TREE_CODE (type) == TEMPLATE_TYPE_PARM || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM) return; - + context = DECL_CONTEXT (TYPE_MAIN_DECL (type)); if (context && CLASS_TYPE_P (context)) @@ -5538,7 +5538,7 @@ push_lang_context (tree name) else error ("language string %<\"%E\"%> not recognized", name); } - + /* Get out of the current language scope. */ void @@ -5558,14 +5558,14 @@ pop_lang_context (void) template arguments. */ static tree -resolve_address_of_overloaded_function (tree target_type, +resolve_address_of_overloaded_function (tree target_type, tree overload, tsubst_flags_t flags, bool template_only, tree explicit_targs) { /* Here's what the standard says: - + [over.over] If the name is a function template, template argument deduction @@ -5605,7 +5605,7 @@ resolve_address_of_overloaded_function (tree target_type, || TREE_CODE (TREE_TYPE (target_type)) != METHOD_TYPE); gcc_assert (is_overloaded_fn (overload)); - + /* Check that the TARGET_TYPE is reasonable. */ if (TYPE_PTRFN_P (target_type)) /* This is OK. */; @@ -5619,15 +5619,15 @@ resolve_address_of_overloaded_function (tree target_type, target_type = build_reference_type (target_type); is_reference = 1; } - else + else { if (flags & tf_error) error ("cannot resolve overloaded function %qD based on" - " conversion to type %qT", + " conversion to type %qT", DECL_NAME (OVL_FUNCTION (overload)), target_type); return error_mark_node; } - + /* If we can find a non-template function that matches, we can just use it. There's no point in generating template instantiations if we're just going to throw them out anyhow. But, of course, we @@ -5670,7 +5670,7 @@ resolve_address_of_overloaded_function (tree target_type, /* Now, if we've already got a match (or matches), there's no need to proceed to the template functions. But, if we don't have a match we need to look at them, too. */ - if (!matches) + if (!matches) { tree target_fn_type; tree target_arg_types; @@ -5688,7 +5688,7 @@ resolve_address_of_overloaded_function (tree target_type, /* Never do unification on the 'this' parameter. */ if (TREE_CODE (target_fn_type) == METHOD_TYPE) target_arg_types = TREE_CHAIN (target_arg_types); - + for (fns = overload; fns; fns = OVL_NEXT (fns)) { tree fn = OVL_CURRENT (fns); @@ -5723,7 +5723,7 @@ resolve_address_of_overloaded_function (tree target_type, /* See if there's a match. */ instantiation_type = TREE_TYPE (instantiation); if (is_ptrmem) - instantiation_type = + instantiation_type = build_ptrmemfunc_type (build_pointer_type (instantiation_type)); else if (!is_reference) instantiation_type = build_pointer_type (instantiation_type); @@ -5747,7 +5747,7 @@ resolve_address_of_overloaded_function (tree target_type, /* There were *no* matches. */ if (flags & tf_error) { - error ("no matches converting function %qD to type %q#T", + error ("no matches converting function %qD to type %q#T", DECL_NAME (OVL_FUNCTION (overload)), target_type); @@ -5757,7 +5757,7 @@ resolve_address_of_overloaded_function (tree target_type, for (; overload; overload = OVL_NEXT (overload)) matches = tree_cons (NULL_TREE, OVL_CURRENT (overload), matches); - + print_candidates (matches); } return error_mark_node; @@ -5770,7 +5770,7 @@ resolve_address_of_overloaded_function (tree target_type, { tree match; - error ("converting overloaded function %qD to type %q#T is ambiguous", + error ("converting overloaded function %qD to type %q#T is ambiguous", DECL_NAME (OVL_FUNCTION (overload)), target_type); @@ -5781,7 +5781,7 @@ resolve_address_of_overloaded_function (tree target_type, print_candidates (matches); } - + return error_mark_node; } @@ -5792,7 +5792,7 @@ resolve_address_of_overloaded_function (tree target_type, && !(flags & tf_ptrmem_ok) && !flag_ms_extensions) { static int explained; - + if (!(flags & tf_error)) return error_mark_node; @@ -5830,7 +5830,7 @@ resolve_address_of_overloaded_function (tree target_type, we complain on errors. If we are not complaining, never modify rhs, as overload resolution wants to try many possible instantiations, in the hope that at least one will work. - + For non-recursive calls, LHSTYPE should be a function, pointer to function, or a pointer to member function. */ @@ -5838,9 +5838,9 @@ tree instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) { tsubst_flags_t flags_in = flags; - + flags &= ~tf_ptrmem_ok; - + if (TREE_CODE (lhstype) == UNKNOWN_TYPE) { if (flags & tf_error) @@ -5852,7 +5852,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) { if (same_type_p (lhstype, TREE_TYPE (rhs))) return rhs; - if (flag_ms_extensions + if (flag_ms_extensions && TYPE_PTRMEMFUNC_P (lhstype) && !TYPE_PTRMEMFUNC_P (TREE_TYPE (rhs))) /* Microsoft allows `A::f' to be resolved to a @@ -5954,7 +5954,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) case OVERLOAD: case FUNCTION_DECL: - return + return resolve_address_of_overloaded_function (lhstype, rhs, flags_in, /*template_only=*/false, /*explicit_targs=*/NULL_TREE); @@ -6057,12 +6057,12 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) TREE_TYPE (rhs) = lhstype; return rhs; - + case ADDR_EXPR: { if (PTRMEM_OK_P (rhs)) flags |= tf_ptrmem_ok; - + return instantiate_type (lhstype, TREE_OPERAND (rhs, 0), flags); } @@ -6097,7 +6097,7 @@ get_vfield_name (tree type) || !TYPE_CONTAINS_VPTR_P (BINFO_TYPE (base_binfo))) break; } - + type = BINFO_TYPE (binfo); buf = alloca (sizeof (VFIELD_NAME_FORMAT) + TYPE_NAME_LENGTH (type) + 2); sprintf (buf, VFIELD_NAME_FORMAT, @@ -6208,10 +6208,10 @@ maybe_note_name_used_in_class (tree name, tree decl) if (!(innermost_scope_kind() == sk_class && TYPE_BEING_DEFINED (current_class_type))) return; - + /* If there's already a binding for this NAME, then we don't have anything to worry about. */ - if (lookup_member (current_class_type, name, + if (lookup_member (current_class_type, name, /*protect=*/0, /*want_type=*/false)) return; @@ -6221,7 +6221,7 @@ maybe_note_name_used_in_class (tree name, tree decl) names_used = current_class_stack[current_class_depth - 1].names_used; splay_tree_insert (names_used, - (splay_tree_key) name, + (splay_tree_key) name, (splay_tree_value) decl); } @@ -6235,7 +6235,7 @@ note_name_declared_in_class (tree name, tree decl) splay_tree_node n; /* Look to see if we ever used this name. */ - names_used + names_used = current_class_stack[current_class_depth - 1].names_used; if (!names_used) return; @@ -6244,12 +6244,12 @@ note_name_declared_in_class (tree name, tree decl) if (n) { /* [basic.scope.class] - + A name N used in a class S shall refer to the same declaration in its context and when re-evaluated in the completed scope of S. */ error ("declaration of %q#D", decl); - cp_error_at ("changes meaning of %qD from %q+#D", + cp_error_at ("changes meaning of %qD from %q+#D", DECL_NAME (OVL_CURRENT (decl)), (tree) n->value); } @@ -6287,7 +6287,7 @@ get_primary_binfo (tree binfo) { tree primary_base; tree result; - + primary_base = CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (binfo)); if (!primary_base) return NULL_TREE; @@ -6321,7 +6321,7 @@ dump_class_hierarchy_r (FILE *stream, int indented = 0; tree base_binfo; int i; - + indented = maybe_indent_hierarchy (stream, indent, 0); fprintf (stream, "%s (0x%lx) ", type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER), @@ -6332,7 +6332,7 @@ dump_class_hierarchy_r (FILE *stream, return igo; } igo = TREE_CHAIN (binfo); - + fprintf (stream, HOST_WIDE_INT_PRINT_DEC, tree_low_cst (BINFO_OFFSET (binfo), 0)); if (is_empty_class (BINFO_TYPE (binfo))) @@ -6363,7 +6363,7 @@ dump_class_hierarchy_r (FILE *stream, if (!(flags & TDF_SLIM)) { int indented = 0; - + if (BINFO_SUBVTT_INDEX (binfo)) { indented = maybe_indent_hierarchy (stream, indent + 3, indented); @@ -6392,14 +6392,14 @@ dump_class_hierarchy_r (FILE *stream, expr_as_string (BINFO_VTABLE (binfo), TFF_PLAIN_IDENTIFIER)); } - + if (indented) fprintf (stream, "\n"); } for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) igo = dump_class_hierarchy_r (stream, flags, base_binfo, igo, indent + 2); - + return igo; } @@ -6476,7 +6476,7 @@ dump_vtable (tree t, tree binfo, tree vtable) if (!(flags & TDF_SLIM)) { int ctor_vtbl_p = TYPE_BINFO (t) != binfo; - + fprintf (stream, "%s for %s", ctor_vtbl_p ? "Construction vtable" : "Vtable", type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER)); @@ -6490,7 +6490,7 @@ dump_vtable (tree t, tree binfo, tree vtable) dump_array (stream, vtable); fprintf (stream, "\n"); } - + dump_end (TDI_class, stream); } @@ -6510,7 +6510,7 @@ dump_vtt (tree t, tree vtt) dump_array (stream, vtt); fprintf (stream, "\n"); } - + dump_end (TDI_class, stream); } @@ -6522,7 +6522,7 @@ dump_thunk (FILE *stream, int indent, tree thunk) static const char spaces[] = " "; tree name = DECL_NAME (thunk); tree thunks; - + fprintf (stream, "%.*s%p %s %s", indent, spaces, (void *)thunk, !DECL_THUNK_P (thunk) ? "function" @@ -6575,7 +6575,7 @@ finish_vtbls (tree t) list = build_tree_list (BINFO_VTABLE (TYPE_BINFO (t)), NULL_TREE); accumulate_vtbl_inits (TYPE_BINFO (t), TYPE_BINFO (t), TYPE_BINFO (t), t, list); - + /* Then come the virtual bases, also in inheritance graph order. */ for (vbase = TYPE_BINFO (t); vbase; vbase = TREE_CHAIN (vbase)) { @@ -6603,7 +6603,7 @@ initialize_vtable (tree binfo, tree inits) /* Build the VTT (virtual table table) for T. A class requires a VTT if it has virtual bases. - + This holds 1 - primary virtual pointer for complete object T 2 - secondary VTTs for each direct non-virtual base of T which requires a @@ -6611,7 +6611,7 @@ initialize_vtable (tree binfo, tree inits) 3 - secondary virtual pointers for each direct or indirect base of T which has virtual bases or is reachable via a virtual path from T. 4 - secondary VTTs for each direct or indirect virtual base of T. - + Secondary VTTs look like complete object VTTs without part 4. */ static void @@ -6634,7 +6634,7 @@ build_vtt (tree t) /* Figure out the type of the VTT. */ type = build_index_type (size_int (list_length (inits) - 1)); type = build_cplus_array_type (const_ptr_type_node, type); - + /* Now, build the VTT object itself. */ vtt = build_vtable (t, get_vtt_name (t), type); initialize_artificial_var (vtt, inits); @@ -6727,12 +6727,12 @@ build_vtt_inits (tree binfo, tree t, tree *inits, tree *index) BINFO_VPTR_INDEX (binfo) = *index; } *index = size_binop (PLUS_EXPR, *index, TYPE_SIZE_UNIT (ptr_type_node)); - + /* Recursively add the secondary VTTs for non-virtual bases. */ for (i = 0; BINFO_BASE_ITERATE (binfo, i, b); ++i) if (!BINFO_VIRTUAL_P (b)) inits = build_vtt_inits (b, t, inits, index); - + /* Add secondary virtual pointers for all subobjects of BINFO with either virtual bases or reachable along a virtual path, except subobjects that are non-virtual primary bases. */ @@ -6740,7 +6740,7 @@ build_vtt_inits (tree binfo, tree t, tree *inits, tree *index) data.index = *index; data.inits = NULL; data.type_being_constructed = BINFO_TYPE (binfo); - + dfs_walk_once (binfo, dfs_build_secondary_vptr_vtt_inits, NULL, &data); *index = data.index; @@ -6763,7 +6763,7 @@ build_vtt_inits (tree binfo, tree t, tree *inits, tree *index) { if (!BINFO_VIRTUAL_P (b)) continue; - + inits = build_vtt_inits (b, t, inits, index); } else @@ -6795,11 +6795,11 @@ dfs_build_secondary_vptr_vtt_inits (tree binfo, void *data_) if (!(CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo)) || binfo_via_virtual (binfo, data->type_being_constructed))) return dfs_skip_bases; - + /* We're not interested in non-virtual primary bases. */ if (!BINFO_VIRTUAL_P (binfo) && BINFO_PRIMARY_P (binfo)) return NULL_TREE; - + /* Record the index where this secondary vptr can be found. */ if (data->top_level_p) { @@ -6816,7 +6816,7 @@ dfs_build_secondary_vptr_vtt_inits (tree binfo, void *data_) binfo = BINFO_INHERITANCE_CHAIN (binfo); } } - + /* Add the initializer for the secondary vptr itself. */ data->inits = tree_cons (NULL_TREE, binfo_ctor_vtable (binfo), data->inits); @@ -6840,12 +6840,12 @@ dfs_fixup_binfo_vtbls (tree binfo, void* data) if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo))) /* If this class has no vtable, none of its bases do. */ return dfs_skip_bases; - + if (!vtable) /* This might be a primary base, so have no vtable in this hierarchy. */ return NULL_TREE; - + /* If we scribbled the construction vtable vptr into BINFO, clear it out now. */ if (TREE_CODE (vtable) == TREE_LIST @@ -6885,8 +6885,8 @@ build_ctor_vtbl_group (tree binfo, tree t) /* Add the vtables for each of our virtual bases using the vbase in T binfo. */ - for (vbase = TYPE_BINFO (BINFO_TYPE (binfo)); - vbase; + for (vbase = TYPE_BINFO (BINFO_TYPE (binfo)); + vbase; vbase = TREE_CHAIN (vbase)) { tree b; @@ -6894,7 +6894,7 @@ build_ctor_vtbl_group (tree binfo, tree t) if (!BINFO_VIRTUAL_P (vbase)) continue; b = copied_binfo (vbase, binfo); - + accumulate_vtbl_inits (b, vbase, binfo, t, list); } inits = TREE_VALUE (list); @@ -6936,20 +6936,20 @@ accumulate_vtbl_inits (tree binfo, /* If it doesn't have a vptr, we don't do anything. */ if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo))) return; - + /* If we're building a construction vtable, we're not interested in subobjects that don't require construction vtables. */ - if (ctor_vtbl_p + if (ctor_vtbl_p && !CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo)) && !binfo_via_virtual (orig_binfo, BINFO_TYPE (rtti_binfo))) return; /* Build the initializers for the BINFO-in-T vtable. */ - TREE_VALUE (inits) + TREE_VALUE (inits) = chainon (TREE_VALUE (inits), dfs_accumulate_vtbl_inits (binfo, orig_binfo, rtti_binfo, t, inits)); - + /* Walk the BINFO and its bases. We walk in preorder so that as we initialize each vtable we can figure out at what offset the secondary vtable lies from the primary vtable. We can't use @@ -6991,14 +6991,14 @@ dfs_accumulate_vtbl_inits (tree binfo, primary, we still need a VTT entry for the vtable, but it should point to the ctor vtable for the base it is a primary for within the sub-hierarchy of RTTI_BINFO. - + There are three possible cases: - + 1) We are in the same place. 2) We are a primary base within a lost primary virtual base of RTTI_BINFO. 3) We are primary to something not a base of RTTI_BINFO. */ - + tree b; tree last = NULL_TREE; @@ -7018,7 +7018,7 @@ dfs_accumulate_vtbl_inits (tree binfo, if (BINFO_VIRTUAL_P (b) || b == rtti_binfo) break; found: - + /* If we found RTTI_BINFO, this is case 1. If we found a virtual base B and it is a base of RTTI_BINFO, this is case 2. In either case, we share our vtable with LAST, i.e. the @@ -7086,7 +7086,7 @@ static GTY(()) tree abort_fndecl_addr; The value returned is a TREE_LIST suitable for wrapping in a CONSTRUCTOR to use as the DECL_INITIAL for a vtable. If NON_FN_ENTRIES_P is not NULL, *NON_FN_ENTRIES_P is set to the - number of non-function entries in the vtable. + number of non-function entries in the vtable. It might seem that this function should never be called with a BINFO for which BINFO_PRIMARY_P holds, the vtable for such a @@ -7108,7 +7108,7 @@ build_vtbl_initializer (tree binfo, unsigned ix; tree vbinfo; VEC(tree,gc) *vbases; - + /* Initialize VID. */ memset (&vid, 0, sizeof (vid)); vid.binfo = binfo; @@ -7130,7 +7130,7 @@ build_vtbl_initializer (tree binfo, vid.fns = VEC_alloc (tree, gc, 32); /* Add the vcall and vbase offset entries. */ build_vcall_and_vbase_vtbl_entries (binfo, &vid); - + /* Clear BINFO_VTABLE_PATH_MARKED; it's set by build_vbase_offset_vtbl_entries. */ for (vbases = CLASSTYPE_VBASECLASSES (t), ix = 0; @@ -7168,7 +7168,7 @@ build_vtbl_initializer (tree binfo, tree vcall_index; tree fn, fn_original; tree init = NULL_TREE; - + fn = BV_FN (v); fn_original = fn; if (DECL_THUNK_P (fn)) @@ -7182,7 +7182,7 @@ build_vtbl_initializer (tree binfo, } fn_original = THUNK_TARGET (fn); } - + /* If the only definition of this function signature along our primary base chain is from a lost primary, this vtable slot will never be used, so just zero it out. This is important to avoid @@ -7267,7 +7267,7 @@ build_vtbl_initializer (tree binfo, /* The initializers for virtual functions were built up in reverse order; straighten them out now. */ vfun_inits = nreverse (vfun_inits); - + /* The negative offset initializers are also in reverse order. */ vid.inits = nreverse (vid.inits); @@ -7313,7 +7313,7 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) return; t = vid->derived; - + /* We might be a primary base class. Go up the inheritance hierarchy until we find the most derived class of which we are a primary base: it is the offset of that which we need to use. */ @@ -7345,7 +7345,7 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) { tree b; tree delta; - + if (!BINFO_VIRTUAL_P (vbase)) continue; @@ -7360,7 +7360,7 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) BINFO_VTABLE_PATH_MARKED (b) = 1; /* Figure out where we can find this vbase offset. */ - delta = size_binop (MULT_EXPR, + delta = size_binop (MULT_EXPR, vid->index, convert (ssizetype, TYPE_SIZE_UNIT (vtable_entry_type))); @@ -7380,10 +7380,10 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) we are walking in inheritance graph order so these end up in the right order. */ delta = size_diffop (BINFO_OFFSET (b), BINFO_OFFSET (non_primary_binfo)); - - *vid->last_init + + *vid->last_init = build_tree_list (NULL_TREE, - fold_build1 (NOP_EXPR, + fold_build1 (NOP_EXPR, vtable_entry_type, delta)); vid->last_init = &TREE_CHAIN (*vid->last_init); @@ -7445,7 +7445,7 @@ add_vcall_offset_vtbl_entries_r (tree binfo, vtbl_init_data* vid) through the recursion in build_vcall_and_vbase_vtbl_entries. */ if (BINFO_VIRTUAL_P (binfo) && vid->vbase != binfo) return; - + /* If BINFO has a primary base, process it first. */ primary_binfo = get_primary_binfo (binfo); if (primary_binfo) @@ -7519,7 +7519,7 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid) where rtti_binfo is the most derived type. */ non_primary_binfo = original_binfo (non_primary_binfo, vid->rtti_binfo); - + for (base_virtuals = BINFO_VIRTUALS (binfo), derived_virtuals = BINFO_VIRTUALS (non_primary_binfo), orig_virtuals = BINFO_VIRTUALS (TYPE_BINFO (BINFO_TYPE (binfo))); @@ -7558,7 +7558,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) signature as FN, then we do not need a second vcall offset. Check the list of functions already present in the derived class vtable. */ - for (i = 0; VEC_iterate (tree, vid->fns, i, derived_entry); ++i) + for (i = 0; VEC_iterate (tree, vid->fns, i, derived_entry); ++i) { if (same_signature_p (derived_entry, orig_fn) /* We only use one vcall offset for virtual destructors, @@ -7579,7 +7579,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) elt->purpose = orig_fn; elt->value = vid->index; } - + /* The next vcall offset will be found at a more negative offset. */ vid->index = size_binop (MINUS_EXPR, vid->index, @@ -7654,7 +7654,7 @@ build_rtti_vtbl_entries (tree binfo, vtbl_init_data* vid) decl = build_address (get_tinfo_decl (t)); else decl = integer_zero_node; - + /* Convert the declaration to a type that can be stored in the vtable. */ init = build_nop (vfunc_ptr_type_node, decl); diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 4ad30b98008..4af7843d6f5 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -635,7 +635,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) CLEANUP_EXPR (stmt)); pointer_set_insert (p_set, *stmt_p); - + return NULL; } diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index d43c159c01f..a8b807b5644 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -99,7 +99,7 @@ cp_expr_size (tree exp) the result. Since the "s" subobject is never constructed, this is a valid transformation. */ || CP_AGGREGATE_TYPE_P (type)); - + /* This would be wrong for a type with virtual bases, but they are caught by the assert above. */ return (is_empty_class (type) diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def index 894b62db45c..833ad3374b3 100644 --- a/gcc/cp/cp-tree.def +++ b/gcc/cp/cp-tree.def @@ -1,7 +1,7 @@ /* This file contains the definitions and documentation for the additional tree codes used in the GNU C++ compiler (see tree.def for the standard codes). - Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005, + Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) @@ -22,7 +22,7 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + /* An OFFSET_REF is used in two situations: 1. An expression of the form `A::m' where `A' is a class and `m' is @@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA. */ The expression is a pointer-to-member if its address is taken, but simply denotes a member of the object if its address is not taken. - + This form is only used during the parsing phase; once semantic analysis has taken place they are eliminated. @@ -97,7 +97,7 @@ DEFTREECODE (ALIAS_DECL, "alias_decl", tcc_declaration, 0) functions. BASELINK_BINFO gives the base from which the functions come, i.e., the base to which the `this' pointer must be converted before the functions are called. BASELINK_ACCESS_BINFO gives the - base used to name the functions. + base used to name the functions. A BASELINK is an expression; the TREE_TYPE of the BASELINK gives the type of the expression. This type is either a FUNCTION_TYPE, @@ -127,14 +127,14 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0) gives the level (from 1) of the parameter. Here's an example: - + template // Index 0, Level 1. struct S { template // Index 1, Level 2. void f(); - }; + }; The DESCENDANTS will be a chain of TEMPLATE_PARM_INDEXs descended from this one. The first descendant will have the same IDX, but @@ -151,17 +151,17 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0) class V> // Index 1, Level 1, Orig Level 2 void f(); }; - + The LEVEL is the level of the parameter when we are worrying about the types of things; the ORIG_LEVEL is the level when we are worrying about instantiating things. */ DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", tcc_exceptional, 0) /* Index into a template parameter list for template template parameters. - This parameter must be a type. The TYPE_FIELDS value will be a + This parameter must be a type. The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX. - It is used without template arguments like TT in C, + It is used without template arguments like TT in C, TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO is NULL_TREE and TYPE_NAME is a TEMPLATE_DECL. */ DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", tcc_type, 0) @@ -170,7 +170,7 @@ DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", tcc_type, 0) macros in tree.h. Changing the order will degrade the speed of the compiler. TEMPLATE_TYPE_PARM, TYPENAME_TYPE, TYPEOF_TYPE, BOUND_TEMPLATE_TEMPLATE_PARM. */ - + /* Index into a template parameter list. This parameter must be a type. The type.value field will be a TEMPLATE_PARM_INDEX. */ DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", tcc_type, 0) @@ -185,7 +185,7 @@ DEFTREECODE (TYPENAME_TYPE, "typename_type", tcc_type, 0) expression in question. */ DEFTREECODE (TYPEOF_TYPE, "typeof_type", tcc_type, 0) -/* Like TEMPLATE_TEMPLATE_PARM it is used with bound template arguments +/* Like TEMPLATE_TEMPLATE_PARM it is used with bound template arguments like TT. In this case, TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO contains the template name and its bound arguments. TYPE_NAME is a TYPE_DECL. */ @@ -203,7 +203,7 @@ DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", tcc_type, 0) not an alias, but is later expanded into multiple aliases. */ DEFTREECODE (USING_DECL, "using_decl", tcc_declaration, 0) -/* A using directive. The operand is USING_STMT_NAMESPACE. */ +/* A using directive. The operand is USING_STMT_NAMESPACE. */ DEFTREECODE (USING_STMT, "using_directive", tcc_statement, 1) /* An un-parsed default argument. Holds a vector of input tokens and @@ -218,7 +218,7 @@ DEFTREECODE (DEFAULT_ARG, "default_arg", tcc_exceptional, 0) member template, the template may be an IDENTIFIER_NODE. */ DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", tcc_expression, 2) -/* A list-like node for chaining overloading candidates. TREE_TYPE is +/* A list-like node for chaining overloading candidates. TREE_TYPE is the original name, and the parameter is the FUNCTION_DECL. */ DEFTREECODE (OVERLOAD, "overload", tcc_exceptional, 0) @@ -226,12 +226,12 @@ DEFTREECODE (OVERLOAD, "overload", tcc_exceptional, 0) "OBJECT.SCOPE::~DESTRUCTOR. The first operand is the OBJECT. The second operand (if non-NULL) is the SCOPE. The third operand is the TYPE node corresponding to the DESTRUCTOR. The type of the - first operand will always be a scalar type. + first operand will always be a scalar type. The type of a PSEUDO_DTOR_EXPR is always "void", even though it can be used as if it were a zero-argument function. We handle the function-call case specially, and giving it "void" type prevents it - being used in expressions in ways that are not permitted. */ + being used in expressions in ways that are not permitted. */ DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", tcc_expression, 3) /* A whole bunch of tree codes for the initial, superficial parsing of @@ -281,7 +281,7 @@ DEFTREECODE (CLEANUP_STMT, "cleanup_stmt", tcc_statement, 3) /* Represents an 'if' statement. The operands are IF_COND, THEN_CLAUSE, and ELSE_CLAUSE, respectively. */ -/* ??? It is currently still necessary to distinguish between IF_STMT +/* ??? It is currently still necessary to distinguish between IF_STMT and COND_EXPR for the benefit of templates. */ DEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 3) diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index bb234bb5e13..ef90c3d528b 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1041,7 +1041,7 @@ struct lang_type_class GTY(()) unsigned java_interface : 1; unsigned debug_requested : 1; unsigned fields_readonly : 1; - + unsigned use_template : 2; unsigned ptrmemfunc_flag : 1; unsigned was_anonymous : 1; @@ -1170,7 +1170,7 @@ struct lang_type GTY(()) it has not yet been declared. */ #define CLASSTYPE_LAZY_DESTRUCTOR(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->lazy_destructor) - + /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */ #define TYPE_HAS_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_assign_ref) @@ -1529,7 +1529,7 @@ struct lang_decl_flags GTY(()) unsigned initialized_in_class : 1; unsigned assignment_operator_p : 1; unsigned u1sel : 1; - + unsigned u2sel : 1; unsigned can_be_full : 1; unsigned thunk_p : 1; @@ -1578,7 +1578,7 @@ struct lang_decl GTY(()) unsigned u3sel : 1; unsigned pending_inline_p : 1; unsigned spare : 22; - + /* For a non-thunk function decl, this is a tree list of friendly classes. For a thunk function decl, it is the thunked to function decl. */ @@ -1597,12 +1597,12 @@ struct lang_decl GTY(()) /* In a non-thunk FUNCTION_DECL or TEMPLATE_DECL, this is DECL_CLONED_FUNCTION. */ tree GTY ((tag ("0"))) cloned_function; - + /* In a FUNCTION_DECL for which THUNK_P holds this is the THUNK_FIXED_OFFSET. */ HOST_WIDE_INT GTY ((tag ("1"))) fixed_offset; } GTY ((desc ("%0.decl_flags.thunk_p"))) u5; - + union lang_decl_u3 { struct sorted_fields_type * GTY ((tag ("0"), reorder ("resort_sorted_fields"))) @@ -1911,7 +1911,7 @@ struct lang_decl GTY(()) (TREE_CODE (NODE) == FUNCTION_DECL \ && DECL_LANG_SPECIFIC (NODE) \ && DECL_LANG_SPECIFIC (NODE)->decl_flags.thunk_p) - + /* Set DECL_THUNK_P for node. */ #define SET_DECL_THUNK_P(NODE, THIS_ADJUSTING) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.thunk_p = 1, \ diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index c7ffb166f81..f136d5bde49 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -140,7 +140,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) intype_class = TREE_TYPE (intype); type_class = TREE_TYPE (type); - same_p = same_type_p (TYPE_MAIN_VARIANT (intype_class), + same_p = same_type_p (TYPE_MAIN_VARIANT (intype_class), TYPE_MAIN_VARIANT (type_class)); binfo = NULL_TREE; /* Try derived to base conversion. */ @@ -174,7 +174,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) } else if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype)) { - tree b1; + tree b1; tree b2; tree binfo; enum tree_code code = PLUS_EXPR; @@ -211,7 +211,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) expr = cplus_expand_constant (expr); if (binfo && !integer_zerop (BINFO_OFFSET (binfo))) - expr = size_binop (code, + expr = size_binop (code, build_nop (sizetype, expr), BINFO_OFFSET (binfo)); return build_nop (type, expr); @@ -255,7 +255,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) } else expr = build_int_cst (type, 0); - + return expr; } else if (TYPE_PTR_TO_MEMBER_P (type) && INTEGRAL_CODE_P (form)) @@ -274,7 +274,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) as a pointer. */ gcc_assert (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr))) == GET_MODE_SIZE (TYPE_MODE (type))); - + return convert_to_pointer (type, expr); } @@ -295,7 +295,7 @@ convert_to_pointer_force (tree type, tree expr) { tree intype = TREE_TYPE (expr); enum tree_code form = TREE_CODE (intype); - + if (form == POINTER_TYPE) { intype = TYPE_MAIN_VARIANT (intype); @@ -363,7 +363,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl) /* Process the initializer for the declaration. */ DECL_INITIAL (arg) = targ; - cp_finish_decl (arg, targ, NULL_TREE, + cp_finish_decl (arg, targ, NULL_TREE, LOOKUP_ONLYCONVERTING|DIRECT_BIND); } else if (!(flags & DIRECT_BIND) && ! lvalue_p (arg)) @@ -398,7 +398,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl) /* Subroutine of convert_to_reference. REFTYPE is the target reference type. INTYPE is the original rvalue type and DECL is an optional _DECL node for diagnostics. - + [dcl.init.ref] says that if an rvalue is used to initialize a reference, then the reference must be to a non-volatile const type. */ @@ -407,7 +407,7 @@ static void warn_ref_binding (tree reftype, tree intype, tree decl) { tree ttl = TREE_TYPE (reftype); - + if (!CP_TYPE_CONST_NON_VOLATILE_P (ttl)) { const char *msg; @@ -446,9 +446,9 @@ convert_to_reference (tree reftype, tree expr, int convtype, tree rval_as_conversion = NULL_TREE; bool can_convert_intype_to_type; - if (TREE_CODE (type) == FUNCTION_TYPE + if (TREE_CODE (type) == FUNCTION_TYPE && TREE_TYPE (expr) == unknown_type_node) - expr = instantiate_type (type, expr, + expr = instantiate_type (type, expr, (flags & LOOKUP_COMPLAIN) ? tf_error | tf_warning : tf_none); @@ -491,7 +491,7 @@ convert_to_reference (tree reftype, tree expr, int convtype, if (! real_lvalue_p (expr)) warn_ref_binding (reftype, intype, decl); - + if (! (convtype & CONV_CONST) && !at_least_as_qualified_p (ttl, ttr)) pedwarn ("conversion from %qT to %qT discards qualifiers", @@ -514,7 +514,7 @@ convert_to_reference (tree reftype, tree expr, int convtype, COMPARE_BASE | COMPARE_DERIVED))) warning (0, "casting %qT to %qT does not dereference pointer", intype, reftype); - + rval = build_unary_op (ADDR_EXPR, expr, 0); if (rval != error_mark_node) rval = convert_force (build_pointer_type (TREE_TYPE (reftype)), @@ -554,7 +554,7 @@ convert_from_reference (tree val) { tree t = canonical_type_variant (TREE_TYPE (TREE_TYPE (val))); tree ref = build1 (INDIRECT_REF, t, val); - + /* We *must* set TREE_READONLY when dereferencing a pointer to const, so that we get the proper error message if the result is used to assign to. Also, &* is supposed to be a no-op. */ @@ -565,7 +565,7 @@ convert_from_reference (tree val) REFERENCE_REF_P (ref) = 1; val = ref; } - + return val; } @@ -752,7 +752,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags) the target with the temp (see [dcl.init]). */ ctor = build_user_type_conversion (type, ctor, flags); else - ctor = build_special_member_call (NULL_TREE, + ctor = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, ctor), type, flags); @@ -780,13 +780,13 @@ ocp_convert (tree type, tree expr, int convtype, int flags) volatile references we do not do this interpretation, because that would make it impossible to ignore the reference return value from functions. We issue warnings in the confusing cases. - + IMPLICIT is tells us the context of an implicit void conversion. */ tree convert_to_void (tree expr, const char *implicit) { - if (expr == error_mark_node + if (expr == error_mark_node || TREE_TYPE (expr) == error_mark_node) return error_mark_node; if (!TREE_TYPE (expr)) @@ -813,12 +813,12 @@ convert_to_void (tree expr, const char *implicit) tree new_op2 = convert_to_void (op2, (implicit && !TREE_SIDE_EFFECTS (op1) ? "third operand of conditional" : NULL)); - + expr = build3 (COND_EXPR, TREE_TYPE (new_op1), TREE_OPERAND (expr, 0), new_op1, new_op2); break; } - + case COMPOUND_EXPR: { /* The second part of a compound expr contains the value. */ @@ -826,7 +826,7 @@ convert_to_void (tree expr, const char *implicit) tree new_op1 = convert_to_void (op1, (implicit && !TREE_NO_WARNING (expr) ? "right-hand operand of comma" : NULL)); - + if (new_op1 != op1) { tree t = build2 (COMPOUND_EXPR, TREE_TYPE (new_op1), @@ -836,15 +836,15 @@ convert_to_void (tree expr, const char *implicit) break; } - + case NON_LVALUE_EXPR: case NOP_EXPR: /* These have already decayed to rvalue. */ break; - + case CALL_EXPR: /* We have a special meaning for volatile void fn(). */ break; - + case INDIRECT_REF: { tree type = TREE_TYPE (expr); @@ -852,7 +852,7 @@ convert_to_void (tree expr, const char *implicit) == REFERENCE_TYPE; int is_volatile = TYPE_VOLATILE (type); int is_complete = COMPLETE_TYPE_P (complete_type (type)); - + if (is_volatile && !is_complete) warning (0, "object of incomplete type %qT will not be accessed in %s", type, implicit ? implicit : "void context"); @@ -862,16 +862,16 @@ convert_to_void (tree expr, const char *implicit) implicit ? implicit : "void context"); if (is_reference || !is_volatile || !is_complete) expr = TREE_OPERAND (expr, 0); - + break; } - + case VAR_DECL: { /* External variables might be incomplete. */ tree type = TREE_TYPE (expr); int is_complete = COMPLETE_TYPE_P (complete_type (type)); - + if (TYPE_VOLATILE (type) && !is_complete) warning (0, "object %qE of incomplete type %qT will not be accessed in %s", expr, type, implicit ? implicit : "void context"); @@ -882,7 +882,7 @@ convert_to_void (tree expr, const char *implicit) } { tree probe = expr; - + if (TREE_CODE (probe) == ADDR_EXPR) probe = TREE_OPERAND (expr, 0); if (type_unknown_p (probe)) @@ -898,7 +898,7 @@ convert_to_void (tree expr, const char *implicit) warning (0, "%s is a reference, not call, to function %qE", implicit, expr); } - + if (expr != error_mark_node && !VOID_TYPE_P (TREE_TYPE (expr))) { if (implicit && warn_unused_value && !TREE_NO_WARNING (expr)) @@ -907,12 +907,12 @@ convert_to_void (tree expr, const char *implicit) been explicitly cast to void, so we must do so here. */ if (!TREE_SIDE_EFFECTS (expr)) warning (0, "%s has no effect", implicit); - else - { + else + { tree e; enum tree_code code; enum tree_code_class class; - + e = expr; /* We might like to warn about (say) "(int) f()", as the cast has no effect, but the compiler itself will @@ -931,7 +931,7 @@ convert_to_void (tree expr, const char *implicit) class = TREE_CODE_CLASS (code); if (class == tcc_comparison || class == tcc_unary - || (class == tcc_binary + || (class == tcc_binary && !(code == MODIFY_EXPR || code == INIT_EXPR || code == PREDECREMENT_EXPR @@ -991,7 +991,7 @@ convert_force (tree type, tree expr, int convtype) enum tree_code code = TREE_CODE (type); if (code == REFERENCE_TYPE) - return (fold_if_not_in_template + return (fold_if_not_in_template (convert_to_reference (type, e, CONV_C_CAST, LOOKUP_COMPLAIN, NULL_TREE))); @@ -1043,11 +1043,11 @@ build_expr_type_conversion (int desires, tree expr, bool complain) tree conv = NULL_TREE; tree winner = NULL_TREE; - if (expr == null_node - && (desires & WANT_INT) + if (expr == null_node + && (desires & WANT_INT) && !(desires & WANT_NULL)) warning (0, "converting NULL to non-pointer type"); - + basetype = TREE_TYPE (expr); if (basetype == error_mark_node) @@ -1070,7 +1070,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain) return (desires & WANT_FLOAT) ? expr : NULL_TREE; case POINTER_TYPE: return (desires & WANT_POINTER) ? expr : NULL_TREE; - + case FUNCTION_TYPE: case ARRAY_TYPE: return (desires & WANT_POINTER) ? decay_conversion (expr) @@ -1180,7 +1180,7 @@ type_promotes_to (tree type) } else if (type == float_type_node) type = double_type_node; - + return type; } @@ -1193,7 +1193,7 @@ type_promotes_to (tree type) to TYPE. Return the resulting expression, or error_mark_node if the conversion was impossible. */ -tree +tree perform_qualification_conversions (tree type, tree expr) { tree expr_type; diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 42435d026bc..9f813a586f5 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -147,7 +147,7 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) break; case OVERLOAD: - t = OVL_CURRENT (t); + t = OVL_CURRENT (t); case VAR_DECL: case PARM_DECL: case CONST_DECL: @@ -159,7 +159,7 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) case USING_DECL: case TEMPLATE_DECL: t = DECL_NAME (t); - + case IDENTIFIER_NODE: if (t == NULL) pp_cxx_identifier (pp, ""); @@ -383,7 +383,7 @@ static void pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) { enum tree_code code = TREE_CODE (t); - + switch (code) { case AGGR_INIT_EXPR: @@ -407,19 +407,19 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) tree object = code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t) ? TREE_OPERAND (t, 2) : TREE_VALUE (args); - + while (TREE_CODE (object) == NOP_EXPR) object = TREE_OPERAND (object, 0); if (TREE_CODE (object) == ADDR_EXPR) object = TREE_OPERAND (object, 0); - + if (TREE_CODE (TREE_TYPE (object)) != POINTER_TYPE) { pp_cxx_postfix_expression (pp, object); pp_cxx_dot (pp); } - else + else { pp_cxx_postfix_expression (pp, object); pp_cxx_arrow (pp); @@ -587,8 +587,8 @@ pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t) pp_right_bracket (pp); } pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0)); - break; - + break; + default: pp_unsupported_tree (pp, t); } @@ -626,7 +626,7 @@ pp_cxx_unary_expression (cxx_pretty_printer *pp, tree t) case VEC_DELETE_EXPR: pp_cxx_delete_expression (pp, t); break; - + case SIZEOF_EXPR: case ALIGNOF_EXPR: pp_cxx_identifier (pp, code == SIZEOF_EXPR ? "sizeof" : "__alignof__"); @@ -855,9 +855,9 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) pp_cxx_unqualified_id (pp, t); break; -#if 0 +#if 0 case OFFSET_REF: -#endif +#endif case SCOPE_REF: case PTRMEM_CST: pp_cxx_qualified_id (pp, t); @@ -884,9 +884,9 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) case STATIC_CAST_EXPR: case REINTERPRET_CAST_EXPR: case CONST_CAST_EXPR: -#if 0 +#if 0 case MEMBER_REF: -#endif +#endif case EMPTY_CLASS_EXPR: case TYPEID_EXPR: case PSEUDO_DTOR_EXPR: @@ -944,7 +944,7 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) default: pp_c_expression (pp_c_base (pp), t); - break; + break; } } @@ -996,7 +996,7 @@ pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t) pp_cxx_storage_class_specifier (pp, t); pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t)); break; - + case TYPE_DECL: pp_cxx_identifier (pp, "typedef"); pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t)); @@ -1193,7 +1193,7 @@ static void pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t) { tree args = TYPE_P (t) ? NULL : FUNCTION_FIRST_USER_PARM (t); - tree types = + tree types = TYPE_P (t) ? TYPE_ARG_TYPES (t) : FUNCTION_FIRST_USER_PARMTYPE (t); const bool abstract = args == NULL || pp_c_base (pp)->flags & pp_c_flag_abstract; @@ -1269,12 +1269,12 @@ pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t) } pp_cxx_abstract_declarator (pp, TREE_TYPE (t)); break; - + case FUNCTION_DECL: pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t))); pp_cxx_id_expression (pp, t); pp_cxx_parameter_declaration_clause (pp, t); - + if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t)) { pp_base (pp)->padding = pp_before; @@ -1421,7 +1421,7 @@ pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t) default: pp_c_direct_abstract_declarator (pp_c_base (pp), t); - break; + break; } } @@ -1545,7 +1545,7 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) handler handler-seq(opt) handler: - catch ( exception-declaration ) compound-statement + catch ( exception-declaration ) compound-statement exception-declaration: type-specifier-seq declarator @@ -1812,7 +1812,7 @@ pp_cxx_canonical_template_parameter (cxx_pretty_printer *pp, tree parm) if (code == TEMPLATE_TYPE_PARM || code == TEMPLATE_TEMPLATE_PARM || code == BOUND_TEMPLATE_TEMPLATE_PARM) parm = TEMPLATE_TYPE_PARM_INDEX (parm); - + pp_cxx_begin_template_argument_list (pp); pp_cxx_identifier (pp, "template-parameter-"); pp_wide_integer (pp, TEMPLATE_PARM_LEVEL (parm)); @@ -1887,7 +1887,7 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t) case 1: pp_cxx_template_declaration (pp, t); break; - + case 2: pp_cxx_explicit_specialization (pp, t); break; @@ -1905,7 +1905,7 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t) case TYPE_DECL: pp_cxx_simple_declaration (pp, t); break; - + case FUNCTION_DECL: if (DECL_SAVED_TREE (t)) pp_cxx_function_definition (pp, t); diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h index 4793de7a954..560b094f7c4 100644 --- a/gcc/cp/cxx-pretty-print.h +++ b/gcc/cp/cxx-pretty-print.h @@ -31,7 +31,7 @@ typedef enum { /* Ask for an qualified-id. */ pp_cxx_flag_default_argument = 1 << pp_c_flag_last_bit - + } cxx_pretty_printer_flags; typedef struct diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d9de22d97c9..1bf834ab517 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -633,14 +633,14 @@ poplevel (int keep, int reverse, int functionbody) else { tree name; - + /* Remove the binding. */ decl = link; if (TREE_CODE (decl) == TREE_LIST) decl = TREE_VALUE (decl); name = decl; - + if (TREE_CODE (name) == OVERLOAD) name = OVL_FUNCTION (name); @@ -1317,16 +1317,16 @@ duplicate_decls (tree newdecl, tree olddecl) else if (TREE_CODE (newdecl) == NAMESPACE_DECL) { /* In [namespace.alias] we have: - + In a declarative region, a namespace-alias-definition can be used to redefine a namespace-alias declared in that declarative region to refer only to the namespace to which it already refers. - + Therefore, if we encounter a second alias directive for the same alias, we can just ignore the second directive. */ if (DECL_NAMESPACE_ALIAS (newdecl) - && (DECL_NAMESPACE_ALIAS (newdecl) + && (DECL_NAMESPACE_ALIAS (newdecl) == DECL_NAMESPACE_ALIAS (olddecl))) return olddecl; /* [namespace.alias] @@ -1672,14 +1672,14 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_COMDAT (newdecl) |= DECL_COMDAT (olddecl); DECL_TEMPLATE_INSTANTIATED (newdecl) |= DECL_TEMPLATE_INSTANTIATED (olddecl); - + /* If the OLDDECL is an instantiation and/or specialization, then the NEWDECL must be too. But, it may not yet be marked as such if the caller has created NEWDECL, but has not yet figured out that it is a redeclaration. */ if (!DECL_USE_TEMPLATE (newdecl)) DECL_USE_TEMPLATE (newdecl) = DECL_USE_TEMPLATE (olddecl); - + /* Don't really know how much of the language-specific values we should copy from old to new. */ DECL_IN_AGGR_P (newdecl) = DECL_IN_AGGR_P (olddecl); @@ -1800,7 +1800,7 @@ duplicate_decls (tree newdecl, tree olddecl) COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl); /* Warn about conflicting visibility specifications. */ - if (DECL_VISIBILITY_SPECIFIED (olddecl) + if (DECL_VISIBILITY_SPECIFIED (olddecl) && DECL_VISIBILITY_SPECIFIED (newdecl) && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) { @@ -1820,7 +1820,7 @@ duplicate_decls (tree newdecl, tree olddecl) with that from NEWDECL below. */ if (DECL_LANG_SPECIFIC (olddecl)) { - gcc_assert (DECL_LANG_SPECIFIC (olddecl) + gcc_assert (DECL_LANG_SPECIFIC (olddecl) != DECL_LANG_SPECIFIC (newdecl)); ggc_free (DECL_LANG_SPECIFIC (olddecl)); } @@ -2465,7 +2465,7 @@ typename_compare (const void * k1, const void * k2) /* Build a TYPENAME_TYPE. If the type is `typename T::t', CONTEXT is the type of `T', NAME is the IDENTIFIER_NODE for `t'. - + Returns the new TYPENAME_TYPE. */ static GTY ((param_is (union tree_node))) htab_t typename_htab; @@ -2484,7 +2484,7 @@ build_typename_type (tree context, tree name, tree fullname, typename_htab = htab_create_ggc (61, &typename_hash, &typename_compare, NULL); - ti.scope = FROB_CONTEXT (context); + ti.scope = FROB_CONTEXT (context); ti.name = name; ti.template_id = fullname; ti.enum_p = tag_type == enum_type; @@ -2506,7 +2506,7 @@ build_typename_type (tree context, tree name, tree fullname, TYPENAME_TYPE_FULLNAME (t) = ti.template_id; TYPENAME_IS_ENUM_P (t) = ti.enum_p; TYPENAME_IS_CLASS_P (t) = ti.class_p; - + /* Build the corresponding TYPE_DECL. */ d = build_decl (TYPE_DECL, name, t); TYPE_NAME (TREE_TYPE (d)) = d; @@ -2517,7 +2517,7 @@ build_typename_type (tree context, tree name, tree fullname, /* Store it in the hash table. */ *e = t; } - + return t; } @@ -2641,7 +2641,7 @@ make_typename_type (tree context, tree name, enum tag_types tag_type, } /* Resolve `CONTEXT::template NAME'. Returns a TEMPLATE_DECL if the name - can be resolved or an UNBOUND_CLASS_TEMPLATE, unless an error occurs, + can be resolved or an UNBOUND_CLASS_TEMPLATE, unless an error occurs, in which case error_mark_node is returned. If PARM_LIST is non-NULL, also make sure that the template parameter @@ -3574,7 +3574,7 @@ start_decl (const cp_declarator *declarator, cp_decl_specifier_seq *declspecs, int initialized, tree attributes, - tree prefix_attributes, + tree prefix_attributes, tree *pushed_scope_p) { tree decl; @@ -3582,7 +3582,7 @@ start_decl (const cp_declarator *declarator, tree context; *pushed_scope_p = NULL_TREE; - + /* This should only be done once on the top most decl. */ if (have_extern_spec) { @@ -3615,7 +3615,7 @@ start_decl (const cp_declarator *declarator, if (context) { *pushed_scope_p = push_scope (context); - + /* We are only interested in class contexts, later. */ if (TREE_CODE (context) == NAMESPACE_DECL) context = NULL_TREE; @@ -3719,15 +3719,15 @@ start_decl (const cp_declarator *declarator, /* Do not mark DECL as an explicit specialization if it was not already marked as an instantiation; a declaration should never be marked as a specialization unless we know what - template is being specialized. */ + template is being specialized. */ if (DECL_LANG_SPECIFIC (decl) && DECL_USE_TEMPLATE (decl)) { SET_DECL_TEMPLATE_SPECIALIZATION (decl); - + /* [temp.expl.spec] An explicit specialization of a static data member of a template is a definition if the declaration includes an initializer; otherwise, it is a declaration. - + We check for processing_specialization so this only applies to the new specialization syntax. */ if (!DECL_INITIAL (decl) @@ -4362,7 +4362,7 @@ reshape_init (tree type, tree *initp) } /* If there are more initializers than necessary, issue a - diagnostic. */ + diagnostic. */ if (*initp) { if (brace_enclosed_p) @@ -4771,7 +4771,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) && !DECL_PRETTY_FUNCTION_P (decl) && !dependent_type_p (TREE_TYPE (decl))) maybe_deduce_size_from_array_init (decl, init); - + goto finish_end; } @@ -4802,7 +4802,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) } /* A reference will be modified here, as it is initialized. */ - if (! DECL_EXTERNAL (decl) + if (! DECL_EXTERNAL (decl) && TREE_READONLY (decl) && TREE_CODE (type) == REFERENCE_TYPE) { @@ -4843,7 +4843,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) DECL_INITIALIZED_IN_CLASS_P (decl) = 0; init = NULL_TREE; } - + /* Handle: [dcl.init] @@ -4933,7 +4933,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) else if (!TREE_STATIC (decl)) initialize_local_var (decl, init); } - + /* If a variable is defined, and then a subsequent definition with external linkage is encountered, we will get here twice for the same variable. We want to avoid @@ -4943,8 +4943,8 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) initializer. It is not legal to redeclare a static data member, so this issue does not arise in that case. */ if (var_definition_p && TREE_STATIC (decl)) - expand_static_init (decl, init); - } + expand_static_init (decl, init); + } } /* If a CLEANUP_STMT was created to destroy a temporary bound to a @@ -5273,7 +5273,7 @@ expand_static_init (tree decl, tree init) [stmt.dcl] - If the initialization exits by throwing an exception, the + If the initialization exits by throwing an exception, the initialization is not complete, so it will be tried again the next time control enters the declaration. @@ -5735,7 +5735,7 @@ grokfndecl (tree ctype, (processing_template_decl > template_class_depth (ctype)) ? current_template_parms - : NULL_TREE); + : NULL_TREE); if (old_decl && TREE_CODE (old_decl) == TEMPLATE_DECL) /* Because grokfndecl is always supposed to return a @@ -6359,7 +6359,7 @@ check_var_type (tree identifier, tree type) error ("variable or field declared void"); type = integer_type_node; } - + return type; } @@ -6534,13 +6534,13 @@ grokdeclarator (const cp_declarator *declarator, error ("declaration of %qD as non-function", decl); return error_mark_node; } - else if (!qualifying_scope + else if (!qualifying_scope && !(current_class_type && at_class_scope_p ())) { error ("declaration of %qD as non-member", decl); return error_mark_node; } - + type = TREE_OPERAND (decl, 0); name = IDENTIFIER_POINTER (constructor_name (type)); } @@ -6899,7 +6899,7 @@ grokdeclarator (const cp_declarator *declarator, error ("qualifiers are not allowed on declaration of %", ctor_return_type); - if (TREE_CODE (type) == FUNCTION_TYPE + if (TREE_CODE (type) == FUNCTION_TYPE && type_quals != TYPE_UNQUALIFIED) { /* This was an error in C++98 (cv-qualifiers cannot be added to @@ -7286,7 +7286,7 @@ grokdeclarator (const cp_declarator *declarator, || (quals && TREE_CODE (type) == METHOD_TYPE))) { tree dummy; - + /* If the type is a FUNCTION_TYPE, pick up the qualifiers from that function type. No other qualifiers may be supplied. */ @@ -7539,7 +7539,7 @@ grokdeclarator (const cp_declarator *declarator, if (!current_function_decl) DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace); else if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (current_function_decl) - || (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P + || (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (current_function_decl))) /* The TYPE_DECL is "abstract" because there will be clones of this constructor/destructor, and there will @@ -7643,7 +7643,7 @@ grokdeclarator (const cp_declarator *declarator, if (decl_context != TYPENAME) { /* A cv-qualifier-seq shall only be part of the function type - for a non-static member function. [8.3.5/4 dcl.fct] */ + for a non-static member function. [8.3.5/4 dcl.fct] */ if (cp_type_quals (type) != TYPE_UNQUALIFIED && (current_class_type == NULL_TREE || staticp) ) { @@ -7651,7 +7651,7 @@ grokdeclarator (const cp_declarator *declarator, (staticp? "static member" : "free")); type = TYPE_MAIN_VARIANT (type); } - + /* The qualifiers on the function type become the qualifiers on the non-static member function. */ quals |= cp_type_quals (type); @@ -7852,11 +7852,11 @@ grokdeclarator (const cp_declarator *declarator, /* Check that the name used for a destructor makes sense. */ if (sfk == sfk_destructor - && !same_type_p (TREE_OPERAND + && !same_type_p (TREE_OPERAND (id_declarator->u.id.unqualified_name, 0), ctype)) { - error ("declaration of %qD as member of %qT", + error ("declaration of %qD as member of %qT", id_declarator->u.id.unqualified_name, ctype); return error_mark_node; @@ -7922,8 +7922,8 @@ grokdeclarator (const cp_declarator *declarator, unqualified_id, virtualp, flags, quals, raises, friendp ? -1 : 0, friendp, 1, 0, sfk, - funcdef_flag, template_count, in_namespace, - attrlist); + funcdef_flag, template_count, in_namespace, + attrlist); if (decl == NULL_TREE) return NULL_TREE; } @@ -8476,7 +8476,7 @@ copy_fn_p (tree d) gcc_assert (DECL_FUNCTION_MEMBER_P (d)); - if (DECL_TEMPLATE_INFO (d) + if (DECL_TEMPLATE_INFO (d) && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (d))) /* Instantiations of template member functions are never copy functions. Note that member functions of templated classes are @@ -8767,7 +8767,7 @@ grok_op_properties (tree decl, bool complain) return; /* Warn about conversion operators that will never be used. */ - if (IDENTIFIER_TYPENAME_P (name) + if (IDENTIFIER_TYPENAME_P (name) && ! DECL_TEMPLATE_INFO (decl) && warn_conversion /* Warn only declaring the function; there is no need to @@ -9425,7 +9425,7 @@ xref_basetypes (tree ref, tree base_list) CLASSTYPE_REPEATED_BASE_P (ref) |= CLASSTYPE_REPEATED_BASE_P (basetype); } - + /* We must do this test after we've seen through a typedef type. */ if (TYPE_MARKED_P (basetype)) @@ -9688,7 +9688,7 @@ finish_enum (tree enumtype) /* Do not clobber shared ints. */ value = copy_node (value); - + TREE_TYPE (value) = enumtype; DECL_INITIAL (decl) = value; TREE_VALUE (values) = value; @@ -10149,7 +10149,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) DECL_NOT_REALLY_EXTERN (decl1) = 0; DECL_INTERFACE_KNOWN (decl1) = 1; /* If this function is in an interface implemented in this file, - make sure that the backend knows to emit this function + make sure that the backend knows to emit this function here. */ if (!DECL_EXTERNAL (decl1)) mark_needed (decl1); diff --git a/gcc/cp/decl.h b/gcc/cp/decl.h index b852c504113..a05fbef2ac6 100644 --- a/gcc/cp/decl.h +++ b/gcc/cp/decl.h @@ -31,6 +31,6 @@ enum decl_context }; /* We need this in here to get the decl_context definition. */ -extern tree grokdeclarator (const cp_declarator *, - const cp_decl_specifier_seq *, +extern tree grokdeclarator (const cp_declarator *, + const cp_decl_specifier_seq *, enum decl_context, int, tree*); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 0501b809b80..c8f09f91e34 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -256,7 +256,7 @@ maybe_retrofit_in_chrg (tree fn) QUALS are the qualifiers for the this pointer. */ void -grokclassfn (tree ctype, tree function, enum overload_flags flags, +grokclassfn (tree ctype, tree function, enum overload_flags flags, cp_cv_quals quals) { tree fn_name = DECL_NAME (function); @@ -355,9 +355,9 @@ grok_array_decl (tree array_expr, tree index_exp) else p2 = build_expr_type_conversion (WANT_POINTER, index_exp, false); - i1 = build_expr_type_conversion (WANT_INT | WANT_ENUM, array_expr, + i1 = build_expr_type_conversion (WANT_INT | WANT_ENUM, array_expr, false); - i2 = build_expr_type_conversion (WANT_INT | WANT_ENUM, index_exp, + i2 = build_expr_type_conversion (WANT_INT | WANT_ENUM, index_exp, false); if ((p1 && i2) && (i1 && p2)) @@ -447,7 +447,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete) return build1 (NOP_EXPR, void_type_node, t); if (doing_vec) - return build_vec_delete (t, /*maxindex=*/NULL_TREE, + return build_vec_delete (t, /*maxindex=*/NULL_TREE, sfk_deleting_destructor, use_global_delete); else @@ -472,26 +472,26 @@ check_member_template (tree tmpl) { if (current_function_decl) /* 14.5.2.2 [temp.mem] - + A local class shall not have member templates. */ error ("invalid declaration of member template %q#D in local class", decl); - + if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl)) { /* 14.5.2.3 [temp.mem] A member function template shall not be virtual. */ - error + error ("invalid use of % in template declaration of %q#D", decl); DECL_VIRTUAL_P (decl) = 0; } /* The debug-information generating code doesn't know what to do - with member templates. */ + with member templates. */ DECL_IGNORED_P (tmpl) = 1; - } + } else error ("template declaration of %q#D", decl); } @@ -552,7 +552,7 @@ check_java_method (tree method) arg_types = TREE_CHAIN (arg_types); if (DECL_HAS_VTT_PARM_P (method)) arg_types = TREE_CHAIN (arg_types); - + for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types)) { tree type = TREE_VALUE (arg_types); @@ -569,7 +569,7 @@ check_java_method (tree method) /* Sanity check: report error if this function FUNCTION is not really a member of the class (CTYPE) it is supposed to belong to. TEMPLATE_PARMS is used to specify the template parameters of a member - template passed as FUNCTION_DECL. If the member template is passed as a + template passed as FUNCTION_DECL. If the member template is passed as a TEMPLATE_DECL, it can be NULL since the parameters can be extracted from the declaration. If the function is not a function template, it must be NULL. @@ -581,7 +581,7 @@ check_classfn (tree ctype, tree function, tree template_parms) { int ix; bool is_template; - + if (DECL_USE_TEMPLATE (function) && !(TREE_CODE (function) == TEMPLATE_DECL && DECL_TEMPLATE_SPECIALIZATION (function)) @@ -589,10 +589,10 @@ check_classfn (tree ctype, tree function, tree template_parms) /* Since this is a specialization of a member template, we're not going to find the declaration in the class. For example, in: - + struct S { template void f(T); }; template <> void S::f(int); - + we're not going to find `S::f(int)', but there's no reason we should, either. We let our callers know we didn't find the method, but we don't complain. */ @@ -602,8 +602,8 @@ check_classfn (tree ctype, tree function, tree template_parms) either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */ if (TREE_CODE (function) == TEMPLATE_DECL) { - gcc_assert (!template_parms - || comp_template_parms (template_parms, + gcc_assert (!template_parms + || comp_template_parms (template_parms, DECL_TEMPLATE_PARMS (function))); template_parms = DECL_TEMPLATE_PARMS (function); } @@ -619,13 +619,13 @@ check_classfn (tree ctype, tree function, tree template_parms) bool is_conv_op; tree pushed_scope; const char *format = NULL; - + pushed_scope = push_scope (ctype); for (fndecls = VEC_index (tree, methods, ix); fndecls; fndecls = OVL_NEXT (fndecls)) { tree p1, p2; - + fndecl = OVL_CURRENT (fndecls); p1 = TYPE_ARG_TYPES (TREE_TYPE (function)); p2 = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); @@ -633,8 +633,8 @@ check_classfn (tree ctype, tree function, tree template_parms) /* We cannot simply call decls_match because this doesn't work for static member functions that are pretending to be methods, and because the name may have been changed by - asm("new_name"). */ - + asm("new_name"). */ + /* Get rid of the this parameter on functions that become static. */ if (DECL_STATIC_FUNCTION_P (fndecl) @@ -645,17 +645,17 @@ check_classfn (tree ctype, tree function, tree template_parms) declaration. */ if (is_template != (TREE_CODE (fndecl) == TEMPLATE_DECL)) continue; - + if (same_type_p (TREE_TYPE (TREE_TYPE (function)), TREE_TYPE (TREE_TYPE (fndecl))) && compparms (p1, p2) && (!is_template - || comp_template_parms (template_parms, + || comp_template_parms (template_parms, DECL_TEMPLATE_PARMS (fndecl))) && (DECL_TEMPLATE_SPECIALIZATION (function) == DECL_TEMPLATE_SPECIALIZATION (fndecl)) && (!DECL_TEMPLATE_SPECIALIZATION (function) - || (DECL_TI_TEMPLATE (function) + || (DECL_TI_TEMPLATE (function) == DECL_TI_TEMPLATE (fndecl)))) break; } @@ -767,7 +767,7 @@ finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree, if (init != NULL_TREE && TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))) { static int explained = 0; - + error ("initializer invalid for static member with constructor"); if (!explained) { @@ -805,8 +805,8 @@ finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree, CHANGES TO CODE IN `start_method'. */ tree -grokfield (const cp_declarator *declarator, - cp_decl_specifier_seq *declspecs, +grokfield (const cp_declarator *declarator, + cp_decl_specifier_seq *declspecs, tree init, tree asmspec_tree, tree attrlist) { @@ -816,7 +816,7 @@ grokfield (const cp_declarator *declarator, if (!declspecs->any_specifiers_p && declarator->kind == cdk_id - && declarator->u.id.qualifying_scope + && declarator->u.id.qualifying_scope && TREE_CODE (declarator->u.id.unqualified_name) == IDENTIFIER_NODE) /* Access declaration */ return do_class_using_decl (declarator->u.id.qualifying_scope, @@ -919,7 +919,7 @@ grokfield (const cp_declarator *declarator, init = digest_init (TREE_TYPE (value), init, (tree *)0); else init = integral_constant_value (init); - + if (init != error_mark_node && ! TREE_CONSTANT (init)) { /* We can allow references to things that are effectively @@ -951,7 +951,7 @@ grokfield (const cp_declarator *declarator, switch (TREE_CODE (value)) { case VAR_DECL: - finish_static_data_member_decl (value, init, asmspec_tree, + finish_static_data_member_decl (value, init, asmspec_tree, flags); return value; @@ -970,7 +970,7 @@ grokfield (const cp_declarator *declarator, set_user_assembler_name (value, asmspec); if (!DECL_FRIEND_P (value)) grok_special_member_properties (value); - + cp_finish_decl (value, init, asmspec_tree, flags); /* Pass friends back this way. */ @@ -979,7 +979,7 @@ grokfield (const cp_declarator *declarator, DECL_IN_AGGR_P (value) = 1; return value; - + default: gcc_unreachable (); } @@ -990,7 +990,7 @@ grokfield (const cp_declarator *declarator, WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node. */ tree -grokbitfield (const cp_declarator *declarator, +grokbitfield (const cp_declarator *declarator, cp_decl_specifier_seq *declspecs, tree width) { tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL); @@ -1074,8 +1074,8 @@ build_anon_union_vars (tree type, tree object) if (TREE_CODE (type) != UNION_TYPE) error ("anonymous struct not inside named type"); - for (field = TYPE_FIELDS (type); - field != NULL_TREE; + for (field = TYPE_FIELDS (type); + field != NULL_TREE; field = TREE_CHAIN (field)) { tree decl; @@ -1106,7 +1106,7 @@ build_anon_union_vars (tree type, tree object) if (DECL_NAME (field)) { decl = build_decl (ALIAS_DECL, DECL_NAME (field), TREE_TYPE (field)); - DECL_INITIAL (decl) = ref; + DECL_INITIAL (decl) = ref; TREE_PUBLIC (decl) = 0; TREE_STATIC (decl) = 0; DECL_EXTERNAL (decl) = 1; @@ -1143,7 +1143,7 @@ finish_anon_union (tree anon_union_decl) /* The VAR_DECL's context is the same as the TYPE's context. */ DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type)); - + if (TYPE_FIELDS (type) == NULL_TREE) return; @@ -1188,7 +1188,7 @@ coerce_new_type (tree type) tree args = TYPE_ARG_TYPES (type); gcc_assert (TREE_CODE (type) == FUNCTION_TYPE); - + if (!same_type_p (TREE_TYPE (type), ptr_type_node)) { e = 1; @@ -1224,7 +1224,7 @@ coerce_delete_type (tree type) { int e = 0; tree args = TYPE_ARG_TYPES (type); - + gcc_assert (TREE_CODE (type) == FUNCTION_TYPE); if (!same_type_p (TREE_TYPE (type), void_type_node)) @@ -1282,7 +1282,7 @@ mark_vtable_entries (tree decl) we output the vtables that contain them. With vcall offsets, we know all the thunks we'll need when we emit a virtual function, so we emit the thunks there instead. */ - if (DECL_THUNK_P (fn)) + if (DECL_THUNK_P (fn)) use_thunk (fn, /*emit_p=*/0); mark_used (fn); } @@ -1296,17 +1296,17 @@ comdat_linkage (tree decl) { if (flag_weak) make_decl_one_only (decl); - else if (TREE_CODE (decl) == FUNCTION_DECL + else if (TREE_CODE (decl) == FUNCTION_DECL || (TREE_CODE (decl) == VAR_DECL && DECL_ARTIFICIAL (decl))) /* We can just emit function and compiler-generated variables statically; having multiple copies is (for the most part) only - a waste of space. + a waste of space. There are two correctness issues, however: the address of a template instantiation with external linkage should be the same, independent of what translation unit asks for the address, and this will not hold when we emit multiple copies of - the function. However, there's little else we can do. + the function. However, there's little else we can do. Also, by default, the typeinfo implementation assumes that there will be only one copy of the string used as the name for @@ -1342,8 +1342,8 @@ comdat_linkage (tree decl) /* For win32 we also want to put explicit instantiations in linkonce sections, so that they will be merged with implicit - instantiations; otherwise we get duplicate symbol errors. - For Darwin we do not want explicit instantiations to be + instantiations; otherwise we get duplicate symbol errors. + For Darwin we do not want explicit instantiations to be linkonce. */ void @@ -1490,7 +1490,7 @@ decl_needed_p (tree decl) return true; /* If this entity was used, let the back-end see it; it will decide whether or not to emit it into the object file. */ - if (TREE_USED (decl) + if (TREE_USED (decl) || (DECL_ASSEMBLER_NAME_SET_P (decl) && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))) return true; @@ -1536,7 +1536,7 @@ maybe_emit_vtables (tree ctype) /* If the references to this class' vtables are optimized away, still emit the appropriate debugging information. See dfs_debug_mark. */ - if (DECL_COMDAT (primary_vtbl) + if (DECL_COMDAT (primary_vtbl) && CLASSTYPE_DEBUG_REQUESTED (ctype)) note_debug_info_needed (ctype); return false; @@ -1552,7 +1552,7 @@ maybe_emit_vtables (tree ctype) if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0) { tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl)); - + /* It had better be all done at compile-time. */ gcc_assert (!expr); } @@ -1778,7 +1778,7 @@ import_export_decl (tree decl) else if (CLASSTYPE_INTERFACE_KNOWN (class_type)) { /* CLASS_TYPE is being exported from this translation unit, - so DECL should be defined here. */ + so DECL should be defined here. */ if (!flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (class_type)) /* If a class is declared in a header with the "extern template" extension, then it will not be instantiated, @@ -1829,7 +1829,7 @@ import_export_decl (tree decl) wherever it is used. */ && flag_rtti) import_p = true; - else + else { if (CLASSTYPE_INTERFACE_KNOWN (type) && !CLASSTYPE_INTERFACE_ONLY (type)) @@ -1856,7 +1856,7 @@ import_export_decl (tree decl) data member. */ if (flag_implicit_templates || (flag_implicit_inline_templates - && TREE_CODE (decl) == FUNCTION_DECL + && TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))) comdat_p = true; else @@ -1874,7 +1874,7 @@ import_export_decl (tree decl) { DECL_NOT_REALLY_EXTERN (decl) = ! (CLASSTYPE_INTERFACE_ONLY (ctype) - || (DECL_DECLARED_INLINE_P (decl) + || (DECL_DECLARED_INLINE_P (decl) && ! flag_implement_inlines && !DECL_VINDEX (decl))); @@ -1922,7 +1922,7 @@ import_export_decl (tree decl) && DECL_VISIBILITY_SPECIFIED (decl) && (!class_type || !CLASSTYPE_VISIBILITY_SPECIFIED (class_type))) targetm.cxx.determine_class_data_visibility (decl); - + DECL_INTERFACE_KNOWN (decl) = 1; } @@ -1976,7 +1976,7 @@ get_guard (tree decl) as an integer counter. */ guard_type = targetm.cxx.guard_type (); guard = build_decl (VAR_DECL, sname, guard_type); - + /* The guard should have the same linkage as what it guards. */ TREE_PUBLIC (guard) = TREE_PUBLIC (decl); TREE_STATIC (guard) = TREE_STATIC (decl); @@ -1984,7 +1984,7 @@ get_guard (tree decl) DECL_ONE_ONLY (guard) = DECL_ONE_ONLY (decl); if (TREE_PUBLIC (decl)) DECL_WEAK (guard) = DECL_WEAK (decl); - + DECL_ARTIFICIAL (guard) = 1; DECL_IGNORED_P (guard) = 1; TREE_USED (guard) = 1; @@ -2003,11 +2003,11 @@ get_guard_bits (tree guard) { /* We only set the first byte of the guard, in order to leave room for a mutex in the high-order bits. */ - guard = build1 (ADDR_EXPR, + guard = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (guard)), guard); - guard = build1 (NOP_EXPR, - build_pointer_type (char_type_node), + guard = build1 (NOP_EXPR, + build_pointer_type (char_type_node), guard); guard = build1 (INDIRECT_REF, char_type_node, guard); } @@ -2084,7 +2084,7 @@ start_objects (int method_type, int initp) else sprintf (type, "%c", method_type); - fndecl = build_lang_decl (FUNCTION_DECL, + fndecl = build_lang_decl (FUNCTION_DECL, get_file_function_name_long (type), build_function_type (void_type_node, void_list_node)); @@ -2181,7 +2181,7 @@ static splay_tree priority_info_map; nonzero, it performs initializations. Otherwise, it performs destructions. It only performs those initializations or destructions with the indicated __PRIORITY. The generated function - returns no value. + returns no value. It is assumed that this function will only be called once per translation unit. */ @@ -2205,7 +2205,7 @@ start_static_storage_duration_function (unsigned count) type = build_function_type (void_type_node, parm_types); /* Create the FUNCTION_DECL itself. */ - ssdf_decl = build_lang_decl (FUNCTION_DECL, + ssdf_decl = build_lang_decl (FUNCTION_DECL, get_identifier (id), type); TREE_PUBLIC (ssdf_decl) = 0; @@ -2253,7 +2253,7 @@ start_static_storage_duration_function (unsigned count) function as: static void __ssdf (int __initialize_p, init __priority_p); - + It is static because we only need to call this function from the various constructor and destructor functions for this module. */ start_preparsed_function (ssdf_decl, @@ -2293,7 +2293,7 @@ get_priority_info (int priority) priority_info pi; splay_tree_node n; - n = splay_tree_lookup (priority_info_map, + n = splay_tree_lookup (priority_info_map, (splay_tree_key) priority); if (!n) { @@ -2353,7 +2353,7 @@ start_static_initialization_or_destruction (tree decl, int initp) the conversion functions, or the destructor called to create and destroy a static data member is performed as if these calls appeared in the scope of the member's - class. + class. we pretend we are in a static member function of the class of which the DECL is a member. */ @@ -2362,7 +2362,7 @@ start_static_initialization_or_destruction (tree decl, int initp) DECL_CONTEXT (current_function_decl) = DECL_CONTEXT (decl); DECL_STATIC_FUNCTION_P (current_function_decl) = 1; } - + /* Conditionalize this initialization on being in the right priority and being initializing/finalizing appropriately. */ guard_if_stmt = begin_if_stmt (); @@ -2381,7 +2381,7 @@ start_static_initialization_or_destruction (tree decl, int initp) might be initialized in more than one place. (For example, a static data member of a template, when the data member requires construction.) */ - if (TREE_PUBLIC (decl) && (DECL_COMMON (decl) + if (TREE_PUBLIC (decl) && (DECL_COMMON (decl) || DECL_ONE_ONLY (decl) || DECL_WEAK (decl))) { @@ -2406,14 +2406,14 @@ start_static_initialization_or_destruction (tree decl, int initp) destructions only if the GUARD is one, i.e., if we are the last to destroy the variable. */ else if (initp) - guard_cond + guard_cond = cp_build_binary_op (EQ_EXPR, build_unary_op (PREINCREMENT_EXPR, guard, /*noconvert=*/1), integer_one_node); else - guard_cond + guard_cond = cp_build_binary_op (EQ_EXPR, build_unary_op (PREDECREMENT_EXPR, guard, @@ -2540,7 +2540,7 @@ prune_vars_needing_no_initialization (tree *vars) /* Also, if the initializer already contains errors, we can bail out now. */ - if (init && TREE_CODE (init) == TREE_LIST + if (init && TREE_CODE (init) == TREE_LIST && value_member (error_mark_node, init)) { var = &TREE_CHAIN (t); @@ -2596,7 +2596,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, #else locus->line++; #endif - + /* We use `I' to indicate initialization and `D' to indicate destruction. */ function_key = constructor_p ? 'I' : 'D'; @@ -2616,7 +2616,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, /* Call the static storage duration function with appropriate arguments. */ - for (i = 0; VEC_iterate (tree, ssdf_decls, i, fndecl); ++i) + for (i = 0; VEC_iterate (tree, ssdf_decls, i, fndecl); ++i) { /* Calls to pure or const functions will expand to nothing. */ if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE))) @@ -2625,7 +2625,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, body = start_objects (function_key, priority); arguments = tree_cons (NULL_TREE, - build_int_cst (NULL_TREE, priority), + build_int_cst (NULL_TREE, priority), NULL_TREE); arguments = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, constructor_p), @@ -2641,7 +2641,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, { tree fns; - for (fns = constructor_p ? static_ctors : static_dtors; + for (fns = constructor_p ? static_ctors : static_dtors; fns; fns = TREE_CHAIN (fns)) { @@ -2718,7 +2718,7 @@ cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, vtbl = TREE_CHAIN (vtbl)) mark_decl_referenced (vtbl); } - else if (DECL_CONTEXT (t) + else if (DECL_CONTEXT (t) && TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL) /* If we need a static variable in a function, then we need the containing function. */ @@ -2818,7 +2818,7 @@ cp_finish_file (void) static storage duration. (Local objects with static storage duration are initialized when their scope is first entered, and are cleaned up via atexit.) - o Virtual function tables. + o Virtual function tables. All of these may cause others to be needed. For example, instantiating one function may cause another to be needed, and @@ -2829,7 +2829,7 @@ cp_finish_file (void) emit_support_tinfos (); - do + do { tree t; tree decl; @@ -2853,12 +2853,12 @@ cp_finish_file (void) reconsider = true; keyed_classes = TREE_CHAIN (keyed_classes); } - + t = keyed_classes; if (t != NULL_TREE) { tree next = TREE_CHAIN (t); - + while (next) { if (maybe_emit_vtables (TREE_VALUE (next))) @@ -2868,7 +2868,7 @@ cp_finish_file (void) } else t = next; - + next = TREE_CHAIN (t); } } @@ -2950,7 +2950,7 @@ cp_finish_file (void) locus.line++; #endif } - + /* Go through the set of inline functions whose bodies have not been emitted yet. If out-of-line copies of these functions are required, emit them. */ @@ -3023,7 +3023,7 @@ cp_finish_file (void) reconsider = true; /* Static data members are just like namespace-scope globals. */ - for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i) + for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i) { if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)) continue; @@ -3039,7 +3039,7 @@ cp_finish_file (void) reconsider = true; retries++; - } + } while (reconsider); /* All used inline functions must have a definition at this point. */ @@ -3068,19 +3068,19 @@ cp_finish_file (void) TREE_PUBLIC (decl) = 1; } } - + /* We give C linkage to static constructors and destructors. */ push_lang_context (lang_name_c); /* Generate initialization and destruction functions for all priorities for which they are required. */ if (priority_info_map) - splay_tree_foreach (priority_info_map, + splay_tree_foreach (priority_info_map, generate_ctor_and_dtor_functions_for_priority, /*data=*/&locus); else { - + if (static_ctors) generate_ctor_or_dtor_function (/*constructor_p=*/true, DEFAULT_INIT_PRIORITY, &locus); @@ -3127,7 +3127,7 @@ cp_finish_file (void) dump_end (TDI_tu, stream); } } - + timevar_pop (TV_VARCONST); if (flag_detailed_statistics) @@ -3198,7 +3198,7 @@ build_offset_ref_call_from_tree (tree fn, tree args) return build_min_non_dep (CALL_EXPR, expr, orig_fn, orig_args, NULL_TREE); return expr; } - + void check_default_args (tree x) @@ -3232,23 +3232,23 @@ mark_used (tree decl) { if (DECL_DEFERRED_FN (decl)) return; - + /* Remember the current location for a function we will end up synthesizing. Then we can inform the user where it was required in the case of error. */ if (DECL_ARTIFICIAL (decl) && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl) && !DECL_THUNK_P (decl)) DECL_SOURCE_LOCATION (decl) = input_location; - + note_vague_linkage_fn (decl); } - + assemble_external (decl); /* Is it a synthesized method that needs to be synthesized? */ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl) - && DECL_ARTIFICIAL (decl) + && DECL_ARTIFICIAL (decl) && !DECL_THUNK_P (decl) && ! DECL_INITIAL (decl) /* Kludge: don't synthesize for default args. Unfortunately this @@ -3270,8 +3270,8 @@ mark_used (tree decl) if ((DECL_NON_THUNK_FUNCTION_P (decl) || TREE_CODE (decl) == VAR_DECL) && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl) && (!DECL_EXPLICIT_INSTANTIATION (decl) - || (TREE_CODE (decl) == FUNCTION_DECL - && DECL_INLINE (DECL_TEMPLATE_RESULT + || (TREE_CODE (decl) == FUNCTION_DECL + && DECL_INLINE (DECL_TEMPLATE_RESULT (template_for_substitution (decl)))))) /* We put off instantiating functions in order to improve compile times. Maintaining a stack of active functions is expensive, diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index daf55952c53..8e7ac443795 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -186,7 +186,7 @@ dump_op (dump_info_p di, tree t) dump_string (di, "subs"); break; case POSTINCREMENT_EXPR: - dump_string (di, "postinc"); + dump_string (di, "postinc"); break; case POSTDECREMENT_EXPR: dump_string (di, "postdec"); @@ -257,7 +257,7 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("bfld", TYPE_CONTEXT (t)); return true; } - + if (! IS_AGGR_TYPE (t)) break; @@ -270,12 +270,12 @@ cp_dump_tree (void* dump_info, tree t) int i; tree binfo; tree base_binfo; - + for (binfo = TYPE_BINFO (t), i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) { dump_child ("base", BINFO_TYPE (base_binfo)); - if (BINFO_VIRTUAL_P (base_binfo)) + if (BINFO_VIRTUAL_P (base_binfo)) dump_string (di, "virtual"); dump_access (di, base_binfo); } @@ -293,7 +293,7 @@ cp_dump_tree (void* dump_info, tree t) dump_access (di, t); if (TREE_STATIC (t) && !TREE_PUBLIC (t)) dump_string (di, "static"); - break; + break; case FUNCTION_DECL: if (!DECL_THUNK_P (t)) @@ -302,7 +302,7 @@ cp_dump_tree (void* dump_info, tree t) dump_string (di, "operator"); dump_op (di, t); } - if (DECL_FUNCTION_MEMBER_P (t)) + if (DECL_FUNCTION_MEMBER_P (t)) { dump_string (di, "member"); dump_access (di, t); @@ -327,7 +327,7 @@ cp_dump_tree (void* dump_info, tree t) else { tree virt = THUNK_VIRTUAL_OFFSET (t); - + dump_string (di, "thunk"); if (DECL_THIS_THUNK_P (t)) dump_string (di, "this adjusting"); @@ -393,7 +393,7 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("args", TREE_OPERAND (t, 1)); dump_child ("decl", TREE_OPERAND (t, 2)); break; - + case HANDLER: dump_stmt (di, t); dump_child ("parm", HANDLER_PARMS (t)); diff --git a/gcc/cp/error.c b/gcc/cp/error.c index c897b64f919..5ed081833af 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -348,8 +348,8 @@ dump_type (tree t, int flags) } case TYPENAME_TYPE: pp_cxx_cv_qualifier_seq (cxx_pp, t); - pp_cxx_identifier (cxx_pp, - TYPENAME_IS_ENUM_P (t) ? "enum" + pp_cxx_identifier (cxx_pp, + TYPENAME_IS_ENUM_P (t) ? "enum" : TYPENAME_IS_CLASS_P (t) ? "class" : "typename"); dump_typename (t, flags); @@ -481,7 +481,7 @@ dump_aggr_type (tree t, int flags) Arrays must also do this for DECL nodes, like int a[], and for things like int *[]&. */ -static void +static void dump_type_prefix (tree t, int flags) { if (TYPE_PTRMEMFUNC_P (t)) @@ -722,7 +722,7 @@ dump_decl (tree t, int flags) && TREE_CODE (TREE_TYPE (t)) == TEMPLATE_TYPE_PARM) /* Say `class T' not just `T'. */ pp_cxx_identifier (cxx_pp, "class"); - + dump_type (TREE_TYPE (t), flags); break; } @@ -826,7 +826,7 @@ dump_decl (tree t, int flags) dump_decl (DECL_NAME (t), flags); break; } - + /* If there's only one function, just treat it like an ordinary FUNCTION_DECL. */ t = OVL_CURRENT (t); @@ -848,7 +848,7 @@ dump_decl (tree t, int flags) case TEMPLATE_ID_EXPR: { tree name = TREE_OPERAND (t, 0); - + if (is_overloaded_fn (name)) name = DECL_NAME (get_first_fn (name)); dump_decl (name, flags); @@ -1214,7 +1214,7 @@ dump_template_parms (tree info, int primary, int flags) if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args)) args = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1); - + len = TREE_VEC_LENGTH (args); for (ix = 0; ix != len; ix++) @@ -1223,7 +1223,7 @@ dump_template_parms (tree info, int primary, int flags) if (ix) pp_separate_with_comma (cxx_pp); - + if (!arg) pp_identifier (cxx_pp, "