X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fcp%2FChangeLog;h=9d0ac8cc9dc0467fba8e378db833b7e23235c358;hp=5349dc4abdec168988dec23f0ae455e1df1bbf67;hb=0664b4250483d9a279da4d63f157c4a3b2e8b966;hpb=2672c56c19f6ec7ce067e7804cb4cda03a696dfd diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5349dc4abde..9d0ac8cc9dc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,565 @@ +2007-04-13 Jason Merrill + + PR c++/31074 + * call.c (reference_binding): Add c_cast_p parm. If true, + add quals to TO as needed to make it reference-compatible. + +2007-04-11 Jan Hubicka + + * cp/class.c (convert_to_base_statically): Fold produced tree; verify + that we are not processing template_decl. + +2007-04-09 Mark Mitchell + + PR c++/31449 + * class.c (build_base_path): Ensure that the converted pointer has + the same cv-qualification as the input. + +2007-04-09 Paolo Carlini + + * tree.c (cp_tree_equal): Deal with TRAIT_EXPR. + +2007-04-08 Steven Bosscher + + * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS): + Do not set it. + (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it. + * tree.c (cp_add_pending_fn_decls): Remove. + * cp-tree.h (cp_add_pending_fn_decls): Remove prototype. + +2007-04-07 Daniel Berlin + + Revert change removing staticp. + +2007-04-06 Daniel Berlin + + * cp-objcp-common.c (cxx_staticp): Remove. + * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove. + * cp-tree.h (cxx_staticp): + +2007-04-04 Danny Smith + + * class.c (check_for_override): Don't remove dllmport attribute + of virtual methods. + +2007-04-03 Jakub Jelinek + + PR c++/30847 + * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void + type issue error and return early. + +2007-03-30 Jason Merrill + + PR c++/31187 + * typeck.c (cp_type_readonly): New fn. + * cp-tree.h: Declare it. + * decl.c (start_decl): Set implicit DECL_THIS_STATIC here. + (cp_finish_decl): Not here. + +2007-03-31 Richard Guenther + + * optimize.c (maybe_clone_body): Replace splay-tree usage by + pointer-map. + +2007-03-31 Douglas Gregor + + PR c++/31138 + PR c++/31140 + PR c++/31141 + * parser.c (declarator_can_be_parameter_pack): New. + (cp_parser_template_parameter): Only parse the `...' if the + declarator can be a parameter pack. + (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE + is NULL. + * pt.c (find_parameter_packs_r): Look into the bounds on integer + types (they could be used as array bounds). + (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX. + (tsubst_pack_expansion): Handle failure to expand parameter + packs. + +2007-03-30 Paolo Carlini + + PR c++/26099 + * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr, + TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add. + (enum cp_tree_node_structure_enum, union lang_tree_node): Update. + (CLASS_TYPE_NON_UNION_P): Add. + (struct lang_type_class): Add has_complex_dflt. + (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add. + (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare. + * cp-tree.def: Add TRAIT_EXPR. + * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case. + * lex.c (struct resword): Add __has_nothrow_assign, + __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign, + __has_trivial_constructor, __has_trivial_copy, + __has_trivial_destructor, __has_virtual_destructor, __is_abstract, + __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum, + __is_pod, __is_polymorphic, __is_union. + * parser.c (cp_parser_primary_expression): Deal with the new RIDs. + (cp_parser_trait_expr): New. + * semantics.c (finish_trait_expr, trait_expr_value + classtype_has_nothrow_copy_or_assign_p): New. + * method.c (locate_copy, locate_ctor, locate_dtor): Do not define + as static. + * decl.c (cp_tree_node_structure): Add TRAIT_EXPR. + * class.c (check_bases, check_field_decl, check_bases_and_members): + Deal with TYPE_HAS_COMPLEX_DFLT (t) too. + * pt.c (uses_template_parms, tsubst_copy_and_build, + value_dependent_expression_p, type_dependent_expression_p): Deal with + TRAIT_EXPR. + * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR. + +2007-03-29 Richard Guenther + + * tree.c (cp_walk_subtrees): Do not set input_location. + +2007-03-28 Simon Martin + + PR c++/29077 + * decl.c (grokfndecl): Properly setup decl if it is a constructor or a + destructor. + +2007-03-28 Douglas Gregor + + * parser.c (struct cp_parser): Update comment for + greater_than_is_operator_p. + (cp_parser_primary_expression): In C++0x mode, a cast operator can + be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P. + (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when + !GREATER_THAN_IS_OPERATOR_P. + (cp_parser_binary_expression): When -Wc++0x-compat, warn about + `>>' operators that will become two `>' tokens in C++0x. + (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x + mode, allowing it to terminate default arguments. + (cp_parser_enclosed_template_argument_list): In C++0x mode, treat + `>>' like two consecutive `>' tokens. + (cp_parser_skip_to_end_of_template_parameter_list): Ditto. + (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>' + ends a template argument. + +2007-03-28 Douglas Gregor + + * decl.c (redeclaration_error_message): Complain when redeclaring + a friend function with default template arguments (C++0x mode only). + * cp-tree.h (check_default_tmpl_args): Declare. + * pt.c (check_default_tmpl_args): In C++0x mode, permit default + template arguments in function templates. Add support for checking + the default template arguments of friend templates. + (push_template_decl_real): Fix call to check_default_tmpl_args. + (type_unification_real): If a template parameter has not been + deduced but provides a default template argument, substitute into + that default template argument. + * parser.c (cp_parser_init_declarator): When declaring (but not + defining!) a function template in C++0x mode, check for default + template arguments. + +2007-03-28 Douglas Gregor + + PR c++/29993 + * decl.c (grokdeclarator): Deal with cv-qualified function type + typedefs in the same way for member and non-member functions. + +2007-03-26 Dirk Mueller + + * parser.c (cp_parser_member_declaration): Pedwarn + about stray semicolons after member declarations. + +2007-03-26 Paolo Carlini + + PR c++/30500 + * pt.c (instantiate_decl): Set in_system_header. + +2007-03-22 Mark Mitchell + + * cp-tree.h (current_tempalte_parms): Improve documentation. + * pt.c (current_template_args): Likewise. + + PR c++/30863 + * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do + not consume tokens when failing. + +2007-03-22 Jim Wilson + Mark Mitchell + + PR c++/31273 + * call.c (standard_conversion): Use type_decays_to. Keep FCODE + consistent with FROM. + +2007-03-22 Gabriel Dos Reis + + * error.c (dump_expr): Handle dependent names that designate types. + * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE. + +2007-03-17 Kazu Hirata + + * cp-tree.def, parser.c, pt.c: Fix comment typos. + +2007-03-16 Manuel Lopez-Ibanez + + * cvt.c (cp_convert_and_check) : Define. + * cp-tree.h (cp_convert_and_check): Declare. + * call.c (convert_conversion_warnings): Rename to + conversion_null_warnings. The warning for floating-point to + integer is handled by convert_and_check in convert_like_real. + (convert_like_real): convert_conversion_warnings was renamed as + conversion_null_warnings. + * typeck.c (build_binary_op): Use cp_convert_and_check to warn for + overflow and changes of value during conversion. + +2007-03-15 Manuel Lopez-Ibanez + + PR c++/30891 + * parser.c (cp_parser_statement): If 'namespace' is found, this + only can be a namespace alias definition, so parse it now. + (cp_parser_namespace_alias_definition): if we find an open brace + instead of '=', then this is actually a misplaced namespace + definition. + +2007-03-15 Manuel Lopez-Ibanez + + PR c++/24924 + * decl.c (cxx_init_decl_processing): Move command-line options + processing to c-opts.c. + +2007-03-15 Douglas Gregor + + * ptree.c (cxx_print_type): Use formatting markup for integers + when printing template parameter index/level/orig level. + (cxx_print_xnode): Ditto. + * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0. + (struct template_parm_index_s): Remove the PARAMETER_PACK member. + Make INDEX, LEVEL, and ORIG_LEVEL integers instead of + HOST_WIDE_INTs. + (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int, + rather than a HOST_WIDE_INT. + Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and + NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for + better bit-packing. + (struct language_function): Make RETURNS_VALUE, RETURNS_NULL, + RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and + IN_BASE_INITIALIZER bool bitfields. + (struct cp_declarator): Make KIND a 4-bit field. Make + PARAMETER_PACK_P a bool bitfield just after KIND. + * pt.c (uses_parameter_packs): Destroy the pointer set. + (make_pack_expansion): Ditto. + (check_for_bare_parameter_packs): Ditto. + * name-lookup.c (push_to_top_level): Make need_pop a bool value. + +2007-03-14 Andrew Pinski + + PR c++/31165 + * call.c (convert_default_arg): Instead of copying the node, + unshare it. + +2007-03-15 Dirk Mueller + + PR c++/30860 + * call.c (convert_conversion_warnings): New.. + (convert_like_real): .. factored out from here. + (convert_conversion_warnings): Add warning about + false being converted to NULL in argument passing. + +2007-03-14 Dirk Mueller + + * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning. + (finish_do_body): Warn about empty body in do/while statement. + +2007-03-14 Manuel Lopez-Ibanez + + * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning. + +2007-03-14 Manuel Lopez-Ibanez + + PR c/21438 + * typeck.c (build_binary_op): Call warn_for_div_zero instead of + warning. + +2007-03-13 Alexandre Oliva + + * cp/repo.c (init_repo): Initialize random_seed saved options. + (finish_repo): Adjust. + +2007-03-13 Mark Mitchell + + PR bootstrap/30899 + * Make-lang.in (doc/g++.1): Use $< to specify the location from + which to copy. + +2007-03-12 Seongbae Park + + * decl.c (compute_array_index_type): New warning flag warn_vla. + +2007-03-12 Mark Mitchell + + PR c++/30108 + * call.c (convert_default_arg): Copy non-constant arguments. + +2007-03-11 Mark Mitchell + + PR c++/31038 + * parser.c (cp_parser_postfix_expression): Disallow compound + literals in constant expressions. + + PR c++/30328 + * semantics.c (finish_typeof): Use unlowered_expr_type. + +2007-03-10 Mark Mitchell + + PR c++/30274 + * cp-tree.h (unlowered_expr_type): New function. + * typeck.c (is_bitfield_expr_with_lowered_type): Handle + COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR. + (unlowered_expr_type): New function. + (build_unary_op): Disallow predecrements of bool bitfields. + * call.c (build_conditional_expr): Use unlowered_expr_type. + * pt.c (type_unification_real): Likewise. + +2007-03-09 Douglas Gregor + + PR c++/20599 + * typeck.c (check_return_expr): Check for bare parameter packs. + (comptypes): Compare template parameter packs and + type pack expansions. + * decl.c (grokdeclarator): Deal with the declaration of function + parameter packs. + (grokparms): Verify that the (optional) function parameter pack is + at the end of the parameter list. + (xref_basetypes): Handle pack expansions in the base class. + (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. + * cp-tree.def (TYPE_ARGUMENT_PACK): New. + (NONTYPE_ARGUMENT_PACK): New. + (TYPE_PACK_EXPANSION): New. + (EXPR_PACK_EXPANSION): New. + (ARGUMENT_PACK_SELECT): New. + * cp-objcp-common.c (cp_tree_size): Compute size of + (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and + ARGUMENT_PACK_SELECT. + * error.c (dump_template_argument): Print template argument packs. + (dump_template_argument_list): Ditto. + (dump_template_parameter): Dump `...' for template type parameter + packs. + (dump_type): Dump TYPE_PACK_EXPANSION nodes. + (dump_parameters): Print function parameter packs. + (dump_template_parms): Print template argument packs. + (dump_expr): Dump EXPR_PACK_EXPANSION nodes. + (maybe_warn_variadic_templates): New. + * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. + * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, + NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, + CAST_EXPR. + * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. + (write_template_arg): Write argument packs as separate arguments. + * cp-tree.h (struct template_parm_index_s): Add flag that + indicates that the template parameter is actually a parameter + pack. + (struct tree_argument_pack_select): New. + (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. + (union lang_tree_node): Add argument_pack_select. + (FUNCTION_PARAMETER_PACK_P): New. + (PACK_EXPANSION_P): New. + (PACK_EXPANSION_PATTERN): New. + (SET_PACK_EXPANSION_PATTERN): New. + (PACK_EXPANSION_PARAMETER_PACKS): New. + (ARGUMENT_PACK_P): New. + (ARGUMENT_PACK_ARGS): New. + (SET_ARGUMENT_PACK_ARGS): New. + (ARGUMENT_PACK_INCOMPLETE_P): New. + (ARGUMENT_PACK_EXPLICIT_ARGS): New. + (TEMPLATE_PARM_PARAMETER_PACK): New. + (TEMPLATE_TYPE_PARAMETER_PACK): New. + (ARGUMENT_PACK_SELECT_FROM_PACK): New. + (ARGUMENT_PACK_SELECT_INDEX): New. + (ARGUMENT_PACK_SELECT_ARG): New. + (struct cp_declarator): Add parameter_pack_p flag. + (maybe_warn_variadic_templates): Declare. + (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to + indicate a template parameter pack. + (uses_parameter_packs): Declare. + (template_parameter_pack_p): Declare. + (template_parms_variadic_p): Declare. + (make_pack_expansion): Declare. + (check_for_bare_parameter_packs): Declare. + * cxx-pretty-print.c (pp_cxx_unary_expression): Print + sizeof... expressions. + (pp_cxx_expression): Print pack expansions and non-type argument + packs. + (pp_cxx_exception_specification): Print pack expansions. + (pp_cxx_direct_declarator): Print ellipsis for parameter packs. + (pp_cxx_ctor_initializer): Print pack expansions. + (pp_cxx_type_id): Print pack expansions. + (pp_cxx_template_argument_list): Print argument packs. + (pp_cxx_template_parameter): Print ellipsis for template parameter + packs. + * pt.c (comp_template_parms): Compare template parameter packs. + (template_parameter_pack_p): New. + (template_parms_variadic_p): New. + (template_args_variadic_p): New. + (make_ith_pack_parameter_name): New. + (struct find_parameter_pack_data): New. + (find_parameter_packs_r): New. + (uses_parameter_packs): New. + (make_pack_expansion): New. + (check_for_bare_parameter_packs): New. + (expand_template_argument_pack): New. + (reduce_template_parm_level): Propagate parameter pack flag. + (process_template_parm): Add is_parameter_pack parameter to state + when the parameter is actually a parameter pack. Create template + parameter packs when is_parameter_pack is true. + (current_template_args): The argument for a template parameter + pack is an argument pack containing a single pack expansion. + (process_partial_specialization): When checking that non-type + argument expressions do not involve template parameters, loop over + the arguments in argument packs separately. + (push_template_decl_real): Check that the type of the declaration + does not have any bare parameter packs. Check that primary + templates have no more than one parameter pack, and that it comes + at the end of the template parameter list. + (convert_template_argument): Handle coercions for pack expansion + expressions by coercing the pattern then rebuilding the expansion. + (coerce_template_parms): When coercing the arguments for a + variadic template, pack "extra" arguments into an argument pack. + (coerce_template_template_parms): Cannot coerce between parameter + packs and non-pack parameters. + (template_args_equal): Compare PACK_EXPANSION_P expressions. + (comp_template_args): Expand all template arguments packs before + comparing template argument lists. + (mangle_class_name_for_template): Make argument packs as separate + template arguments. + (for_each_template_parm_r): No need to handle BASELINK. + (instantiate_class_template): Handle pack expansions in the base + class list. + (tsubst_pack_expansion): New. + (tsubst_template_args): Handle substitutions of argument packs and + pack expansion into template argument lists. + (tsubst_decl): Expand function parameter packs into separate + function parameters. + (tsubst_arg_types): Expand a type pack expansion into separate + argument types. + (tsubst_exception_specification): Handle pack expansions in + exception specifiers. + (tsubst): See through ARGUMENT_PACK_SELECT arguments when + replacing a template parameter with its argument. If we encounter + a substitution for an argument pack, just return the parameter + itself. + (tsubst_copy): sizeof(X...) returns the number of elements in + parameter pack X. See through ARGUMENT_PACK_SELECT when the + PARM_DECL is a parameter pack. + (tsubst_expr): Expression pack expansions and argument packs + cannot show up here; they will all be handled through function + calls, sizeof, and template argument lists. + (tsubst_copy_and_build): sizeof(X...) returns the number of + elements in parameter pack X. Handle pack expansions in TREE_LIST + and CONSTRUCTOR nodes. + (fn_type_unification): Handle "incomplete" explicit template + argument lists that specify some of the arguments for a template + parameter pack. + (type_unification_real): Unify arguments against pack expansions. + (template_parm_level_and_index): New, helper function. + (unify_pack_expansion): New. + (unify): Unify argument packs on an argument-by-argument basis, + handling variadic argument packs as well. + (more_specialized_fn): Handle unification of function parameter + packs. All things being equal, prefer non-variadic function + templates to variadic function templates. + (more_specialized_class): Prefer the variadic class template + partial specialization that binds fewer arguments to a parameter + pack. + (regenerate_decl_from_template): Expand function parameter packs + into separate parameters. + (instantiate_decl): Ditto. + (tsubst_initializer_list): Handle pack expansions for base-class + initializers. + (dependent_type_p_r): Determine dependent types in argument packs + and pack expansions. + (value_dependent_expression_p): Determine value-dependence of + non-type argument packs. + (dependent_template_arg_p): Handle argument packs. + * semantics.c (finish_cond): Check for bare parameter packs. + (finish_expr_stmt): Ditto. + (finish_for_expr): Ditto. + (finish_switch_cond): Ditto. + (finish_mem_initializers): Ditto. + * name-lookup.c (arg_assoc_type): Handle pack expansions and + argument packs. + * decl2.c (cp_build_parm_decl): Mark function parameter packs. + * parser.c (make_declarator): Declarator is not an expansion. + (make_pointer_declarator): Transfer parameter pack flag to outer + declarator. + (make_reference_declarator): Ditto. + (make_ptrmem_declarator): Ditto. + (make_call_declarator): Ditto. + (make_array_declarator): Ditto. + (cp_parser_postfix_expression): Allow pack expansion expressions + in the argument list for a call expression. + (cp_parser_parenthesized_expression_list): Add new parameter + ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand + into separate arguments." + (cp_parser_new_placement): Allow pack expansion expressions. + (cp_parser_new_initializer): Ditto. + (cp_parser_mem_initializer_list): Allow ellipsis to create a + base-class initializer expansion. + (cp_parser_mem_initializer): Ditto. + (cp_parser_template_parameter_list): Keep track of whether the + template parameter is a template parameter pack. + (cp_parser_template_parameter): Parse the ellipsis to indicate a + template parameter pack. + (cp_parser_type_parameter): Ditto. + (cp_parser_template_argument_list): Parse the ellipsis to indicate + a pack expansion. + (cp_parser_direct_declarator): Parse the ellipsis to indicate that + this declarator is a parameter pack. + (cp_parser_parameter_declaration): The ellipsis does not end the + parameter declaration, because it might be a parameter pack. Parse + the ellipsis to indicate a parameter pack. + (cp_parser_initializer): Allow pack expansions. + (cp_parser_initializer_list): Allow ellipsis to create an + initializer expansion. + (cp_parser_base_clause): Allow ellipsis to create a base specifier + expansion. + (cp_parser_type_id_list): Allow ellipsis to create an exception + specifier expansion. + (cp_parser_attribute_list): Don't allow pack expansions. + (cp_parser_functional_cast): Allow pack expansions. + (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to + compute the length of a parameter pack. + (cp_parser_next_token_ends_template_argument_p): An ellipsis can + end a template argument. + * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, + NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, + CAST_EXPR. + +2007-03-09 Dirk Mueller + + * cp/call.c (build_new_op): Call warn_logical_operator. + +2007-03-08 Volker Reichelt + + PR c++/30852 + * semantics.c (finish_offsetof): Handle COMPOUND_EXPR. + + PR c++/30534 + * pt.c (any_template_arguments_need_structural_equality_p): + Robustify. + +2007-03-08 Alexandre Oliva + + * decl.c (grokdeclarator): Disable warnings for anonymous + bitfields. + +2007-03-05 Volker Reichelt + + * typeck2.c (readonly_error): Always emit a hard error. + Remove last argument. + * cp-tree.h (readonly_error): Adjust prototype. + * semantics.c (finish_asm_stmt): Adjust call to readonly_error. + * typeck.c (build_unary_op): Likewise. + (build_modify_expr): Likewise. + +2007-03-04 Simon Martin + + PR c++/30895 + * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees. + 2007-03-03 Manuel Lopez-Ibanez PR c++/15787