OSDN Git Service

/cp
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
index 6e4c35e..3c6268d 100644 (file)
@@ -1,3 +1,411 @@
+2010-06-30  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/44628
+       * typeck.c (cp_build_unary_op): Early return error_mark_node when
+       arg is NULL_TREE too.
+       * call.c (convert_class_to_reference): Return error_mark_node when
+       expr is NULL_TREE.
+
+2010-06-30  Michael Matz  <matz@suse.de>
+
+       * repo.c (finish_repo): Fix typo.
+
+2010-06-30  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
+
+2010-06-30  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * repo.c (pending_repo): Change type to a VEC.
+       (finish_repo): Adjust for new type of pending_repo.
+       (repo_emit_p): Likewise.
+
+2010-06-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       * tree.c: Include gimple.h. Do not include tree-flow.h
+       * decl.c: Do not include tree-flow.h
+       * Make-lang.in: Adjust dependencies.
+
+2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * decl.c (incomplete_var): Declare.  Declare VECs containing them.
+       (incomplete_vars): Adjust comment.  Change type to a VEC.
+       (maybe_register_incomplete_var): Adjust for new type.
+       (complete_vars): Adjust iteration over incomplete_vars.
+
+2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * decl.c (struct named_label_entry): Change type of bad_decls field
+       to a VEC.
+       (poplevel_named_label_1): Adjust for new type of bad_decls.
+       (check_goto): Likewise.
+
+2010-06-29  Jason Merrill  <jason@redhat.com>
+
+       Enable implicitly declared move constructor/operator= (N3053).
+       * class.c (add_implicitly_declared_members): A class with no
+       explicitly declared copy or move constructor gets both declared
+       implicitly, and similarly for operator=.
+       (check_bases): A type with no copy ctor does not inhibit
+       a const copy ctor in a derived class.  It does mean the derived
+       one is non-trivial.
+       (check_field_decl): Likewise.
+       (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
+       * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
+       (trivially_copyable_p): Likewise.
+       * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
+       * class.c (finish_struct_bits): Likewise.
+       * tree.c (build_target_expr_with_type): Likewise.
+       * typeck2.c (store_init_value): Likewise.
+
+       Enable implicitly deleted functions (N2346)
+       * class.c (check_bases_and_members): Adjust lambda flags.
+       * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
+
+       * decl2.c (mark_used): Adjust error for use of deleted function.
+
+       Machinery to support implicit delete/move.
+       * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
+       has_complex_move_ctor, has_complex_move_assign bitfields.
+       (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
+       (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
+       (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
+       (enum special_function_kind): Add sfk_move_assignment.
+       (LOOKUP_SPECULATIVE): New.
+       * call.c (build_over_call): Return early if it's set.
+       (build_over_call): Use trivial_fn_p.
+       * class.c (check_bases): If the base has no default constructor,
+       the derived one is non-trivial.  Handle move ctor/op=.
+       (check_field_decl): Likewise.
+       (check_bases_and_members): Handle move ctor/op=.
+       (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
+       (type_has_move_constructor, type_has_move_assign): New.
+       * decl.c (grok_special_member_properties): Handle move ctor/op=.
+       * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
+       (trivial_fn_p): New.
+       (do_build_copy_constructor): Use it.
+       (do_build_assign_ref): Likewise.  Handle move assignment.
+       (build_stub_type, build_stub_object, locate_fn_flags): New.
+       (locate_ctor): Use locate_fn_flags.
+       (locate_copy, locate_dtor): Remove.
+       (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
+       (process_subob_fn, synthesized_method_walk): New.
+       (maybe_explain_implicit_delete): New.
+       (implicitly_declare_fn): Use synthesized_method_walk,
+       type_has_trivial_fn, and type_set_nontrivial_flag.
+       (defaulted_late_check): Set DECL_DELETED_FN.
+       (defaultable_fn_check): Handle sfk_move_assignment.
+       (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early.  Don't declare
+       implicitly deleted move ctor/op=.
+       * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
+       (lookup_fnfields_slot): New.
+       * semantics.c (omp_clause_info_fndecl): Remove.
+       (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
+       get_copy_assign, trivial_fn_p.
+       (trait_expr_value): Adjust call to locate_ctor.
+       * tree.c (special_function_p): Handle sfk_move_assignment.
+
+       * class.c (type_has_virtual_destructor): New.
+       * cp-tree.h: Declare it.
+       * semantics.c (trait_expr_value): Use it.
+
+       * call.c (build_over_call): Only give warnings with tf_warning.
+
+       * name-lookup.c (pop_scope): Handle NULL_TREE.
+
+       * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
+       (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
+       (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
+       (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
+       (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
+       (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
+       (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
+       (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
+       (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
+       (sfk_assignment_operator): Rename to sfk_copy_assignment.
+       * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
+       * search.c, semantics.c, tree.c: Adjust.
+
+       * pt.c (dependent_scope_ref_p): Remove.
+       (value_dependent_expression_p): Don't call it.
+       (type_dependent_expression_p): Here either.
+       * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
+       if the scope isn't dependent.
+
+       * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
+       a reference.
+
+       PR c++/44587
+       * pt.c (has_value_dependent_address): New.
+       (value_dependent_expression_p): Check it.
+       (convert_nontype_argument): Likewise.  Call decay_conversion before
+       folding if we want a pointer.
+       * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
+       scope is the current instantiation.
+
+2010-06-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/44682
+       * class.c (build_base_path): If want_pointer, call mark_rvalue_use
+       on expr.
+
+2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * init.c: Do not include except.h.
+       * decl.c: Likewise.
+       * expr.c: Likewise.
+       * cp-lang.c: Likewise.
+       * pt.c: Likewise.
+       * semantics.c: Likewise.
+       * decl2.c: Likewise.
+       * except.c: Likewise.
+       (init_exception_processing): Do not set the removed
+       lang_protect_cleanup_actions here.
+       (cp_protect_cleanup_actions): Make non-static and remove prototype.
+       (doing_eh): New, moved from except.c but removed the do_warning flag.
+       (expand_start_catch_block): Update doing_eh call.
+       (expand_end_catch_block): Likewise.
+       (build_throw): Likewise.
+       * cp-tree.h: Prototype cp_protect_cleanup_actions.
+       * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
+       cp_protect_cleanup_actions.
+       * Make-lang.in: Update dependencies.
+
+2010-06-26  Jason Merrill  <jason@redhat.com>
+
+       * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
+       constructor called with a single argument that takes a reference
+       to the constructor's class.
+       (BAD_CONVERSION_RANK): New.
+       (compare_ics): Use it to compare bad ICSes.
+
+2010-06-25  Joseph Myers  <joseph@codesourcery.com>
+
+       * lang-specs.h: Remove +e handling.
+
+2010-06-24  Andi Kleen  <ak@linux.intel.com>
+
+       * parser.c: (cp_parser_question_colon_clause):
+        Switch to use cp_lexer_peek_token.
+        Call warn_for_omitted_condop. Call pedwarn for omitted
+        middle operand.
+
+2010-06-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/44619
+       * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
+       datum and mark_rvalue_use on component.
+
+       PR c++/44627
+       * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
+       the CALL_EXPR has no arguments.
+
+2010-06-21  Jason Merrill  <jason@redhat.com>
+
+       * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
+
+       * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
+       element type.
+
+2010-06-17  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * name-lookup.c (struct arg_lookup): Convert namespaces and
+       classes fields to VEC.
+       (arg_assoc_namespace): Adjust for new type of namespaces.
+       (arg_assoc_class): Adjust for new type of classes.
+       (lookup_arg_dependent): Use make_tree_vector and
+       release_tree_vector.
+       * typeck2.c (build_x_arrow): Use vec_member.
+
+2010-06-17  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR c++/44486
+       * error.c (dump_decl): Better wording for anonymous namespace.
+
+2010-06-16  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * class.c (build_vtbl_initializer): Adjust computation of new_position
+       and which entry to add padding for.
+
+2010-06-16  Jason Merrill  <jason@redhat.com>
+
+       * except.c (check_noexcept_r): Return the problematic function.
+       (finish_noexcept_expr): Give -Wnoexcept warning.  Add complain parm.
+       * pt.c (tsubst_copy_and_build): Pass it.
+       * parser.c (cp_parser_unary_expression): Likewise.
+       * cp-tree.h: Adjust prototype.
+
+       * method.c (defaulted_late_check): Give the defaulted method
+       the same exception specification as the implicit declaration.
+
+2010-06-15  Jason Merrill  <jason@redhat.com>
+
+       * class.c (add_implicitly_declared_members): Implicit assignment
+       operators can also be virtual overriders.
+       * method.c (lazily_declare_fn): Likewise.
+
+       * call.c (convert_like_real): Give "initializing argument of"
+       information for ambiguous conversion.  Give source position
+       of function.
+
+       * call.c (print_z_candidates): Do print viable deleted candidates.
+       (joust): Don't choose a deleted function just because its worst
+       conversion is better than another candidate's worst.
+
+       * call.c (convert_like_real): Don't complain about
+       list-value-initialization from an explicit constructor.
+
+       * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
+       DECL_SOURCE_LOCATION directly.
+
+       * class.c (type_has_user_provided_default_constructor): Use
+       sufficient_parms_p.
+
+       * call.c (is_subseq): Handle ck_aggr, ck_list.
+       (compare_ics): Treat an aggregate or ambiguous conversion to the
+       same type as involving the same function.
+
+2010-06-13  Shujing Zhao  <pearly.zhao@oracle.com>
+
+       * typeck.c (convert_for_assignment): Fix comment. Change message
+       format from %d to %qP.
+       (convert_for_initialization): Fix comment. 
+
+2010-06-11  Shujing Zhao  <pearly.zhao@oracle.com>
+
+       * cp-tree.h (expr_list_kind): New type.
+       (impl_conv_rhs): New type.
+       (build_x_compound_expr_from_list, convert_for_initialization): Adjust
+       prototype.
+       (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
+       diagnostics for easy translation. Change caller.
+       (convert_for_initialization): Use impl_conv_rhs and change caller.
+       (build_x_compound_expr_from_list): Use expr_list_kind and emit the
+       diagnostics for easy translation. Change caller.
+       * decl.c (bad_spec_place): New enum.
+       (bad_specifiers): Use it and emit the diagnostics for easy
+       translation. Change caller.
+       * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
+
+2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * cp-tree.h (struct saved_scope): Change decl_ns_list field type
+       to a VEC.
+       * decl2.c (cp_write_global_declarations): Adjust for new type of
+       decl_namespace_list.
+       * name-lookup.c (current_decl_namespace): Likewise.
+       (push_decl_namespace): Likewise.
+       (pop_decl_namespace): Likewise.
+
+2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * call.c (build_java_interface_fn_ref): Call build_function_type_list
+       instead of build_function_type.
+       * decl.c (cxx_init_decl_processing): Likewise.
+       (declare_global_var): Likewise.
+       (get_atexit_node): Likewise.
+       (expand_static_init): Likewise.
+       * decl2.c (start_objects): Likewise.
+       (start_static_storage_duration_function): Likewise.
+       * except.c (init_exception_processing): Likewise.
+       (build_exc_ptr): Likewise.
+       (build_throw): Likewise.
+       * rtti.c (throw_bad_cast): Likewise.
+       (throw_bad_typeid): Likewise.
+       (build_dynamic_cast_1): Likewise.
+
+2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
+       (build_op_delete_call): Likewise.
+       (build_over_call): Likewise.
+       * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
+       * pt.c (process_partial_specialization): Likewise.
+       (tsubst_template_args): Likewise.
+       * semantics.c (finish_asm_stmt): Likewise.
+
+2010-06-08  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * decl.c (record_key_method_defined): New, broken out of ...
+       (finish_function): ... here.  Call it.  
+       (start_decl): Treat aliases as definitions.
+
+2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
+
+       * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
+
+       * pt.c (maybe_process_partial_specialization): Likewise.
+       (register_specialization): Likewise.
+       (add_pending_template): Likewise.
+       (lookup_template_class): Likewise.
+       (push_tinst_level): Likewise.
+
+       * parser.c (cp_lexer_new_main): Likewise.
+       (cp_lexer_new_from_tokens): Likewise.
+       (cp_token_cache_new): Likewise.
+       (cp_parser_context_new): Likewise.
+       (cp_parser_new): Likewise.
+       (cp_parser_nested_name_specifier_opt): Likewise.
+       (cp_parser_template_id): Likewise.
+
+       * name-lookup.c (binding_entry_make): Likewise.
+       (binding_table_construct): Likewise.
+       (binding_table_new): Likewise.
+       (cxx_binding_make): Likewise.
+       (pushdecl_maybe_friend): Likewise.
+       (begin_scope): Likewise.
+       (push_to_top_level): Likewise.
+
+       * lex.c (init_reswords): Likewise.
+       (retrofit_lang_decl): Likewise.
+       (cxx_dup_lang_specific_decl): Likewise.
+       (copy_lang_type): Likewise.
+       (cxx_make_type): Likewise.
+
+       * decl.c (make_label_decl): Likewise.
+       (check_goto): Likewise.
+       (start_preparsed_function): Likewise.
+       (save_function_data): Likewise.
+
+       * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
+
+       * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
+
+       * class.c (finish_struct_1): Likewise.
+
+       * cp-tree.h (struct lang_type): Add variable_size GTY option.
+       (struct lang_decl): Likewise.
+
+       * parser.c (cp_parser_new): Update comment to not reference
+       ggc_alloc.
+
+2010-06-07  Jason Merrill  <jason@redhat.com>
+
+       PR c++/44366
+       * error.c (dump_parameters): Mask out TFF_SCOPE.
+       (dump_simple_decl): Don't print the scope of a PARM_DECL.
+       (dump_scope): Remove no-op mask.
+
+       PR c++/44401
+       * parser.c (cp_parser_lookup_name): Fix naming the constructor.
+
+       * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
+       * init.c (build_offset_ref): Use it.
+       * pt.c (maybe_process_partial_specialization): Use it.
+       (instantiate_class_template): Use it.
+       * search.c (lookup_base): Use it.
+
+2010-06-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/44444
+       * expr.c (mark_exp_read): Handle INDIRECT_REF.
+       * cvt.c (convert_to_void): Handle INDIRECT_REF like
+       handled_component_p.
+
+       PR c++/44443
+       * decl.c (initialize_local_var): If TREE_USED is set on the type,
+       set also DECL_READ_P on the decl.
+
 2010-05-25  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/44188
@@ -1617,3 +2025,4 @@ Copyright (C) 2010 Free Software Foundation, Inc.
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
+