OSDN Git Service

gcc/cp:
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
index ab3da7f..9ea3fe3 100644 (file)
@@ -1,3 +1,475 @@
+2004-09-23  Zack Weinberg  <zack@codesourcery.com>
+
+       * decl.c (grokfndecl): If ::main is found not to return int,
+       correct it after issuing a diagnostic.
+       (grokdeclarator): If the incoming type was error_mark_node, do
+       not complain about declaring something with no type.
+       (start_function): Change check for ::main not returning int to
+       an assertion, as grokfndecl now catches this when the user did it.
+       * init.c (perform_member_init, sort_mem_initializers)
+       (emit_mem_initializers): Make most diagnostics be issued on
+       the line of current_function_decl, not whatever the current
+       input line is.
+       * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
+       definition and declaration with #ifdef ENABLE_CHECKING.
+       Avoid unnecessary use of fprintf.
+       (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
+       definitions to avoid warnings.
+       (cp_lexer_new_main): Add assertion that first token is not a
+       padding token.
+       (cp_lexer_new_from_token_array): Fold into ...
+       (cp_lexer_new_from_tokens): ... here.  Add assertion that
+       first token is not a padding token.
+       (cp_lexer_set_source_position_from_token): Move nearer to callers.
+       Remove unused lexer argument.
+       (cp_lexer_peek_token): Just print debugging report (if enabled)
+       and return lexer->next_token.
+       (cp_lexer_skip_purged_tokens): Delete.
+       (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
+       inline, simplify bodies.
+       (cp_lexer_peek_nth_token): Add debugging report a la
+       cp_lexer_peek_token.
+       (cp_lexer_consume_token): Correct commentary.  Advance over
+       purged tokens here.  Set current source position here, from
+       token to be returned.  Avoid unnecessary use of fprintf.
+       (cp_lexer_purge_token): Advance next_token pointer over this and
+       subsequent purged tokens.
+       (cp_parser_error): Adjust source position to that of the
+       peeked token.
+       (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
+       (cp_parser_string_literal): Remove some excessive cleverness.
+       (cp_parser_enum_specifier): Call start_enum before consuming
+       the opening brace.
+       (cp_parser_member_declaration): Make the "extra semicolon"
+       diagnostic consistently-worded with the other place this is
+       diagnosed.  Explicitly set the diagnostic location to the
+       location of the offending semicolon.
+       (cp_parser_enclosed_template_argument_list): Use %</%> quoting
+       in diagnostics.  Do not use cp_parser_require.  Set location
+       of diagnostics about improper use of '>>' to location of
+       offending token.
+       (cp_parser_late_parsing_for_member):
+       Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
+       (cp_parser_late_parsing_default_args): Likewise.  Manually
+       move some logic outside the loop.
+
+2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/17618
+       * cvt.c (cp_convert_to_pointer): Return early when the type is
+       an error_mark_node.
+
+2004-09-21 Fariborz Jahanian <fjahanian@apple.com>
+
+       PR c++/13989
+       PR c++/9844
+       * decl.c (grokfndecl): Add new argument "attrlist", use it
+       to call cplus_decl_attributes.
+       (start_function): Remove call to cplus_decl_attributes.
+       * cvt.c (ocp_convert): Add support to use type conversion
+       function to vector type.
+       * parser.c (cp_parser_conversion_type_id): Add attributes, if any,
+       to the parsed type.
+
+2004-09-23  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR c++/17596
+
+       * parser.c (cp_parser_token_tree_map_node,
+       cp_parser_pm_expression, cp_parser_additive_expression,
+       cp_parser_multiplicative_expression, cp_parser_shift_expression,
+       cp_parser_relational_expression, cp_parser_equality_expression,
+       cp_parser_and_expression, cp_parser_exclusive_or_expression,
+       cp_parser_inclusive_or_expression,
+       cp_parser_logical_and_expression,
+       cp_parser_logical_or_expression): Removed.
+       (enum cp_parser_prec, struct cp_parser_token_tree_map_node,
+       binops, binops_by_token): New.
+       (cp_parser_assignment_expression): Use cp_parser_binary_expression.
+       (cp_parser_new): Initialize binops_by_token.
+       (cp_parser_binary_expression): Rewritten.
+       (N_CP_TTYPES): New.
+
+2004-09-23  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * parser.c: Fix a comment typo.
+
+2004-09-23  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/17620
+       * decl.c (xref_basetypes): Look through typedefs before checking
+       for duplicate base.
+
+2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
+       * decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
+       * rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
+       (init_rtti_processing): Initialize it to something realistic.
+       (get_tinfo_decl): Adjust pushing the new decl.
+
+       * cp-tree.h (struct lang_type_class): Remove marked flags, add
+       diamond_shaped and repeated_base flags.  Reorder to keep 8-bit blocks.
+       (TYPE_MARKED_P): New.
+       (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New.
+       (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
+       CLEAR_CLASSTYPE_MARKED_N): Remove.
+       (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*,
+       CLEAR_CLASSTYPE_MARKED_*): Remove.
+       * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond
+       shaped and repeated base properties.
+       * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET.
+       * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark,
+       class_hint_flags): Remove.
+       (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
+       CLASSTYPE_DIAMOND_SHAPED_P.
+
+2004-09-21  Ziemowit Laski  <zlaski@apple.com>
+
+       * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
+       cp-objcp-common.h.
+       (objcp_tsubst_copy_and_build): Reformat function signature.
+       * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
+       (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.
+
+2004-09-21  Zack Weinberg  <zack@codesourcery.com>
+
+       * parser.c (cp_lexer_peek_token, cp_lexer_consume_token):
+       Don't handle CPP_PRAGMA tokens specially.
+       (cp_lexer_handle_pragma): Use cp_lexer_consume_token.  Don't
+       purge the token; do clear token->value after processing.  Add
+       assertion at beginning that token->value is nonzero.
+       (cp_parser_statement, cp_parser_declaration_seq_opt): Handle
+       CPP_PRAGMA as a full statement or declaration in its own right.
+
+2004-09-21  Matt Austern  <austern@apple.com>
+
+       PR c++/15049
+       * decl.c (grokvardecl): Accept declarations of global variables
+       using anonymous types.
+
+2004-09-21  Roger Sayle  <roger@eyesopen.com>
+
+       PR c++/7503
+       * tree.c (lvalue_p_1):  Disallow MIN_EXPR and MAX_EXPR as lvalues
+       if either operand has side-effects.
+       * typeck.c (rationalize_conditional_expr): Assert that neither
+       operand of MIN_EXPR or MAX_EXPR has side-effects.
+       (build_modify_expr):  Add support for MIN_EXPR and MAX_EXPR.
+       Check that the "lhs" is a valid lvalue, i.e. that neither operand
+       of a MIN_EXPR or MAX_EXPR has a side-effect.
+
+2004-09-21  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * cp-tree.h (struct lang_type_header): Remove
+       uses_multiple_inheritance field.
+       (TYPE_USES_MULTIPLE_INHERITANCE): Remove.
+       (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
+       (TYPE_USES_VIRTUAL_BASECLASSES): Remove.
+       (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
+       (TYPE_CONTAINS_VPTR_P): Likewise.
+       * call.c (add_template_candidate_real): Use
+       CLASSTYPE_VBASECLASSES.
+       (build_special_member_call): Likewise.
+       * class.c (finish_struct_bits): Remove
+       TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
+       bookkeeping.
+       (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
+       (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
+       bookkeeping.
+       (build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
+       (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
+       Likewise.
+       * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
+       TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
+       bookkeeping.
+       (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
+       * decl2.c (maybe_retrofit_in_chrg): Likewise.
+       * init.c (expand_member, push_base_cleanups): Likewise.
+       * pt.c (instantiate_class_template): Remove
+       TYPE_USES_MULTIPLE_INHERITANCE,
+       TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
+       bookkeeping.
+       * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
+       check.
+       * typeck2.c (process_init_constructor): Replace some sorrys with
+       asserts.
+
+2004-09-21  Andreas Tobler  <a.tobler@schweiz.ch>
+
+       * decl.c (reshape_init_array): Initialize max_index_cst to fix
+       bootstrap failure.
+
+2004-09-20  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/17530
+       * pt.c (tsubst): Fix parentheses to accomodate emacs.
+       (tsubst_baselink): If we get a single function, mark it as used.
+
+2004-09-20  Matt Austern <austern@apple.com>
+           Zack Weinberg  <zack@codesourcery.com>
+
+       * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
+       Apply lbasename to input_filename before passing to get_fileinfo.
+       * semantics.c (begin_class_definition): Likewise.
+       * lex.c (handle_pragma_interface): Apply get_fileinfo to the
+       correct filename.  Rename variables to be less confusing.
+       (handle_pragma_implementation): Likewise.  Disable "appears
+       after file is included" diagnostic.
+
+       * parser.c (struct cp_token): Add in_system_header fiag.
+       (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
+       (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
+       (CPP_NONE, cp_lexer_read_token): Delete.
+       (struct cp_lexer): Remove first_token, string_tokens,
+       main_lexer_p fields.  Clarify comments.
+       (struct cp_token_cache): Now just a pair of pointers.
+       (CP_LEXER_BUFFER_SIZE): New #define.
+       (CPP_PURGED): New fake token type.
+       (cp_lexer_new_from_token_array, cp_lexer_destroy)
+       (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
+       (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
+       New functions.
+       (cp_lexer_new_from_tokens): Now a simple wrapper around
+       cp_lexer_new_from_token_array.
+       (cp_lexer_set_source_position_from_token): Also update
+       in_system_header.
+       (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
+       Don't wrap round.
+       (cp_lexer_token_difference): Dont handle wrapping round.
+       (cp_lexer_new_main): Enable pragma deferral and raw strings,
+       read the entire translation unit through c_lex_with_flags into
+       this lexer's buffer, then turn raw strings back off again.
+       (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
+       (cp_lexer_get_preprocessor_token): No need to handle not being
+       the main lexer.  Set token->in_system_header too.
+       (cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
+       to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
+       (cp_lexer_peek_nth_token): Likewise.
+       (cp_lexer_purge_token): Mark the token PURGED, don't shift all
+       the other tokens down.
+       (cp_lexer_purge_tokens_after): Likewise.
+       (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
+       about there being no tokens.
+       (cp_lexer_print_token): Revise to give useful information on
+       all tokens.
+       (struct cp_parser): Add field translate_strings_p.
+       (cp_parser_new): Initialize it.
+       (cp_parser_translation_unit): Destroy the lexer when done.
+       (cp_parser_parameter_declaration): Restructure saving of
+       default arguments.
+       (cp_parser_save_member_function_body): Likewise.
+       (cp_parser_check_for_invalid_template_id)
+       (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
+       Adjust calls to cp_lexer_advance_token.
+       (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
+       No need to fiddle c_lex_string_translate.
+       (cp_parser_primary_expression, cp_parser_linkage_specification)
+       (cp_parser_asm_definition, cp_parser_asm_specification_opt)
+       (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
+       Use cp_parser_string_literal.
+       (cp_parser_attribute_list): Save and restore
+       parser->translate_strings_p, not c_lex_string_translate.
+       (cp_parser_cache_group): Delete.
+       (cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
+       not take a cache argument.
+
+2004-09-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       PR c++/14179
+       * decl.c (reshape_init): Extract array handling into...
+       (reshape_init_array): New function. Use integers instead of trees
+       for indices. Handle out-of-range designated initializers.
+
+2004-09-20  Steven Bosscher  <stevenb@suse.de>
+
+       * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
+       to null_node.
+
+2004-09-19  Mark Mitchell  <mark@codesourcery.com>
+
+       * decl2.c (determine_visibility): Allow class visibility
+       directives to override targetm.cxx.export_class_data.
+
+2004-09-18  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * call.c, semantics.c: Follow spelling conventions.
+       * class.c: Fix a comment typo.
+
+2004-09-16  Geoffrey Keating  <geoffk@apple.com>
+
+       PR pch/13361
+       * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
+       (handle_pragma_implementation): Likewise.
+
+2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
+           Zack Weinberg  <zack@codesourcery.com>
+
+       * cp-tree.def: Use tree_code_class enumeration constants
+       instead of code letters.
+       * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
+       * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
+       Update for new tree-class enumeration constants.
+
+2004-09-16  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/16002
+       * parser.c (cp_parser_simple_declaration): Commit to tentative
+       parses after seeing a decl-specifier.
+       (cp_parser_simple_declaration): Eliminate spurious message.
+       (cp_parser_init_declarator): Adjust error message.
+
+       PR c++/16029
+       * lex.c (unqualified_name_lookup_error): Mark the dummy
+       declaration as used.
+
+       PR c++/17501
+       * parser.c (cp_parser_nested_name_specifier): Do not resolve
+       typename types if the user explicitly said "typename".
+
+2004-09-16  Andrew MacLeod  <amacleod@redhat.com>
+
+       * error.c (dump_decl): Make sure there is lang_specific info before
+       checking for DTOR and CTOR decls.
+
+2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * class.c (copy_virtuals): Remove.
+       (build_primary_vtable): Use copy_list directly.
+       (build_secondary_vtable): Likewise.
+       (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
+       (create_vtable_ptr): Likewise.
+
+2004-09-16  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * search.c: Follow spelling conventions.
+
+2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * cp-tree.h (struct lang_type_class): Make pure_virtuals a
+       VEC(tree).
+       (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
+       comments.
+       * call.c (build_new_method_call): Don't confirm a pure virtual is
+       in CLASSTYPE_PURE_VIRTUALS.  Reorder checks. Make it a warning.
+       * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
+       (fixup_inline_methods, finish_struct): Likewise.
+       * decl.c (finish_method): Likewise.
+       * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
+       CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
+       * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
+       vector to avoid repeating the list in error messages.
+
+2004-09-15  Mark Mitchell  <mark@codesourcery.com>
+
+       * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
+       * cp-tree.h (cxx_comdat_group): Declare.
+       * decl.c (cxx_comdat_group): New function.
+
+2004-09-15  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * search.c (get_pure_virtuals): Remove unused variables.
+
+       * cp-tree.h (struct lang_decl_flags): Remove
+       needs_final_overrider.
+       (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
+       * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
+       * class.c (finish_struct_bits): Correct comment about
+       CLASSTYPE_PURE_VIRTUALS.
+       * search.c (get_pure_virtuals): Remove useless loop.
+
+2004-09-14  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/17324
+       * mangle.c (partially_mangled_name): New variable.
+       (partially_mangled_name_len): Likewise.
+       (save_partially_mangled_name): New function.
+       (restore_partially_mangled_name): Likewise.
+       (write_encoding): Save and restore partially mangled names around
+       calls to get_mostly_instantiated_function_type.
+       (write_unqualified_name): Likewise.
+
+2004-09-14  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * pt.c (unify): Replace gcc_unreachable with gcc_assert.
+
+2004-09-13  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/16162
+       * parser.c (cp_parser_id_expression): Correct value for
+       is_declarator.
+       (cp_parser_nested_name_specifier_opt): Look through typenames as
+       necessary.
+       (cp_parser_template_name): Honor check_dependency_p.
+
+       PR c++/16716
+       * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
+       Robustify.
+
+       PR c++/17327
+       * pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
+       gcc_unreacable.
+
+2004-09-12  Richard Henderson  <rth@redhat.com>
+
+       PR c++/16254
+       * semantics.c (maybe_cleanup_point_expr): Don't call fold.
+       * typeck.c (condition_conversion): Likewise.
+
+2004-09-11  Richard Henderson  <rth@redhat.com>
+
+       PR c++/17404
+       * pt.c (cur_stmt_expr): Move from tsubst_expr.
+       (tsubst_expr) <case STMT_EXPR>: Move ...
+       (tsubst_copy_and_build): ... here.
+
+2004-09-10  Zack Weinberg  <zack@codesourcery.com>
+
+       * cp-tree.h (interface_only, interface_unknown): Delete declarations;
+       comment explaining them moved to c-common.h.
+       * lex.c (interface_only, interface_unknown, extract_interface_info):
+       Delete definitions.
+       (cxx_finish): Don't reset interface_unknown.
+       (handle_pragma_interface): Don't set interface_only and
+       interface_unknown; just the like-named fields in finfo.
+       (handle_pragma_implementation): Adjust comment.
+       * decl2.c (cp_finish_file): Don't reset interface_only and
+       interface_unknown.
+       * method.c (synthesize_method): Don't reset interface_unknown or
+       call extract_interface_info.
+       * pt.c (pop_tinst_level): Don't call extract_interface_info.
+       * decl.c (start_cleanup_fn): Don't save or restore interface_only
+       and interface_unknown.
+       (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
+       and use the result instead of the interface_only/interface_unknown
+       globals.
+       (start_preparsed_function): Likewise.
+       * lex.c (cxx_make_type): Likewise.
+       * semantics.c (begin_class_definition): Likewise.
+       (expand_body): Don't call extract_interface_info.
+
+2004-09-10  Ziemowit Laski  <zlaski@apple.com>
+
+       * decl.c (objc_mark_locals_volatile): Make description of
+       routine more descriptive; only mark VAR_DECLs at each
+       binding level.
+
+2004-09-10  Richard Henderson  <rth@redhat.com>
+
+       PR c++/17386
+       * call.c (build_vfield_ref): Move...
+       * class.c (build_vfield_ref): ... here.  Convert datum to the
+       primary base containing the vptr.
+       (make_new_vtable): Simplify build_primary_vtable arguments.
+       (finish_struct_1): Do not duplicate TYPE_VFIELD.
+       * typeck.c (build_class_member_access_expr): Don't warn for
+       null object access to base fields.
+
+2004-09-10  Ziemowit Laski  <zlaski@apple.com>
+
+       * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
+       New functions, to be called from ObjC++.
+
 2004-09-10  Kazu Hirata  <kazu@cs.umass.edu>
 
        * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
 
 2004-08-25  Nathan Sidwell  <nathan@codesourcery.com>
 
-
        * call.c (convert_class_to_reference): Adjust build_int_cst calls.
        (build_user_type_conversion_1, convert_like_real,
        build_java_interface_fn_ref, build_special_member_call): Likewise.
 
        * repo.c (extract_string): Reset backquote after one character.
        (get_base_filename): Fix indentation.
+
 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
 
        * decl.c (cxx_init_decl_processing): Adjust