OSDN Git Service

* call.c (joust): Don't warn about "confusing" conversions to the
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
index d264552..5bdc8f4 100644 (file)
@@ -1,7 +1,489 @@
+1998-07-14  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * call.c (joust): Don't warn about "confusing" conversions to the
+       same type.
+
+1998-07-14  Martin von Löwis  <loewis@informatik.hu-berlin.de>
+
+       * class.c (push_nested_class): Complain about namespaces.
+       * decl.c (start_decl): Enter the object's namespace.
+       (cp_finish_decl): Leave it.
+       (grokdeclarator): Likewise.
+       * decl2.c (check_decl_namespace): New function.
+       (finish_file): Call it.
+       * parse.y (complex_direct_notype_declarator): Set complexity
+       of namespace-qualified ids to -1, enter the namespace.
+
+       * method.c (build_template_decl_overload): Expect _DECL as first
+       parameter. Put context temporarily into current_namespace.
+       * pt.c (check_explicit_specialization): Change caller.
+       (tsubst): Likewise.
+
+       * init.c (build_offset_ref): Call mark_used and
+       convert_from_reference for namespace members.
+
+Mon Jul 13 23:25:28 1998  Martin von Lvwis  <loewis@informatik.hu-berlin.de>
+
+       * search.c (my_tree_cons): The bitfield is at index 2.
+
+Mon Jul 13 17:21:01 1998  Nick Clifton  <nickc@cygnus.com>
+
+       * lang-options.h: Format changed to work with new --help support
+       in gcc/toplev.c
+       
+1998-07-12  Martin von Löwis  <loewis@informatik.hu-berlin.de>
+
+       * decl2.c (build_expr_from_tree): Change calls of do_identifier.
+       Do Koenig lookup in CALL_EXPR.
+       (arg_assoc): Handle error_mark.
+       * lex.c (is_global): New function.
+       (do_identifier): Expect arguments for Koenig lookup.
+       * parse.y (primary): Add rules for calls of unqualified function calls.
+       (do_id): Change call of do_identifier.
+       * pt.c (finish_stmt_expr): Likewise.
+       * semantics.c (finish_id_expr): Likewise.
+       (finish_call_expr): Add integer parameter to indicate
+       argument-dependent lookup.
+
+       * decl.c (struct binding_level): New field using_directives.
+       (push_using_decl): Not sorry anymore.
+       (push_using_directive): New function.
+       (lookup_tag): Use CP_DECL_CONTEXT to iterate.
+       (unqualified_namespace_lookup): New function, code from ...
+       (lookup_name_real): ... here.
+       * decl2.c (lookup_using_namespace): Pass using list instead of
+       initial scope.
+       (validate_nonmember_using_decl): New function.
+       (do_nonmember_using_decl): New function.
+       (do_toplevel_using_decl): Use them.
+       (do_local_using_decl): New function.
+       (do_using_directive): Support block-level directives.
+       * parse.y (simple_stmt): Support using declarations and
+       directives.
+       (namespace_qualifier, namespace_using_decl): New non-terminals.
+
+       * xref.c (classname): New function.
+       (GNU_xref_hier): Change class and base parameters to tree.
+       * decl.c (xref_baseypes): Change caller.
+       * friend.c (make_friend_class): Likewise.
+
+1998-07-12  Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
+
+       * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter 
+       comparison.
+
+       * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a 
+       template template parameter, record its use.
+       (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse 
+       its template arguments if exists.
+
+       * pt.c (coerce_template_template_parms): New function equivalent
+       to coerce_template_parms when IS_TMPL_PARM is true.
+       (coerce_template_parms): Use it.  Remove the IS_TMPL_PARM parameter,
+       all callers changed.
+
+       (coerce_template_parms): Access ARGLIST properly when creating a
+       new vector.  Only accept implicit TYPE_DECL as valid argument for
+       a template template parameter when it is a base class of
+       current_class_type.  Don't display error message when COMPLAIN is
+       false.
+
+1998-07-12  Klaus Kaempf (kkaempf@progis.de)
+
+       * repo.c (get_base_filename): Use file_name_nondirectory.
+       (open_repo_file): Ditto.
+       * cp-tree.h (file_name_nondirectory): Add prototype.
+
+1998-07-12  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * friend.c (do_friend): Pull the identifier out of declarator.
+       Use cp_error and friends.
+       * decl2.c (qualified_lookup_using_namespace): Fix call to 
+       purpose_member.
+       * decl.c (lookup_name_real): Don't call complete_type on a namespace.
+       (grokvardecl): Use DECL_CLASS_SCOPE_P.
+       * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
+       * class.c (warn_hidden): Fix for OVERLOAD.
+       From grahams@rcp.co.uk:
+       * cp-tree.h (DEFARG_NODE_CHECK): New macro.
+       (DEFARG_LENGTH, DEFARG_POINTER): Use it.
+
+Sun Jul 12 01:20:57 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * g++.1 (-traditional): Remove duplicated documentation.
+
+1998-07-11  Mark Mitchell  <mark@markmitchell.com>
+
+       * method.c (flush_repeats): Add nrepeats parameter.
+       (issue_nrepeats): Likewise.
+       (is_back_referenceable_type): New function.  Don't back-reference
+       TEMPLATE_TYPE_PARMs as well as simple types like integers.
+       (build_mangled_name_for_type): Likewise.
+       (build_mangled_name_for_type_with_Gcode): Likewise.
+       (lasttype): Remove.
+       (nrepeats): Likewise.
+       (Nrepeats): Likewise.
+       (start_squangling): Don't clear the variables removed above.
+       (end_squangling): Likewise.
+       (flush_repeats): Tidy.  Use nrepeats parameter rather than
+       Nrepeats global.
+       (issue_nrepeats): Likewise, but with nrepeats global.  Use
+       is_backreferenceable_type.
+       (build_overload_nested_name): Tidy.  Add comment.  Use
+       build_mangled_name_for_type.
+       (build_underscore_int): Comment.
+       (build_overload_scope_ref): Use build_mangled_name_for_type.
+       (build_overload_int): Likewise.
+       (build_template_template_parm_names): Tidy.
+       (build_template_parm_names): Use build_mangled_name_for_type.
+       (build_overload_identifier): Add comments.
+       (build_mangled_name_for_type_with_Gcode): Split out from
+       build_mangled_name.
+       (build_mangled_name_for_type): Use it.
+       (build_mangled_name): Rework to use build_mangled_name_for_type
+       and to not use global nrepeats/Nrepeats.  Tidy.
+       (process_modifiers): Tidy.
+       (check_btype): Use is_backreferenceable_type.  Add comment.
+       Rename `node' to `type'.
+       (process_overload_item): Set numeric_output_need_bar here.
+       Use build_mangled_name_for_type.  Tidy.
+       (build_decl_overload_real): Tidy.  Don't use Nrepeats.  Use
+       build_mangled_name_for_type.
+
+       * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
+       for TYPE_DECLs.
+
+1998-07-08  Vladimir N. Makarov  <vmakarov@cygnus.com>
+
+       * cp-tree.h (warn_long_long): Define.
+       * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
+       warning "ANSI C++ does not support `long long'".
+       * decl2.c (warn_long_long): Define.
+       (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
+
+1998-07-07  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (xref_tag): Handle attributes between 'class' and name.
+       * parse.y (aggr): Likewise.
+       * semantics.c (finish_class_definition): Likewise.
+       * Makefile.in (EXPECTED): Adjust.
+
+       * cp-tree.h: Declare flag_optional_diags and warn_multichar.
+       * decl2.c: Define them.
+       (lang_decode_option): Handle them.
+       * lang-options.h: Add -foptional-diags.
+       * class.c (finish_struct): Don't complain about multiple meanings of 
+       name if -fno-optional-diags.
+       * decl.c (pushdecl_class_level): Likewise.
+       * lex.c (real_yylex): Check warn_multichar.
+
+1998-07-06  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (lookup_tag): Use CP_DECL_CONTEXT.
+
+       * tree.c (make_binfo): Fix length.
+
+1998-06-30  Benjamin Kosnik  <bkoz@bliss.nabi.net>
+
+        * decl2.c (lang_decode_option): Remove warn_template_debugging.
+        * lang-options.h: Ditto.
+
+Mon Jun 29 20:17:40 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * except.c (build_eh_type_type_ref): Remove unused variable `susp'.
+       (process_start_catch_block): Likewise for variables
+       `false_label_rtx', `call_rtx' and `return_value_rtx'.
+
+1998-06-29  Brendan Kehoe  <brendan@cygnus.com>
+
+       * tree.c (build_srcloc): Make sure we allocate this node on the
+       permanent obstack.
+
+Sat Jun 27 23:34:18 1998  Fred Fish  <fnf@ninemoons.com>
+
+       * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined.
+       (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY.
+       (lang_specific_driver): Only add -lm automatically if need_math is
+       nonzero.
+
+Sat Jun 27 12:22:56 1998  Jeffrey A Law  (law@cygnus.com)
+
+        * Make-lang.in (g++): Depend on mkstemp.o.  Link in mkstemp.o
+
+Sat Jun 27 07:36:09 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * Makefile.in (EXPR_H): New dependency variable.
+       (decl2.o): Depend on $(EXPR_H).
+       (typeck.o): Likewise.
+       (init.o): Likewise.
+       (expr.o): Likewise.
+
+1998-06-25  Benjamin Kosnik  <bkoz@lisa.cygnus.com>
+
+       * decl.c (start_enum): Put local enums on permanent_obstack.
+
+1998-06-25  Mark Mitchell  <mark@markmitchell.com>
+
+       * cp-tree.h (c_get_alias_set): Declare.
+       * decl.c (init_decl_processing): Set lang_get_alias_set.
+
+1998-06-25  Andrew MacLeod  <amacleod@cygnus.com>
+
+       * cp-tree.h (mark_all_runtime_matches): Add function prototype.
+       * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
+       flag for all function decls which are in the exception table. 
+       * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
+       * decl2.c (finish_file): Call mark_all_runtime_matches to make sure
+       code is emitted for any referenced rtti function.
+
+1998-06-25  Dave Brolley  <brolley@cygnus.com>
+
+       * lang-specs.h: Use new | syntax to eliminate
+       string concatenation.
+
+1998-06-25  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * cp-tree.h (CP_DECL_CONTEXT): New macro.
+       * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it.
+       * method.c (build_overload_nested_name): Likewise.
+       * sig.c (build_signature_pointer_or_reference_type): Don't set
+       DECL_CONTEXT.
+
+1998-06-24  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
+
+       Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace.
+       * cp-tree.h (FROB_CONTEXT): New macro.
+       (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE.
+       * decl.c (namespace_binding): Replace NULL_TREE with
+       global_namespace.
+       (set_namespace_binding, pop_namespace, lookup_name_real): Likewise.
+       * decl2.c (is_namespace_ancestor, lookup_using_namespace):
+       Likewise.
+       * decl.c (pushtag): Use FROB_CONTEXT.
+       (pushdecl, make_typename_type, define_function, grokdeclarator):
+       Likewise.
+       * decl2.c (set_decl_namespace, do_namespace_alias): Likewise.
+       * pt.c (push_template_decl_real, lookup_template_class, tsubst):
+       Likewise.
+       * decl2.c (decl_namespace): Return global_namespace if no context.
+       * method.c (build_overload_nested_name): Expect null as context.
+       * pt.c (mangle_class_name_for_template): Do nothing for null
+       contexts.
+       (lookup_template_class): Allow for null id_context.
+
+1998-06-25  Richard Henderson  <rth@cygnus.com>
+
+       * method.c (emit_thunk): Set current_function_is_thunk for the
+       ASM_OUTPUT_MI_THUNK case as well.
+
+1998-06-23  Andrew MacLeod  <amacleod@cygnus.com>
+
+       * exception.cc (__cplus_type_matcher): Get a match_info pointer
+       instead of an exception table entry as a parameter.
+
+1998-06-23  Andrew MacLeod  <amacleod@cygnus.com>
+
+       * parse.y (function_try_block): Don't call start_catch_handler.
+       * except.c (call_eh_info): Remove coerced field from declaration.
+       (build_eh_type_type_ref): New function to create an address of a
+       rtti function for the new style exception tables.
+       (expand_start_catch_block): Split function, this contains the
+       common part.
+       (process_start_catch_block_old): New function to perform the rest
+       of expand_start_catch_block under old style exceptions.
+       (process_start_catch_block_old): New function to perform the rest
+       of expand_start_catch_block under new style exceptions.
+       (expand_end_catch_block): Only pop the false label off the stack under
+       the old style of exceptions.
+       * semantics.c (finish_try_block): Don't call start_catch_handler.
+       * exception.cc (struct cp_eh_info): Add original_value field.
+       (__cplus_type_matcher): Perform type matching on the original exception
+       value, and if we have a match, set the current value.
+       (__cp_push_exception): Set the original expcetion value.
+
+1998-06-23  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * call.c (joust): Fix confusing conversion warning.
+
+       * call.c (build_op_delete_call): Add placement parm.  Check
+       LOOKUP_SPECULATIVELY.
+       * cp-tree.h, decl2.c, init.c: Adjust.
+       * decl.c (finish_function): Use it.
+
+       * pt.c (tsubst): Diagnose creating void fields or variables.
+
+Mon Jun 22 08:50:26 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * call.c (build_scoped_method_call): Remove unused variable `tmp'.
+
+       * cp-tree.h (check_dtor_name): Add prototype.
+
+       * init.c (expand_member_init): Remove unused variables
+       `ptr_type_node', `parm' and `rval'.
+
+       * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier
+       in call to fprintf.
+       (lang_print_xnode): Likewise.
+
+       * typeck2.c (enum_name_string): Cast argument to sprintf to long
+       and use %ld specifier.
+
+       * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC
+       specifier in call to fprintf.
+       (GNU_xref_member): Cast argument to sprintf to int.
+
+Fri Jun 19 23:22:42 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+        * typeck2.c (pop_init_level): Warn about implicit zero initialization
+        of struct members.
+
+Thu Jun 18 09:32:32 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * cp-tree.h: Prototype function `check_java_method'.
+
+1998-06-17  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * class.c (finish_struct): Make conflicting use of id a pedwarn.
+       * decl.c (pushdecl_class_level): Likewise.
+
+1998-06-17  Mark Mitchell  <mark@markmitchell.com>
+
+       * pt.c (convert_nontype_argument): Issue an error when presented
+       with an integer (real) constant that cannot be simplified to an
+       INT_CST (REAL_CST).
+
+       * cp-tree.h (c_get_alias_set): Remove declaration added in
+       1998-06-13 change that should never have been checked in.
+
+1998-06-17  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * typeck.c (build_binary_op_nodefault): Change % in format strings
+       to %%.
+
+       * decl.c (grokvardecl): Don't build_static_name for decls that
+       aren't at namespace scope.
+
+       * init.c (perform_member_init): Catch default-initialization of
+       references.
+
+1998-06-17  Mark Mitchell  <mark@markmitchell.com>
+
+       * errfn.c (cp_thing): Handle the `%%' formatting sequence.
+
+1998-06-17  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * method.c (hack_identifier): Complain about getting a namespace
+       or class template.
+       * typeck.c (decay_conversion): Remove check for namespaces.
+       * typeck2.c (incomplete_type_error): Likewise.
+       * parse.y (template_arg): Add PTYPENAME expansion.
+
+1998-06-16  Andrew MacLeod  <amacleod@cygnus.com>
+
+       * decl.c (grokvardecl): Don't build external assembler names for 
+       TYPENAMEs in other namespaces as there is no declarator.
+       * error.c (cp_file_of, cp_line_of): Don't extract file or line number
+       info from DECL_CONTEXT if it is NULL.
+
+1998-06-16  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * call.c (check_dtor_name): Split out.
+       (build_scoped_method_call): Use it.
+       (build_method_call): Use it.
+       * init.c (build_offset_ref): Use it.
+
+       * typeck.c (build_static_cast): Fix handling of pointers to members.
+
+       * decl.c (finish_function): Just return nothing from a constructor.
+       * typeck.c (c_expand_return): Complain about returning a void
+       expression from a destructor.
+
+1998-06-13  Mark Mitchell  <mark@markmitchell.com>
+
+       * class.c (alter_access): Accept a BINFO explaining how to get
+       from the entity whose accessed is being altered to the type doing
+       the altering.
+       (handle_using_decl): New function containing code split out from ...
+       (finish_struct_1): Here.
+
+       * cp-tree.h (complete_type_or_else): Declare.
+       * init.c (build_new_1, build_delete): Use it.
+       * typeck.c (require_complete_type): Use complete_type, rather than
+       expanding it inline.
+       (complete_type_or_else): New function.
+       (build_component_ref): Use it.
+       (pointer_int_sum): Make sure the type pointed to is complete.
+       (pointer_diff): Likewise.
+
+       * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for
+       types. 
+
+       * search.c (get_matching_virtual): Note that member templates
+       cannot override virtual functions.
+
+1998-06-12  Brendan Kehoe  <brendan@cygnus.com>
+
+       * pt.c (check_explicit_specialization): If DECLARATOR turned into
+       an error_mark_node from lookup_template_function, return the same.
+       (determine_specialization): Also make sure TEMPLATE_ID isn't an
+       error_mark_node, before we try to read its operands.
+       * decl.c (grokdeclarator): If we got an error_mark_node from
+       check_explicit_specialization, just return it right back.
+
+1998-06-12  Mark Mitchell  <mark@markmitchell.com>
+
+       * class.c (instantiate_type): Don't treat template-ids that don't
+       specify any template arguments as equivalent to ordinary
+       identifiers.  Use OFFSET_REF instead of SCOPE_REF to refer to
+       pointer-to-members for member templates.  Tidy slightly.
+       * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation.
+       * init.c (build_offset_ref): Handle template-ids like ordinary
+       identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the
+       offset part of the OFFSET_REF.
+       * typeck.c (build_unary_op): Change check for unknown types to
+       look for OFFSET_REFs, not SCOPE_REFs.
+
+1998-06-11  Mark Mitchell  <mark@markmitchell.com>
+
+       * pt.c (is_member_template_class): New function.
+       (push_template_decl_real): Use it.
+
+1998-06-11  Benjamin Kosnik  <bkoz@elmo.cygnus.com>
+
+       * friend.c (do_friend): Add support for nested classes using
+       member functions of the enclosing class as friends.
+
+1998-06-10  Mark Mitchell  <mark@markmitchell.com>
+
+       * call.c (convert_default_arg): Make global, not static.
+       (convert_arg_for_ellipsis): Split out from ...
+       (build_over_call): Here.
+       * cp-tree.h (convert_default_arg); Declare.
+       (convert_arg_to_ellipsis): Likewise.
+       (do_member_init): Remove.
+       * init.c (do_member_init): Remove; this code is dead.
+       (expand_member_init): Remove much of this code; it is dead.
+       * typeck.c (convert_arguments): Use convert_default_arg and
+       convert_arg_for_ellipsis, rather than duplicating here.
+       
+       * call.c (convert_like): Don't fail silently if 
+       build_user_type_conversion fails.  Always return error_mark_node 
+       for failure.
+
 1998-06-10  Jason Merrill  <jason@yorick.cygnus.com>
 
-       * call.c (build_scoped_method_call): Fix thinko.
-       (build_method_call): Likewise.
+       * search.c (covariant_return_p): Complain about ambiguous base.
+
+       * typeck.c (build_component_ref): Diagnose ref to nested type.
+
+1998-06-10  Brendan Kehoe  <brendan@cygnus.com>
+
+       * decl.c (grokparms): Check that INIT isn't an error_mark_node
+       before giving error about invalid type for default arg.
+
+1998-06-10  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * call.c (build_method_call): Fix thinko.
 
 1998-06-10  Dave Brolley  <brolley@cygnus.com>
 
 
 1998-06-10  Jason Merrill  <jason@yorick.cygnus.com>
 
-       * init.c (resolve_offset_ref): Handle default-initialization.
+       * init.c (perform_member_init): Handle default-initialization.
 
        * except.c (build_throw): Handle throwing NULL.