OSDN Git Service

PR c++/44017
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
index a3b7e52..31749dd 100644 (file)
@@ -1,3 +1,560 @@
+2010-05-10  Jason Merrill  <jason@redhat.com>
+
+       PR c++/44017
+       * semantics.c (baselink_for_fns): Revert earlier change.
+
+       PR c++/44045
+       * typeck.c (cp_build_modify_expr): Complain about assignment to
+       array from init list.
+
+2010-05-10  Fabien Chêne  <fabien.chene@gmail.com>
+
+       PR c++/43719
+       * decl.c (check_initializer): strip array type before checking for
+       uninitialized const or ref members.
+
+2010-05-07  Fabien Chêne  <fabien.chene@gmail.com>
+
+       PR c++/43951
+       * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
+       error count. Emit errors only if compain is true.
+       (build_new_1): Do not return error_mark_node if
+       diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
+       errors. Delay the check for user-provided constructor.
+       (perform_member_init): Adjust.
+       * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
+       prototype.
+
+2010-05-06  Magnus Fromreide  <magfr@lysator.liu.se>
+           Jason Merrill  <jason@redhat.com>
+
+       Add support for C++0x nullptr.
+       * cp-tree.def: Add NULLPTR_TYPE.
+       * cp-tree.h: Add nullptr_node.
+       (cp_tree_index): Add CPTI_NULLPTR.
+       (SCALAR_TYPE_P): Add NULLPTR_TYPE.
+       * call.c (null_ptr_cst_p): Handle nullptr.
+       (standard_conversion): Likewise.
+       (convert_arg_to_ellipsis): Likewise.
+       * mangle.c (write_type): Likewise.
+       * name-lookup.c (arg_assoc_type): Likewise.
+       * parser.c (cp_parser_primary_expression): Likewise.
+       * typeck.c (cp_build_binary_op): Likewise.
+       (build_reinterpret_cast_1): Likewise.
+       * error.c (dump_type): Likewise.
+       (dump_type_prefix, dump_type_suffix): Likewise.
+       * decl.c (cxx_init_decl_processing): Likewise.
+       * cxx-pretty-print.c (pp_cxx_constant): Likewise.
+       * cvt.c (ocp_convert): Likewise.
+       * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
+       nullptr_t tinfo in libsupc++.
+
+2010-05-06  Jason Merrill  <jason@redhat.com>
+
+       * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
+
+2010-04-22  Jakub Jelinek <jakub@redhat.com>
+           Dodji Seketeli <dodji@redhat.com>
+
+       PR c/18624
+       * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
+       Declare ...
+       * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
+       * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
+       (decay_conversion, perform_integral_promotions): Call rvalue_use.
+       (cp_build_unary_op): Call lvalue_use.
+       * decl.c (unused_but_set_errorcount): New variable.
+       (poplevel): Issue -Wunused-but-set-variable diagnostics.
+       (duplicate_decls): Merge DECL_READ_P flags.
+       (start_cleanup_fn): Set DECL_READ_P flag.
+       (finish_function): Issue -Wunused-but-set-parameter diagnostics.
+       * tree.c (rvalue): Call rvalue_use.
+       * pt.c (convert_nontype_argument): Likewise.
+       * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
+       finish_decltype_type): Likewise.
+       * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
+       (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
+       or rvalue_use depending on the expr.
+       * init.c (build_new, build_delete): Likewise.
+       * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
+
+2010-05-05  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43787
+       * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
+       * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
+
+2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/43028
+       * pt.c (unify): Check each elt for error_mark_node.
+
+2010-05-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/38064
+       * typeck.c (cp_build_binary_op): Allow enums for <> as well.
+
+2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/43705
+       * call.c (build_new_method_call): Return error_mark_node if fns is
+       NULL_TREE.
+
+2010-05-03  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/43953
+       * pt.c (most_specialized_class): Pretend we are processing
+       a template decl during the call to coerce_template_parms.
+
+2010-05-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42810
+       PR c++/43680
+       * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
+       from the selected underlying type unless -fstrict-enums.  Set
+       ENUM_UNDERLYING_TYPE to have the restricted range.
+       * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
+       * class.c (check_bitfield_decl): Likewise.
+
+2010-05-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR c++/43951
+       * init.c (build_new_1): Revert the accidental checkin in
+       revision 158918.
+
+2010-04-30  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43868
+       * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
+       (pp_cxx_type_specifier_seq): ...here.
+
+2010-04-30  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
+       * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
+
+2010-04-30  Shujing Zhao  <pearly.zhao@oracle.com>
+
+       PR c++/43779
+       * typeck.c (warn_args_num): New function.
+       (convert_arguments): Use warn_args_num to print the diagnostic
+       messages. 
+
+2010-04-29  Fabien Chêne  <fabien.chene@gmail.com>
+
+       PR c++/43890
+       * init.c (diagnose_uninitialized_cst_or_ref_member): check for
+       user-provided constructor while recursing.
+
+2010-04-28  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR c++/9335
+        * error.c (print_instantiation_partial_context_line): Handle
+       recursive instantiation.
+        (print_instantiation_partial_context): Likewise.
+
+2010-04-27  Jason Merrill  <jason@redhat.com>
+
+       * init.c (perform_member_init): Check CLASS_TYPE_P.
+
+2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
+
+       PR c++/29043
+       * init.c (perform_member_init): check for uninitialized const or
+       reference members, including array types.
+
+2010-04-24  Jason Merrill  <jason@redhat.com>
+
+       * tree.c (get_fns): Split out from get_first_fn.
+       * cp-tree.h: Declare it.
+       * search.c (shared_member_p): Use it.
+       * semantics.c (finish_qualified_id_expr): Simplify.
+       (finish_id_expression): Simplify.
+
+       * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
+       whenever object is NULL_TREE.  Don't do 'this' capture here.
+       (finish_qualified_id_expr): Pass NULL_TREE.
+       (finish_id_expression): Likewise.
+       (lambda_expr_this_capture): Likewise.
+
+       * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
+       rather than checking current_class_ref directly.
+       (finish_call_expr): Likewise.
+
+       PR c++/43856
+       * name-lookup.c (qualify_lookup): Disqualify lambda op().
+       * class.c (current_nonlambda_class_type): New fn.
+       * semantics.c (nonlambda_method_basetype): New.
+       * cp-tree.h: Declare them.
+       * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
+
+       * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
+
+       PR c++/43875
+       * semantics.c (lambda_return_type): Complain about
+       braced-init-list.
+
+       PR c++/43790
+       * tree.c (cv_unqualified): Handle error_mark_node.
+
+       PR c++/41468
+       * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
+       if we don't want errors.
+
+       PR c++/41468
+       * class.c (convert_to_base): Add complain parameter.  Pass
+       ba_quiet to lookup_base if we don't want errors.
+       (build_vfield_ref): Pass complain to convert_to_base.
+       * call.c (convert_like_real): Likewise.
+       (initialize_reference): Likewise.
+       (perform_direct_initialization_if_possible): Pass complain to
+       convert_like_real.
+       * cp-tree.h: Adjust.
+
+2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
+           Jason Merrill  <jason@redhat.com>
+
+       PR c++/42844
+       * decl.c (check_for_uninitialized_const_var): Handle classes that need
+       constructing, too.
+       (check_initializer): Call it for classes that need constructing, too.
+       * class.c (in_class_defaulted_default_constructor): New.
+       * cp-tree.h: Declare it.
+
+2010-04-20  Jason Merrill  <jason@redhat.com>
+
+       PR c++/9335
+       * init.c (constant_value_1): Treat error_mark_node as a constant
+       if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
+       * cvt.c (ocp_convert): Handle getting error_mark_node from
+       integral_constant_value.
+       * decl.c (compute_array_index_type): Likewise.
+
+2010-04-20  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/43800
+       PR c++/43704
+       * typeck.c (incompatible_dependent_types_p): If one of the
+       compared types if not a typedef then honour their main variant
+       equivalence.
+
+2010-04-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
+
+2010-04-19  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/43704
+       * typeck.c (structural_comptypes): Test dependent typedefs
+       incompatibility before testing for their main variant based
+       equivalence.
+
+2010-04-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
+       ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
+
+2010-04-18  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * decl.c (cxx_init_decl_processing): Remove second argument in call to
+       build_common_tree_nodes.
+
+2010-04-14  Jason Merrill  <jason@redhat.com>
+
+       PR c++/36625
+       * parser.c (cp_parser_parenthesized_expression_list): Change
+       is_attribute_list parm to int to indicate whether or not to
+       handle initial identifier specially.
+       (cp_parser_attribute_list): Use attribute_takes_identifier_p.
+
+2010-04-13  Jason Merrill  <jason@redhat.com>
+
+       * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
+       CLASS_TYPE_P.
+       * parser.c (cp_parser_lambda_expression): Complain about lambda in
+       unevaluated context.
+       * pt.c (iterative_hash_template_arg): Don't crash on lambda.
+
+2010-04-12  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43641
+       * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
+       return value directly.
+
+       * call.c (type_decays_to): Call cv_unqualified for non-class type.
+
+2010-04-12  Fabien Chene  <fabien.chene@gmail.com>
+
+       PR c++/25811
+       * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
+       * init.c (build_new_1): Check for uninitialized const members and
+       uninitialized reference members, when using new without
+       new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
+       (diagnose_uninitialized_cst_or_ref_member): Define, call
+       diagnose_uninitialized_cst_or_ref_member_1.
+       (diagnose_uninitialized_cst_or_ref_member_1): New function.
+
+2010-04-12  Richard Guenther  <rguenther@suse.de>
+
+       PR c++/43611
+       * semantics.c (expand_or_defer_fn_1): Do not keep extern
+       template inline functions.
+
+2010-04-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR c++/28584
+       * typeck.c (cp_build_c_cast): Warn for casting integer to larger
+       pointer type.
+
+2010-04-07  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43016
+       * decl.c (start_preparsed_function): Do defer nested functions.
+
+       PR c++/11094, DR 408
+       * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
+       * decl2.c (finish_static_data_member_decl): Set it.
+       * decl.c (duplicate_decls): Propagate it.
+       * pt.c (tsubst_decl): Don't substitute the domain of an array
+       VAR_DECL if it's set.
+       (regenerate_decl_from_template): Substitute it here.
+       (type_dependent_expression_p): Return true if it's set.
+       * semantics.c (finish_decltype_type): Instantiate such a variable.
+       * typeck.c (cxx_sizeof_expr): Likewise.
+       (strip_array_domain): New.
+
+       PR c++/43145
+       * name-lookup.c (current_decl_namespace): Non-static.
+       (pop_nested_namespace): Sanity check.
+       * cp-tree.h: Declare current_decl_namespace.
+       * decl.c (grokvardecl): Use it instead of current_namespace.
+       (grokfndecl): Likewise.
+
+       PR c++/38392
+       * pt.c (tsubst_friend_function): Instatiate a friend that has already
+       been used.
+
+       * pt.c (print_template_statistics): New.
+       * cp-tree.h: Declare it.
+       * tree.c (cxx_print_statistics): Call it.
+
+       PR c++/41970
+       * decl.c (grokvardecl): Tweak warning message.
+       (grokfndecl): Likewise.
+
+2010-04-07  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/42697
+       *pt.c (tsubst_decl): Get the arguments of a specialization from
+       the specialization template, not from the most general template.
+
+2010-04-07  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/40239
+       * typeck2.c (process_init_constructor_record):
+       value-initialize members that are are not explicitely
+       initialized.
+
+2010-04-07  Jie Zhang  <jie@codesourcery.com>
+
+       PR c++/42556
+       * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
+       when all of its elements are non-constant and have been split out.
+
+2010-04-06  Taras Glek  <taras@mozilla.com>
+           Jason Merrill  <jason@redhat.com>
+
+       * parser.c (cp_parser_class_specifier): Set class location to that
+       of IDENTIFIER_NODE instead of '{' when possible.
+       * semantics.c (begin_class_definition): Do not overide locations
+       with less precise ones.
+
+2010-04-06  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43648
+       * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
+
+       PR c++/43621
+       * pt.c (maybe_update_decl_type): Check the return value from
+       push_scope.
+
+2010-04-01  Jason Merrill  <jason@redhat.com>
+
+       * decl.c (next_initializable_field): No longer static.
+       * cp-tree.h: Declare it.
+       * call.c (build_aggr_conv): Fail if there are more initializers
+       than initializable fields.
+
+       * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
+       instead of void_zero_node.
+
+2010-03-31  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/43558
+       * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
+       * pt.c (end_template_parm_list): Store sibling template parms of
+       each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
+       (push_template_decl_real): Don't store the containing template decl
+       into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
+       * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
+       of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
+       Simplify the logic.
+
+2010-03-30  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43076
+       * pt.c (push_template_decl_real): Deal better with running out of
+       scopes before running out of template parms.
+
+       PR c++/41185
+       PR c++/41786
+       * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
+       function parameter context.  Don't print an error if parsing
+       tentatively.
+
+       PR c++/43559
+       * pt.c (more_specialized_fn): Don't control cv-qualifier check
+       with same_type_p.
+
+2010-03-26  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43509
+       * parser.c (cp_parser_qualifying_entity): Do accept enum names in
+       c++0x mode, but not other type-names.
+
+2010-03-26  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/43327
+       * pt.c (add_to_template_args): Support NULL ARGS;
+       (most_specialized_class): call coerce_template_parms on
+       template arguments passed to get_class_bindings. Use
+       add_to_template_args.
+       (unify): Handle VAR_DECLs.
+
+2010-03-26  Dodji Seketeli  <dodji@redhat.com>
+
+       * cp-tree.h (get_template_parms_at_level): Change unsigned parm
+       into int.
+       * pt.c (get_template_parms_at_level): Adjust.
+
+2010-03-25  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/43206
+       * cp-tree.h (get_template_parms_at_level): Declare ...
+       * pt.c (get_template_parms_at_level): ... new function.
+       * typeck.c (get_template_parms_of_dependent_type): If a template
+       type parm's DECL_CONTEXT isn't yet set, get its siblings from
+       current_template_parms. Use get_template_parms_at_level. Remove
+       useless test.
+       (incompatible_dependent_types_p): If we get empty parms from just one
+       of the template type parms we are comparing then the template parms are
+       incompatible.
+
+2010-03-24  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43502
+       * parser.c (make_declarator): Initialize id_loc.
+       (cp_parser_lambda_declarator_opt): And set it.
+
+2010-03-23  Jason Merrill  <jason@redhat.com>
+
+       Make lambda conversion op and op() non-static.
+       * semantics.c (maybe_add_lambda_conv_op): Make non-static.
+       Also add the thunk function returned by the conversion op.
+       Mark the conversion deleted if the op() is variadic.
+       * decl2.c (mark_used): Give helpful message about deleted conversion.
+       * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
+       * semantics.c (finish_this_expr): Adjust.
+       * mangle.c (write_closure_type_name): Adjust.
+       * decl.c (grok_op_properties): Don't allow it.
+       * call.c (build_user_type_conversion_1): No static conversion ops.
+       (build_op_call): Or op().
+
+       * decl2.c (change_return_type): Fix 'this' quals.
+
+2010-03-22  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43333
+       * tree.c (pod_type_p): Use old meaning in C++98 mode.
+
+       PR c++/43281
+       * pt.c (contains_auto_r): New fn.
+       (do_auto_deduction): Use it.
+       (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
+
+2010-03-20  Simon Martin  <simartin@users.sourceforge.net>
+
+       PR c++/43081:
+       * decl2.c (grokfield): Handle invalid initializers for member
+       functions.
+
+2010-03-20  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/43375
+       * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
+       is NULL.
+       * decl2.c (vague_linkage_p): Likewise.
+
+2010-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/43418
+       * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
+       false, in the cp_parser_expression_statement call.
+
+2010-03-05  Jason Merrill  <jason@redhat.com>
+
+       * mangle.c (mangle_decl): Give name collision error even without
+       ASM_OUTPUT_DEF.
+
+2010-03-04  Marco Poletti  <poletti.marco@gmail.com>
+
+       * pt.c (process_partial_specialization): Use error_n instead of
+       error.
+
+2010-03-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/12909
+       * mangle.c (mangle_decl): Handle VAR_DECL, too.
+
+2010-03-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/12909
+       * mangle.c: Include cgraph.h.
+       (mangle_decl): If the mangled name will change in a later
+       ABI version, make the later mangled name an alias.
+       * method.c (make_alias_for): Copy DECL_ARGUMENTS.
+       * Make-lang.in (mangle.o): Depend on cgraph.h.
+       * method.c (make_alias_for): Handle VAR_DECL, too.
+       * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
+       * tree.c (no_linkage_check): Adjust.
+       * decl.c (maybe_commonize_var): Adjust.
+       * cp-tree.h: Adjust.
+
+2010-03-01  Marco Poletti  <poletti.marco@gmail.com>
+
+       * pt.c (redeclare_class_template): Use error_n and inform_n.
+
+2010-02-27  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/42748
+       * cp-tree.h (push_tinst_level): Declare.
+       (pop_tinst_level): Likewise.
+       * pt.c (push_tinst_level): Give it external linkage.
+       (pop_tinst_level): Likewise.
+       * mangle.c (mangle_decl_string): Set the source location to that
+       of the decl while mangling.
+
+2010-02-27  Simon Martin  <simartin@users.sourceforge.net>
+
+       PR c++/42054
+       * pt.c (redeclare_class_template): Return false if there are erroneous
+       template parameters.
+
+2010-02-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       * pt.c (push_tinst_level): Replace -ftemplate-depth- with 
+       -ftemplate-depth=.
+
 2010-02-24  Jason Merrill  <jason@redhat.com>
 
        PR c++/12909