diff -Nrcpad gcc-4.3.3/gcc/cp/ChangeLog gcc-4.4.0/gcc/cp/ChangeLog *** gcc-4.3.3/gcc/cp/ChangeLog Sat Jan 24 10:15:39 2009 --- gcc-4.4.0/gcc/cp/ChangeLog Tue Apr 21 08:44:51 2009 *************** *** 1,4299 **** ! 2009-01-24 Release Manager ! ! * GCC 4.3.3 released. ! ! 2009-01-16 Jason Merrill ! ! PR c++/38877 ! * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF. ! ! 2009-01-16 Steve Ellcey ! ! PR c++/31260 ! PR c++/38357 ! * pt.c (tsubst): Check for NULL args. ! ! 2009-01-15 Jason Merrill ! ! PR c++/38850 ! * pt.c (tsubst_copy_and_build): Tell finish_call_expr to ! accept hidden friends. ! ! PR c++/36334 ! PR c++/37646 ! * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to ! a function isn't necessarily an lvalue. Take tree, not const_tree. ! (lvalue_p, real_lvalue_p): Take tree, not const_tree. ! * typeck.c (lvalue_or_else): Likewise. ! * cp-tree.h: Adjust prototypes. ! ! PR c++/31488 ! * tree.c (pod_type_p): Return 1 for structs created by the back end. ! ! 2009-01-12 Dodji Seketeli ! ! PR c++/36019 ! * pt.c (parameter_of_template_p): New function. ! * cp-tree.h: Declare it. ! * name-lookup.c (binding_to_template_parms_of_scope_p): New ! function. ! (outer_binding): Take template parameters in account when looking for ! a name binding. ! ! 2008-12-04 Janis Johnson ! ! Backport from mainline: ! 2008-10-18 Jakub Jelinek ! Janis Johnson ! ! * Make-lang.in (check-c++-subtargets): New alias for ! check-g++-subtargets. ! (lang_checks_parallelized): Add check-g++. ! (check_g++_parallelize): New variable. ! ! 2008-11-19 Dodji Seketeli ! ! PR c++/37142 ! * pt.c (coerce_template_template_parm): Use the more robust ! uses_template_parms instead of dependent_type_p. ! ! 2008-11-19 Dodji Seketeli ! ! PR c++/35405 ! * pt.c (lookup_template_class): Check pointers before dereferencing ! Them. ! * error.c (dump_template_decl): Likewise. ! ! 2008-11-19 Jason Merrill ! ! PR c++/37563 ! * parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor ! name is not a declaration. ! ! 2008-11-14 Jason Merrill ! ! PR c++/38030 ! * semantics.c (finish_call_expr): Don't repeat arg-dep lookup ! for a non-dependent call. ! ! 2008-11-13 Jason Merrill ! ! PR c++/37932 ! * typeck2.c (process_init_constructor_record): Update bitfield ! handling. ! ! 2008-11-12 Jason Merrill ! ! PR c++/38007 ! * typeck.c (cp_build_modify_expr): Update bitfield handling. ! ! 2008-09-30 Simon Martin ! ! PR c++/37555 ! * decl.c (grokdeclarator): Set the type for typedefs to a ! nested-name-specifier to error_mark_node. ! 2008-09-09 Jakub Jelinek ! PR c++/37389 ! * decl.c (build_enumerator): Handle previous value's DECL_INITIAL ! being error_operand_p. ! 2008-09-03 Jakub Jelinek ! PR c++/37348 ! * decl.c (cp_finish_decl): Only set ! DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL. ! 2008-08-27 Release Manager ! * GCC 4.3.2 released. ! 2008-08-19 Jakub Jelinek ! PR debug/37156 ! * error.c (cp_print_error_function): Deal with recursive BLOCK trees. ! 2008-08-07 Simon Baldwin Backport from mainline: ! 2008-08-04 Simon Baldwin ! ! PR c++/36999 ! * parser.c (cp_parser_elaborated_type_specifier): Warn only when ! the declaration's id is followed by a semicolon. ! ! 2008-07-31 Jakub Jelinek ! ! PR c++/36405 ! * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call ! complete_type_or_else even for UNKNOWN_TYPE to get diagnostics. ! ! 2008-07-30 Dodji Seketeli ! ! PR c++/36767 ! * decl2.c (fix_temporary_vars_context_r): New function. ! (one_static_initialization_or_destruction): Make sure temporary ! variables part of the initialiser have their DECL_CONTEXT() ! properly set. ! ! 2008-07-29 Jakub Jelinek ! ! PR c++/36852 ! * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on ! TYPE_UID instead of pointers. ! ! 2008-07-18 Dodji Seketeli ! ! PR c++/36407 ! * call.c (convert_like_real): Don't take the error code path ! when a rvalue or base conversion has the bad_p field set. ! ! 2008-07-07 Simon Martin ! ! PR c++/34963 ! * decl.c (grokdeclarator): Reset storage_class and staticp for friend ! functions declared with a storage class qualifier. ! ! 2008-06-30 Jakub Jelinek ! ! PR c++/36662 ! * decl2.c (is_late_template_attribute): If the first attribute ! argument is IDENTIFIER_NODE, don't consider it when checking ! if arguments are value or type dependent. ! ! 2008-06-28 Jakub Jelinek ! ! PR c++/36364 ! * repo.c (repo_emit_p): Put const static data members initialized ! by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN ! for it is 0. ! ! 2008-06-15 Simon Martin ! ! PR c++/35320 ! * decl2.c (grokbitfield): Receive the list of attributes, pass it to ! grokdeclarator and apply it to the created declaration. ! * cp-tree.h (grokbitfield): Update prototype. ! * parser.c (cp_parser_member_declaration): Don't apply the attributes ! since they are now applied in grokbitfield. Adjusted the call to ! grokbitfield. ! (cp_parser_objc_class_ivars): Likewise. ! ! 2008-06-15 Simon Martin ! ! PR c++/35317 ! * class.c (type_requires_array_cookie): Do not consider delete[] ! operators with an ellipsis as second argument. ! ! 2008-06-09 Jakub Jelinek ! ! PR c++/36408 ! * semantics.c (stmt_expr_value_expr): Don't crash on empty ! STATEMENT_LIST. ! ! 2008-06-07 Danny Smith ! ! PR target/35921 ! * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag ! to clone. ! ! 2008-06-06 Release Manager ! ! * GCC 4.3.1 released. ! ! 2008-05-27 Alexandre Oliva ! ! PR c++/35909 ! * call.c (convert_like_real): Convert bitfield to desired type ! before creating temporary. ! ! 2008-05-23 Jakub Jelinek ! ! PR c++/36237 ! * cp-gimplify.c (cxx_omp_clause_apply_fn): Call ! fold_build_cleanup_point_expr on build_call_a results. ! ! PR c++/36308 ! * semantics.c (omp_clause_info_fndecl): New function. ! (finish_omp_clauses): Use it. ! ! 2008-05-21 Jakub Jelinek ! ! PR c++/36023 ! * cp-tree.h (check_array_initializer): New prototype. ! * decl.c (check_array_initializer): New function. ! (check_initializer): Call it. ! * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs. ! ! 2008-05-11 Volker Reichelt ! ! * parser.c (cp_parser_omp_clause_reduction): Add missing "expected" ! in error message. ! (cp_parser_omp_clause_schedule): Remove superfluous "expected" ! in error message. ! ! PR c++/35578 ! * parser.c (cp_parser_decl_specifier_seq): Add location to error ! message. ! ! 2008-04-30 Jakub Jelinek ! ! PR c++/35986 ! * pt.c (more_specialized_fn): Stop the loop even if there are no ! arguments before ellipsis. ! ! 2008-04-29 Jakub Jelinek ! ! PR c++/35650 ! * parser.c (cp_parser_lookup_name): Look through single function ! OVERLOAD. ! ! PR c++/35987 ! * typeck.c (build_modify_expr) : Don't build ! COMPOUND_EXPR if the second argument would be error_mark_node. ! ! 2008-04-24 Jakub Jelinek ! ! PR c++/35758 ! * cp-tree.h (cp_reconstruct_complex_type): New prototype. ! * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define. ! * decl2.c (is_late_template_attribute): Only make vector_size ! late tmpl attribute if argument is type or value dependent. ! (cp_reconstruct_complex_type): New function. ! ! 2008-04-22 Jason Merrill ! ! PR c++/35316 ! * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE ! to see if DECL_BIT_FIELD_TYPE should be used, not some other flag. ! * typeck.c (is_bitfield_expr_with_lowered_type): Likewise. ! ! 2008-04-22 Jakub Jelinek ! ! PR c++/35747 ! * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt ! expression is errorneous. ! ! 2008-04-21 Jason Merrill ! ! PR c++/35325 ! * tree.c (cp_tree_equal): Handle FIXED_CST. ! ! PR c++/35678 ! * pt.c (template_template_parm_bindings_ok_p): Set ! processing_template_decl while in this function. ! ! 2008-04-18 Jason Merrill ! ! PR c++/33486 ! * name-lookup.c (arg_assoc_namespace): Look down into inline ! namespaces, too. ! ! 2008-04-17 Volker Reichelt ! ! * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN ! as `)', not as `('. ! ! 2008-04-17 Jason Merrill ! ! PR c++/35773 ! * call.c (build_user_type_conversion_1): Represent second step of ! copy-init with an rvalue conversion. ! (convert_like_real) [ck_user]: Don't implicitly add it here. ! ! 2008-04-15 Jakub Jelinek ! ! PR c/35751 ! * decl.c (layout_var_decl): If extern or static var has variable ! size, set TREE_TYPE (decl) to error_mark_node. ! ! 2008-04-09 Jason Merrill ! ! PR c++/35708 ! * semantics.c (finish_compound_literal): Return a TARGET_EXPR, ! not a pushed variable. ! ! 2008-04-07 Jason Merrill ! ! PR c++/35734 ! * class.c (type_has_user_nondefault_constructor): A template ! counts as a nondefault constructor. ! ! 2008-04-03 Jakub Jelinek ! ! PR c++/35741 ! * semantics.c (finish_offsetof): Undo effect of convert_from_reference ! before calling fold_offsetof. ! ! 2008-03-26 Jakub Jelinek ! ! PR c++/35546 ! * pt.c (apply_late_template_attributes): Don't call tsubst on ! first attribute argument if it is IDENTIFIER_NODE. ! ! PR c++/35332 ! * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR ! and LTGT_EXPR to pp_expression. ! ! 2008-03-17 Jason Merrill ! ! PR c++/35548 ! * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding ! a temp directly to a reference as per DR391. ! ! 2008-03-12 Richard Guenther ! ! PR c++/35469 ! Revert: ! 2008-02-04 Richard Guenther ! ! PR java/35035 ! * decl.c (record_builtin_java_type): Make jboolean a ! integer type again where its mode doesn't match that of bool. ! ! 2008-01-25 Richard Guenther ! ! PR c++/33887 ! * decl.c (record_builtin_java_type): Make __java_boolean ! a variant of bool. ! * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check ! after TYPE_MAIN_VARIANT check. ! ! 2008-03-10 Jakub Jelinek ! ! PR c++/35328 ! * semantics.c (finish_omp_clauses): Look through NOP_EXPR even ! if errorcount. ! ! PR c++/35337 ! * semantics.c (finish_omp_clauses): Use %qD instead of %qE for ! DECL_P in not a variable and appears more than once error messages. ! ! 2008-03-06 Jakub Jelinek ! ! PR c++/35028 ! * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors. ! ! PR c++/34964 ! PR c++/35244 ! * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p ! vars. Afterwards ensure v is VAR_DECL. ! ! PR c++/35078 ! * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't ! call cp_finish_decl. ! * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type ! early. ! ! 2008-03-06 Paolo Carlini ! ! PR c++/35323 ! * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE. ! ! 2008-03-06 Paolo Carlini ! ! PR c++/35333 ! * error.c (dump_expr): Handle CONJ_EXPR. ! ! 2008-03-06 Paolo Carlini ! ! PR c++/35338 ! * error.c (dump_type): Handle FIXED_POINT_TYPE. ! (dump_expr): Handle FIXED_CST. ! ! 2008-03-05 Release Manager ! ! * GCC 4.3.0 released. ! ! 2008-02-27 Jakub Jelinek ! ! PR c++/35368 ! * rtti.c: Include c-pragma.h. ! (push_abi_namespace, pop_abi_namespace): New functions. ! (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index, ! create_tinfo_types, emit_support_tinfos): Use them. ! * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H). ! ! 2008-02-22 Andrew Pinski ! ! PR C++/34715 ! * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for ! template decls' function decl. ! ! 2008-02-22 Paolo Carlini ! ! PR c++/35282 ! Revert: ! 2008-02-14 Paolo Carlini ! ! PR c++/28743 ! * pt.c (determine_specialization): In case of function templates, ! when the type of DECL does not match FN there is no match. ! ! 2008-02-19 Jason Merrill ! ! PR c++/34950 ! * pt.c (resolve_overloaded_unification): Set processing_template_decl ! while we look for possible bindings. ! ! 2008-02-15 Douglas Gregor ! ! PR c++/35023 ! PR c++/35024 ! PR c++/35026 ! * pt.c (finish_member_template_decl): If the type in a TYPE_DECL ! is error_mark_node, return an error early. ! (find_parameter_packs_r): Pass the pointer set along to recursive ! calls of cp_walk_subtrees; don't try to manage the pointer set ! ourselves. ! (uses_parameter_packs): Pass the pointer set to cp_walk_tree. ! (make_pack_expansion): Ditto. ! (check_for_bare_parameter_packs): Ditto. Also, don't bother taking ! a second pass through the tree with find_parameter_packs_r; that ! second pass no longer does anything. ! (push_template_decl_real): If we have an erroneous declaration, ! set its type to error_mark_node before returning an error. ! ! 2008-02-14 Douglas Gregor ! ! PR c++/34050 ! * pt.c (tsubst_initializer_list): Deal with the use of ! VOID_TYPE_NODE to indicate value-initialization of the bases. ! ! 2008-02-14 Manuel Lopez-Ibanez ! Jason Merrill ! ! PR c++/5645 ! PR c++/11159 ! * class.c (type_has_user_nondefault_constructor): New fn. ! * cp-tree.h: Declare it. ! * init.c (emit_mem_initializers): Use it for -W warning about ! missing base initializer. ! ! 2008-02-14 Paolo Carlini ! ! PR c++/28743 ! * pt.c (determine_specialization): In case of function templates, ! when the type of DECL does not match FN there is no match. ! ! 2008-02-13 Jakub Jelinek ! Manuel Lopez-Ibanez ! ! PR c++/35138 ! * parser.c (cp_parser_pseudo_destructor_name): If next tokens ! are not identifier :: ~, return before calling cp_parser_type_name. ! ! 2008-02-13 Jason Merrill ! ! PR c++/34962, c++/34937, c++/34939 ! * decl2.c (is_late_template_attribute): Always defer attributes ! vector_size and weak. ! ! PR c++/34774 ! * pt.c (value_dependent_expression_p): Look into DECL_INITIAL ! of enumerators, too. ! ! 2008-02-12 Jason Merrill ! ! PR c++/34824 ! * call.c (convert_like_real): Pass LOOKUP_ONLYCONVERTING to build_temp ! if we're doing conversions to call a user-defined conversion function. ! ! 2008-02-12 Steven Bosscher ! ! PR c++/29048 ! * semantics.c (finish_qualified_id_expr): Avoid duplicate access ! check here, too. ! ! 2008-02-12 Jakub Jelinek ! ! PR c++/34862 ! * init.c (build_new_1): Don't create placement_expr before ! constructing alloc_call. Verify that the pointer is passed by ! value to operator new. ! ! 2008-02-11 Jason Merrill ! ! PR c++/35097 ! * pt.c (tsubst): Don't look up a template typedef in an explicit ! specialization. ! ! 2008-02-11 Douglas Gregor ! ! PR c++/35113 ! * tree.c (cp_build_qualified_type_real): When building a ! cv-qualified array type, build it as a unique type with ! build_cplus_array_type_1 and then adopt the unqualified type's ! main variant. ! ! 2008-02-11 Paolo Carlini ! ! PR c++/35077 ! * decl.c (groktypename): Check grokdeclarator return. ! ! 2008-02-10 Jason Merrill ! ! PR c++/34094 ! * decl2.c (cp_write_global_declarations): Don't write out static ! data members with DECL_IN_AGGR_P set. ! ! 2008-02-08 Jason Merrill ! ! PR c++/35116 ! * tree.c (build_target_expr_with_type): Handle void initializer. ! (bot_manip): Remap slot before recursing. ! ! 2008-02-06 Kaveh R. Ghazi ! ! PR other/35107 ! * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS). ! ! 2008-02-06 Alexandre Oliva ! ! PR c++/35056 ! * tree.c: Include tree-flow.h. ! (build_target_expr): Check type compatibility. ! * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H). ! * call.c (convert_like_real): Convert bitfield to expected type. ! ! 2008-02-06 Douglas Gregor ! ! PR c++/35049 ! PR c++/35096 ! * typeck.c (structural_comptypes): Call cp_comptypes. ! (comptypes): New; called from the C/C++ common bits to perform ! strict checks. ! (cp_comptypes): Renamed from comptypes, which is already used, ! with a different signature, by the C++ front end. ! (build_reinterpret_cast_1): Call cp_comptypes. ! (ptr_reasonably_similar): Ditto. ! * decl.c (decls_match): Ditto. ! * cvt.c (convert_to_reference): Ditto. ! * cp-tree.h (same_type_p): Ditto. ! (same_or_base_type_p): Ditto. ! (comptypes): Rename to cp_comptypes. ! * pt.c (canonical_type_parameter): Call cp_comptypes. ! ! 2008-02-05 Jakub Jelinek ! ! PR c++/33553 ! * pt.c (tsubst) : Don't issue error if max is ! value dependent expression. ! ! 2008-02-05 Douglas Gregor ! ! PR c++/35074 ! * decl2.c (save_template_attributes): When we're modifying the ! TYPE_MAIN_VARIANT to add new attributes, be sure to also modify ! all of the other variants to add those same attributes. Otherwise, ! the main variant will be inconsistent with those other variants. ! ! 2008-02-04 Richard Guenther ! ! PR java/35035 ! * decl.c (record_builtin_java_type): Make jboolean a ! integer type again where its mode doesn't match that of bool. ! ! 2008-02-02 Jason Merrill ! Mark Mitchell ! ! PR c++/33916 ! * init.c (build_value_init_1): New function. ! (build_value_init): New function. ! * typeck2.c (build_functional_cast): Call it. ! * cp-gimplify.c (cp_gimplify_init_expr): Handle its output. ! ! * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from ! TYPE_HAS_CONSTRUCTOR. ! * class.c (finish_struct_bits, maybe_warn_about_overly_private_class, ! add_implicitly_declared_members): Adjust. ! (check_field_decls): Adjust. Remove warnings about reference/const ! in class without constructor. ! (check_bases_and_members): Adjust. Give those warnings here instead. ! * decl.c (fixup_anonymous_aggr): Adjust. ! (check_initializer): Adjust, clarify logic slightly. ! (grok_special_member_properties): Adjust, only set if user-provided. ! * rtti.c (create_tinfo_types): Don't set. ! * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al. ! Use same_type_ignoring_top_level_qualifiers_p. ! * pt.c (check_explicit_specialization): Adjust. ! (instantiate_class_template): Adjust. ! ! 2008-01-31 Douglas Gregor ! Jakub Jelinek ! ! PR c++/34935 ! PR c++/34936 ! * typeck.c (structural_comptypes): Handle comparisons of ! VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and ! REAL_TYPE nodes. ! * mangle.c (write_builtin_type): Map down to the canonical type, ! which will be one of the predefined type nodes. ! ! 2008-01-29 Michael Meissner ! ! PR 35004 ! * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16 ! bits to allow for expansion of the number of middle end tree ! codes. ! ! 2008-01-29 Douglas Gregor ! ! PR c++/34055 ! PR c++/34103 ! PR c++/34219 ! PR c++/34606 ! PR c++/34753 ! PR c++/34754 ! PR c++/34755 ! PR c++/34919 ! PR c++/34961 ! * typeck.c (check_return_expr): Tweak call to ! check_for_bare_parameter_packs. ! * class.c (add_method): Be careful with error_mark_nodes. ! * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from ! signature. ! * pt.c (struct find_parameter_pack_data): Remove ! SET_PACKS_TO_ERROR. ! (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR. ! (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR. ! (make_pack_expansion): Ditto. ! (check_for_bare_parameter_packs): Parameter is now a tree, not a ! tree*. ! (process_template_parm): Tweak call to ! check_for_bare_parameter_packs. ! (push_template_decl_real): Tweak calls to ! check_for_bare_parameter_packs. If bare parameter packs are found ! in the list of exceptions, clear out that list after giving an ! error. ! * semantics.c (finish_cond): Tweak call to ! check_for_bare_parameter_packs. ! (finish_expr_stmt): Ditto. ! (finish_for_expr): Ditto. ! (finish_switch_cond): Ditto. ! (finish_mem_initializers): Ditto. ! (finish_member_declaration): Ditto. ! (finish_static_assert): Check for bare parameter packs in the ! condition. ! * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the ! attributes of a declaration. ! * parser.c (cp_parser_using_declaration): Tweak call to ! check_for_bare_parameter_packs. ! (cp_parser_base_clause): Ditto. ! ! 2008-01-28 Jason Merrill ! ! PR c++/35007 ! * class.c (build_base_path): Fix !want_pointer case. ! ! 2008-01-27 Jason Merrill ! ! PR c++/27177 ! * class.c (build_base_path): Fix previous change. ! ! 2008-01-26 Jakub Jelinek ! ! PR c++/34965 ! * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR ! and TRUTH_XOR_EXPR. ! ! 2008-01-26 Richard Guenther ! ! PR c++/34235 ! * typeck.c (build_binary_op): Remove code to shorten compares. ! ! 2008-01-25 Richard Guenther ! ! PR c++/33887 ! * decl.c (record_builtin_java_type): Make __java_boolean ! a variant of bool. ! * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check ! after TYPE_MAIN_VARIANT check. ! ! 2008-01-25 Jason Merrill ! ! PR c++/27177 ! * class.c (build_base_path): Don't mess with virtual access if ! skip_evaluation. ! * call.c (standard_conversion): Don't check whether source type ! is complete. ! ! * decl2.c (is_late_template_attribute): Don't defer attribute ! visibility just because the type is dependent. ! ! 2008-01-25 Jason Merrill ! Mark Mitchell ! ! PR c++/31780 ! * call.c (standard_conversion): Allow conversion from integer/real ! to complex. ! (compare_ics): Such a conversion is worse than a normal arithmetic ! conversion. ! ! 2008-01-25 Richard Guenther ! ! PR c++/33887 ! * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define ! to true. ! 2008-01-24 Paolo Carlini ! PR c++/34603 ! * pt.c (push_template_decl_real): Return error_mark_node in case ! of template definition of non-template. ! 2008-01-24 Jason Merrill ! PR c++/34913 ! * decl2.c (is_late_template_attribute): Defer any attribute with ! dependent args. Also defer type attributes if the type is dependent. ! 2008-01-22 Jakub Jelinek ! Alexandre Oliva ! PR c++/33984 ! * call.c (reference_binding): For bitfields use the declared bitfield type. - (add_builtin_candidates): Likewise. - * class.c (layout_class_type): For bitfields copy over the - original type quals. - - 2008-01-22 Jason Merrill - - PR c++/28560 - * decl.c (groktypename): Also ignore attributes on dependent - possibly-class types. - - PR c++/34912 - * friend.c (do_friend): Check for prior declaration of a friend - function of a local class. - * name-lookup.c (lookup_name_innermost_nonclass_level): - No longer static. - * name-lookup.h: Declare it. - - 2008-01-22 Tom Tromey - - PR c++/34829: - * init.c (build_new_1): Only disallow Java aggregates. - - 2008-01-22 Jakub Jelinek - - PR c++/34607 - * semantics.c (finish_omp_for): Don't call c_finish_omp_for - if decl or init is error_mark_node. - - PR c++/34918 - * error.c (dump_expr): Handle VECTOR_CST. - - 2008-01-21 Jason Merrill - - PR c++/33959 - * pt.c (tsubst_aggr_type): Make sure our context is complete. - - PR c++/34573 - * pt.c (retrieve_local_specialization): Robustify. - (tsubst_pack_expansion, tsubst_decl): Remove redundant checks. - - PR c++/34846 - * pt.c (tsubst): Only call retrieve_local_specialization if the - original typedef was in a function template. - - PR c++/34196 - * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP. - - 2008-01-21 Richard Guenther - - PR c++/34850 - * error.c (cp_print_error_function): Deal with recursive - BLOCK trees. - - 2008-01-20 Paolo Carlini - - PR c++/34891 - * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR. - - 2008-01-20 Paolo Carlini - - PR c++/34776 - PR c++/34486 - * name-lookup.c (do_class_using_decl): Do not call constructor_name_p - on non-IS_AGGR_TYPE scope. - (constructor_name_p): Assert IS_AGGR_TYPE. - - 2008-01-18 Ian Lance Taylor - - PR c++/33407 - * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag. - (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set - DECL_IS_OPERATOR_NEW flag. - - 2008-01-16 Richard Guenther - - PR c++/33819 - * typeck.c (is_bitfield_expr_with_lowered_type): Recurse - for conversions to type variants. - - 2008-01-15 Andreas Tobler - - * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing - declaration and code. Update copyright year. - - 2008-01-15 Douglas Gregor - - PR c++/34399 - * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we - know we have a class type. - - 2008-01-15 Douglas Gregor - - PR c++/34751 - * pt.c (coerce_template_parameter_pack): When substituting into - the type of a non-type template parameter pack. use the - deduced/substituted arguments. - * parser.c (declarator_can_be_parameter_pack): A pointer-to-member - can be a parameter pack with the ellipsis following it. When we - have an erroneous declaration, allow it to be a parameter pack. - (cp_parser_template_parameter): Complain about default - arguments on non-type template parameter packs, and parse them - using the new cp_parser_default_argument. - (cp_parser_parameter_declaration): Complain about parameter packs - with default arguments. Move parsing of default arguments into a - new function, cp_parser_default_argument. - (cp_parser_default_argument): New; extracted from - cp_parser_parameter_declaration. - - 2008-01-15 Douglas Gregor - - PR c++/34051 - PR c++/34055 - PR c++/34102 - PR c++/34103 - * typeck.c (check_return_expr): If there are bare parameter packs - in the return value, set it to error_mark_node. - * tree.c (cp_walk_subtrees): Walk USING_DECL nodes. - * pt.c (find_parameter_packs_r): Look at the type of - IDENTIFIER_NODEs (e.g., for user-defined conversions). - (check_for_bare_parameter_packs): Flip the result: now returns - TRUE when there were bare parameter packs, FALSE otherwise. - (push_template_decl_real): Deal with flipped result of - check_for_bare_parameter_packs. - * semantics.c (finish_cond): If there are bare parameter packs in - the conditional, set it to error_mark_node. - (finish_expr_stmt): If there are bare parameter packs in the - expression, set it to error_mark_node. - (finish_for_expr): Ditto. - (finish_switch_cond): If there are bare parameter packs in - the conditional, set it to error_mark_node. - (finish_mem_initializers): If there are bare parameter packs in - the member initializer, set it to error_mark_node. - (finish_member_declaration): Check the attributes of the - declaration for bare parameter packs, and remove the attributes if - any have bare parameter packs. - * parser.c (cp_parser_using_declaration): Check the using - declaration for bare parameter packs. - (cp_parser_base_clause): If there are bare parameter packs in a - base specifier, don't add it to the chain. - - 2008-01-15 Douglas Gregor - - PR c++/34314 - * error.c (dump_simple_decl): Display ellipsis for template - non-type parameter packs. - (dump_decl): Display ellipsis for template type parameter packs. - (dump_template_decl): Display ellipsis for template template - parameter packs. - * pt.c (redeclare_class_template): When redeclaring a class - template, check for collisions between template parameters and - template parameter packs. - - 2008-01-15 Douglas Gregor - - PR c++/33964 - * pt.c (process_partial_specialization): Don't mark template - parameters that occur in non-deduced contexts. - (struct pair_fn_data): Add include_nondeduced_p. - (for_each_template_parm_r): Only visit non-deduced contexts if - include_nondeduced_p is set. - (for_each_template_parm): Added parameter include_nondeduced_p, - which states whether template parameters found in non-deduced - contexts should be visited. - (uses_template_parms): Visit all template parameters, even those - in non-deduced contexts. - - 2008-01-15 Douglas Gregor - - PR c++/34052 - * pt.c (check_default_tmpl_args): Check for parameter packs that - aren't at the end of a primary template. - (push_template_decl_real): Remove check for parameter packs that - aren't at the end of a primary template; that now happens in - check_default_tmpl_args. - * semantics.c (finish_template_template_parm): Use - check_default_tmpl_args to check for errors in the template - parameter list. - - 2008-01-12 Doug Kwan - - * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers - instead of OPT_Wreturn_type in warning due to ignored return type - qualifiers. - * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers - instead of OPT_Wreturn_type in warning due to ignored return type - qualifiers. - - 2008-01-08 Jakub Jelinek - - PR c++/33890 - * semantics.c (finish_omp_for): Don't call - fold_build_cleanup_point_expr if processing_template_decl. - - 2008-01-04 Paolo Carlini - Jakub Jelinek - - PR c++/34611 - * error.c (dump_template_argument): Deal with TREE_LIST. - - 2008-01-01 Douglas Gregor - - * parser.c (cp_parser_check_decl_spec): Don't warn about "long - long" in C++0x mode; change the warning to note that "long long" - is only unsupported in C++98 mode. - - 2007-12-20 Jason Merrill - - PR c++/34111 - * call.c (standard_conversion): Derived-to-base is considered a - standard conversion. - - 2007-12-19 Jakub Jelinek - - PR c++/34513 - * parser.c (cp_parser_omp_parallel): For non-combined parallel - call cp_parser_statement rather than - cp_parser_already_scoped_statement. - - 2007-12-18 Jason Merrill - - PR c++/34206 - * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't - use template parms. - (dependent_type_p_r): Handle the domain of an array. - - 2007-12-18 Douglas Gregor - Jakub Jelinek - - PR c++/32565 - PR c++/33943 - PR c++/33965 - * pt.c (template_template_parm_bindings_ok_p): New; verifies - bindings of template template parameters after all template - arguments have been deduced. - (coerce_template_parms): Don't complain when COMPLAIN doesn't - include tf_error. - (fn_type_unification): Use template_template_parm_bindings_ok_p. - (unify): Deal with variadic, bound template template parameters. - (get_class_bindings): Use template_template_parm_bindings_ok_p. - - 2007-12-18 Jakub Jelinek - - PR c++/34488 - * decl.c (grokdeclarator): Reject friend sfk_constructor - FUNCTION_TYPE. - - 2007-12-17 Jakub Jelinek - - PR c/34506 - * parser.c (cp_parser_omp_all_clauses): Accept optional comma - in between clauses. - - 2007-12-15 Alexandre Oliva - - PR debug/7081 - * cp-lang.c (cp_classify_record): New. - (LANG_HOOKS_CLASSIFY_RECORD): Override. - - 2007-12-11 Jakub Jelinek - - PR c++/34238 - * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change. - - PR c++/34364 - * rtti.c (build_dynamic_cast): Call convert_from_reference even for - dynamic_cast in a template. - - 2007-12-10 Simon Martin - - PR c++/34059 - * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from - MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO. - - 2007-12-10 Jakub Jelinek - - PR c++/34395 - * error.c (dump_type_prefix, dump_type_suffix): Handle - TYPE_PACK_EXPANSION. - - PR c++/34394 - * error.c (dump_expr): Handle ABS_EXPR. - - 2007-12-09 Jakub Jelinek - - PR c++/34178 - PR c++/34340 - * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P - in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. - Return 2 also if DECL_EXPLICIT_INSTANTIATION. - * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when - flag_use_repository and repo_emit_p returned 2. - - 2007-12-06 Jakub Jelinek - - PR c++/34336 - * tree.c (stabilize_call, stabilize_init): Do nothing if - processing_template_decl. - - 2007-12-05 Jakub Jelinek - - PR c++/34271 - * semantics.c (finish_decltype_type): For SCOPE_REF issue an - error instead of assertion failure. - * parser.c (cp_parser_decltype): If closing paren is not found, - return error_mark_node. - - 2007-12-04 Douglas Gregor - - PR c++/34101 - * name-lookup.c (arg_assoc_template_arg): Recurse on argument - packs. - (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here, - since arg_assoc_template_arg will deal with them (better). - - 2007-12-04 Douglas Gregor - - PR c++/33509 - * pt.c (tsubst_exception_specification): Handle substitutions into - member templates, where tsubst_pack_expansion returns a - TYPE_PACK_EXPANSION. - - 2007-12-04 Douglas Gregor - - PR c++/33091 - * pt.c (unify_pack_expansion): If we didn't deduce any actual - bindings for the template parameter pack, don't try to keep the - empty deduced arguments. - (unify): If a parameter is a template-id whose template argument - list contains a pack expansion that is not at the end, then we - cannot unify against that template-id. - - 2007-12-02 Paolo Carlini - - PR c++/34061 - * pt.c (current_template_args): Use error_operand_p. - - 2007-12-02 Paolo Carlini - - PR c++/34273 - * error.c (dump_decl): Handle TREE_BINFO. - - 2007-12-01 Ollie Wild - - PR c++/8171 - * typeck.c (build_binary_op): Add conversion of pointers to function - members appearing as operands to the equality operators. - - 2007-11-30 Jakub Jelinek - - PR c++/34275 - * error.c (dump_expr): Handle OBJ_TYPE_REF. - - 2007-11-29 Jakub Jelinek - - PR c++/34270 - * tree.c (lvalue_p_1) : Handle x ?: y - in templates. - * typeck.c (is_bitfield_expr_with_lowered_type) : - Likewise. - - PR c++/34267 - PR c++/34268 - * parser.c (cp_parser_decltype): Don't call finish_id_expression - on ~type. - * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs - and ~type early. - - 2007-11-27 Jakub Jelinek - - PR tree-optimization/34181 - * method.c (use_thunk): Don't inline the call in the thunk. - - PR c++/34213 - * tree.c (decl_linkage): Static data members and static member - functions in anonymous ns classes are lk_external. - - 2007-11-26 Andreas Krebbel - - PR c++/34081 - * decl.c (start_preparsed_function): Pass - processing_template_decl for the new allocate_struct_function - parameter. - - 2007-11-25 Richard Guenther - - * decl.c (poplevel): Use BLOCK_CHAIN. - - 2007-11-24 Ollie Wild - - * typeck.c (delta_from_ptrmemfunc): New function. - (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc. - (build_binary_op): Call delta_from_ptrmemfunc. - - 2007-11-23 Jakub Jelinek - - PR c++/30293 - PR c++/30294 - * decl.c (cp_finish_decl): Disallow variable or field - definitions if extern "Java" aggregates. - (grokparms): Disallow parameters with extern "Java" - aggregates. - (check_function_type): Disallow function return values - with extern "Java" aggregates. - * init.c (build_new_1): Disallow placement new with - extern "Java" aggregates. - - 2007-11-23 Mark Mitchell - Manuel Lopez-Ibanez - - PR c++/5310 - * call.c (convert_like_real): Build a zero constant when __null is - converted to an integer type. - - 2007-11-22 Jakub Jelinek - - PR c++/34094 - * decl2.c (cp_write_global_declarations): Issue error about static - data members in anonymous namespace which are declared and used, - but not defined. - - 2007-11-20 Jakub Jelinek - - PR c++/34089 - * parser.c (cp_parser_class_head): Reject function template ids. - - PR c++/28879 - * tree.c (build_cplus_array_type_1): Don't pass any VLA types - when processing_template_decl to build_array_type. - - PR c++/33962 - * pt.c (more_specialized_fn): Don't segfault if one or - both argument list end with ellipsis. - - 2007-11-18 Jakub Jelinek - - PR c++/30988 - * semantics.c (finish_call_expr): Set - current_function_returns_abnormally if fn is noreturn FUNCTION_DECL - or OVERLOAD with all noreturn functions. - - 2007-11-16 Jakub Jelinek - - PR c++/34100 - * pt.c (apply_late_template_attributes): Do nothing if decl's type is - error_mark_node. - - 2007-11-13 Jakub Jelinek - - PR c++/34054 - PR c++/34056 - PR c++/34057 - PR c++/34058 - PR c++/34060 - * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error, - set to error_mark_node the outermost POINTER_TYPE to the pack if - it is seen in a POINTER_TYPE. - (push_template_decl_real): If check_for_bare_parameter_packs - fails for function return type, set the return type to - integer_type_node. If check_for_bare_parameter_packs failed - for non-function, return error_mark_node. - - PR c++/29225 - * call.c (build_new_op): Call resolve_args before calling - build_over_call. - - 2007-11-11 Tom Tromey - - PR c++/17577: - * lex.c (handle_pragma_implementation): Use cpp_included_before. - - 2007-11-12 Manuel Lopez-Ibanez - - PR c++/8570 - * pt.c (redeclare_class_template): Update error message. Use a - note to show the previous declaration. - (tsubst_friend_class): Use the location of the friend template as - the input location before calling redeclare_class_template. - - 2007-11-11 Jakub Jelinek - - PR c++/34068 - * semantics.c (finish_pseudo_destructor_expr): Handle - object == error_mark_node. - - 2007-11-10 Jakub Jelinek - - PR c++/32241 - * pt.c (tsubst_copy_and_build) : If object_type - is not scalar type, let finish_class_member_access_expr handle - diagnostics. Pass BIT_NOT_EXPR argument to - finish_pseudo_destructor_expr. Handle SCOPE_REF properly. - - 2007-11-09 Douglas Gregor - - PR c++/33510 - * decl.c (cp_complete_array_type): If any of the initializer - elements are pack expansions, don't compute the array size yet. - - 2007-11-08 Andrew Pinski - - PR c++/30297: - * tree.c (decl_linkage): Fields have no linkage. - - 2007-11-08 Daniel Jacobowitz - - * class.c (build_ctor_vtbl_group): Lay out the new type and decl. - - 2007-11-07 Douglas Gregor - - PR c++/33045 - PR c++/33837 - PR c++/33838 - * semantics.c (finish_decltype_type): See through INDIRECT_REFs. - Be careful with ERROR_MARK_NODEs. - * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL - argument. - - 2007-11-07 Jakub Jelinek - - PR c++/33501 - * call.c (build_over_call): Don't check TREE_ADDRESSABLE - on incomplete type. - - 2007-11-06 Douglas Gregor - - PR c++/33977 - PR c++/33886 - * tree.c (c_build_qualified_type): Define bridge to - cp_build_qualified_type. - - 2007-11-06 Douglas Gregor - - PR c++/31439 - PR c++/32114 - PR c++/32115 - PR c++/32125 - PR c++/32126 - PR c++/32127 - PR c++/32128 - PR c++/32253 - PR c++/32566 - * typeck.c (check_return_expr): Pass address of retval to - check_for_bare_parameter_packs. - * class.c (build_base_field): Tolerate bases that have no layout - due to errors. - (end_of_base): Ditto. - * tree.c (canonical_type_variant): Be careful with - ERROR_MARK_NODE. - * cp-tree.h (check_for_bare_parameter_packs): Now accepts a - tree*. - * pt.c (find_parameter_pack_data): Add set_packs_to_error field, - which states whether parameter packs should be replaced with - ERROR_MARK_NODE. - (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever - possible. If set_packs_to_error is set true, replace the parameter - pack with ERROR_MARK_NODE. Manage our own pointer sets. - (uses_parameter_packs): Don't set parameter packs to - ERROR_MARK_NODE. - (check_for_bare_parameter_packs): Now takes a pointer to a tree, - which may be modified (if it is a parameter pack). Instructs - find_parameter_packs_r to replace parameter packs with - ERROR_MARK_NODE (so that they won't cause errors later on). - (process_template_parm): Pass pointer to - check_for_bare_parameter_packs. - (process_partial_specialization): Replace pack expansions before - the end of the template argument list with ERROR_MARK_NODE. - (push_template_decl_real): Pass pointer to - check_for_bare_parameter_packs. Replace parameter packs not at the - end of the template parameter list with ERROR_MARK_NODE. - (convert_template_argument): Be more careful about using DECL_NAME - on only declarations. - (unify): Can't unify against ERROR_MARK_NODE. - * semantics.c (finish_cond): Pass pointer to - check_for_bare_parameter_packs. - (finish_expr_stmt): Ditto. - (finish_for_expr): Ditto. - (finish_switch_cond): Pass pointer to - check_for_bare_parameter_packs, and call it before we put the - condition into the statement. - (finish_mem_initializers): Pass pointer to - check_for_bare_parameter_packs. - (finish_member_declaration): Ditto. - * parser.c (cp_parser_base_clause): Ditto. - - 2007-11-06 Jakub Jelinek - - PR target/33168 - * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already - with the final TREE_READONLY flag in place. processing_template_decl - is known to be 0 in this part of function. - - PR c++/33894 - * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not - OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC. - * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P. - * semantics.c (finish_omp_atomic): Revert most of the - 2007-02-05 changes, just keep the new representation of - OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC. - - 2007-11-05 H.J. Lu - - PR c++/33871 - * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked - local. - - 2007-11-05 Douglas Gregor - - PR c++/33996 - PR c++/33235 - PR c++/33930 - * typeck.c (merge_types): Don't lose rvalue references when - merging types. - * call.c (build_over_call): Don't elide move constructors just - because the copy constructor is trivial (!). - (compare_ics): If comparing cv-qualifiers fails, we can still order - based on binding lvalues vs. rvalues. - - 2007-11-05 Douglas Gregor - - PR c++/33939 - * pt.c (unify_pack_expansion): bring handling of function call - arguments into line with type_unification_real. - - 2007-11-05 Manuel Lopez-Ibanez - - * typeck.c (build_binary_op): Use pedwarn instead of error for - consistency. - - 2007-11-05 Jakub Jelinek - - PR c++/33836 - * parser.c (cp_parser_unary_expression): For &&label call - cp_parser_non_integral_constant_expression and return error_mark_node - if it returned true. - - PR c++/33969 - * decl.c (grokdeclarator): Don't call build_memfn_type if type - is neither FUNCTION_TYPE nor METHOD_TYPE. - - 2007-11-02 Jakub Jelinek - - PR c++/33516 - * parser.c (cp_parser_nested_name_specifier_opt): Use - TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete - typedef of currently open class. - - 2007-11-02 Paolo Carlini - - PR c++/33495 - * error.c (dump_expr): Deal specially with statements. - - 2007-11-01 Jason Merrill - - PR c++/30897 - * pt.c (push_template_decl_real): Set DECL_CONTEXT on template - template parms. - (lookup_template_class): Use it to get the outer template args - for instantiating one. - - PR c++/29236 - * pt.c (reduce_template_parm_level): tsubst the parameters - of a template template parm. - - 2007-11-01 Douglas Gregor - - PR c++/33955 - * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE. ! 2007-11-01 Jakub Jelinek ! ! PR c++/32384 ! * parser.c (cp_parser_postfix_dot_deref_expression): If ! POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor ! first and if that succeeds and type is SCALAR_TYPE_P, create ! PSEUDO_DTOR_EXPR. ! ! PR c++/32260 ! * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment. ! (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo ! as for std::type_info. ! ! 2007-10-31 Paolo Carlini ! ! PR c++/33494 ! * cxx-pretty-print.c (pp_cxx_typeid_expression, ! pp_cxx_delete_expression): Change to static linkage. ! * cxx-pretty-print.h: Adjust declarations. ! * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR, ! MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR, ! MODOP_EXPR): Forward to pp_expression. ! ! * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR): ! Fix typo. ! ! 2007-10-31 Christian Bruel ! Mark Mitchell ! ! PR c++/19531 ! * typeck.c (check_return_expr): Don't set named_return_value_okay_p ! if retval is volatile. ! 2007-10-30 Jakub Jelinek ! ! PR c++/33616 ! * decl2.c (build_offset_ref_call_from_tree): Call ! build_non_dependent_expr on object prior to building ADDR_EXPR from it ! if FN is DOTSTAR_EXPR. ! ! 2007-10-30 Douglas Gregor ! ! PR c++/31993 ! PR c++/32252 ! * pt.c (find_parameter_packs_r): Fix typo in comment. ! (convert_template_argument): Look at the pattern of a pack ! expansion to determine what kind of entity we're converting. ! (coerce_template_parameter_pack): When we have coerced a non-type ! template parameter pack, substitute into the type of that pack. ! (tsubst_pack_expansion): When our substitution of a parameter pack ! is a "trivial" substitution of itself, just substitute into the ! pack expansion rather than actually expanding. ! ! 2007-10-29 Jakub Jelinek ! ! PR c++/33841 ! * class.c (check_bitfield_decl): Don't set field's type to error_mark_node ! for non-integral type bitfields. Return true if bitfield is correct, false ! error has been diagnosed. ! (check_field_decls): If check_bitfield_decl returned false, call also ! check_field_decl. ! ! 2007-10-28 Paolo Carlini ! Mark Mitchell ! ! PR c++/30659 ! * pt.c (do_decl_instantiation): If the VAR_DECL is not a ! class member error out and return. ! ! 2007-10-27 Jakub Jelinek ! ! * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope ! to current_function_decl rather than 0. ! ! PR c++/33844 ! * cxx-pretty-print.c (pp_cxx_pm_expression) : Print ! ->* rather than .*. ! * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR. ! ! 2007-10-27 Jason Merrill ! ! PR c++/5247 ! * call.c (convert_default_arg): Detect recursion. ! ! 2007-10-27 Jakub Jelinek ! ! PR c++/33842 ! * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype. ! * cxx-pretty-print.c (pp_cxx_primary_expression): Handle ! OFFSETOF_EXPR. ! (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New ! functions. ! * error.c (dump_expr): Handle OFFSETOF_EXPR. ! ! 2007-10-26 Jason Merrill ! ! PR c++/24791 ! * pt.c (get_template_info): New fn. ! (template_class_depth): Use it. ! (push_template_decl_real): Check that the template args of the ! definition match the args of the previous declaration. ! ! 2007-10-26 Paolo Carlini ! ! PR c++/31988 ! * decl2.c (coerce_new_type): Do not allow a default argument for ! the first parameter. ! ! 2007-10-26 Douglas Gregor ! ! PR c++/33839 ! * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we ! don't see the leading '('. Only lookup names if we get an ! IDENTIFIER_NODE. ! ! 2007-10-26 Jakub Jelinek ! ! PR c++/33744 ! * parser.c (cp_parser_parenthesized_expression_list): Set ! greater_than_is_operator_p to true in between the parens. ! ! 2007-10-26 Paolo Carlini ! ! PR c++/31747 ! * decl.c (grokdeclarator): In case of conflicting specifiers ! just return error_mark_node. ! ! 2007-10-26 Ollie Wild ! ! * expr.c (cxx_expand_expr): Removed. ! * cp-tree.h (exx_expand_expr): Removed. ! * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr ! with c_expand_expr. ! ! 2007-10-25 Paolo Carlini ! ! PR c++/33843 ! * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR. ! ! 2007-10-23 Jason Merrill ! ! PR c++/25950 (DR 391) ! * call.c (struct conversion): Remove check_copy_constructor_p. ! (reference_binding): Always bind a reference directly to a ! compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during ! temporary creation. ! (check_constructor_callable): Remove. ! (convert_like_real): Don't call it. ! (initialize_reference): Don't call check_constructor_callable. ! (standard_conversion): Check LOOKUP_NO_CONVERSION instead of ! LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base ! conversions if LOOKUP_NO_TEMP_BIND. ! (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND. ! (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for ! second conversion. ! * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove. ! ! 2007-10-22 Jakub Jelinek ! ! PR c++/33372 ! * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p ! before checking if its type is integral. ! ! 2007-10-22 Jason Merrill ! ! PR c++/33620 ! * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES. ! * pt.c (apply_late_template_attributes): Splice out dependent ! attributes from DECL_ATTRIBUTES. ! ! * decl.c (cxx_maybe_build_cleanup): Use build_address. ! ! 2007-10-17 Manuel Lopez-Ibanez ! ! * typeck.c (build_binary_op) : Use appropriate warning option ! instead of unnamed warning. ! ! 2007-10-16 Paolo Carlini ! ! PR c++/31446 ! * pt.c (current_template_args): Do not change TREE_LIST elements ! with a TREE_VALUE of error_mark_node. ! ! 2007-10-16 Mark Mitchell ! ! * typeck.c (cp_apply_type_quals_to_decl): Expand documentation. ! * decl.c (start_decl): Tidy. ! (start_decl_1): Call cp_apply_type_quals_to_decl after completing ! the type. ! (grokdeclarator): Clarify comment. ! ! 2007-10-14 Andrew Pinski ! ! PR c++/30303 ! * decl.c (grokfndecl): Return NULL after the "definition of ! implicitly-declared" error happened. ! ! 2007-10-12 Simon Martin ! ! PR c++/26698 ! * call.c (build_user_type_conversion_1): Do not consider conversion ! functions to convert a (possibly cv-qualified) object to the (possibly ! cv-qualified) same object type (or a reference to it), to a (possibly ! cv-qualified) base class of that type (or a reference to it). ! ! 2007-10-12 Paolo Carlini ! ! * pt.c (tsubst): Use template_parm_level_and_index. ! ! 2007-10-12 Jakub Jelinek ! ! PR c++/32121 ! * parser.c (cp_parser_compound_statement): Handle label-declarations ! at the beginning of the compound statement. ! (cp_parser_block_declaration): Issue diagnostics about __label__ ! not at the beginning of a block. ! ! 2007-10-11 Paolo Carlini ! ! PR c++/33461 ! * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node ! to convert_template_argument. ! (coerce_template_parms): Return error_mark_node after fixed-length ! error. ! (tsubst_decl): Check for error_mark_node the return value of the ! first tsubst in 'case VAR_DECL'. ! ! 2007-10-08 Ollie Wild ! ! * typeck2.c (digest_init): Call cplus_expand_constant after ! convert_for_initialization. ! * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed. ! * expr.c (cplus_expand_constant): Updated function description. ! ! 2007-10-04 Jason Merrill ! ! PR c++/20416 ! * call.c (initialize_reference): Handle local static reference ! temps properly. ! ! 2007-10-03 Jason Merrill ! PR c++/32470 ! * name-lookup.c (push_namespace_with_attrs): Fold back into... ! (push_namespace): Here. ! (handle_namespace_attrs): New fn for the attr code. ! (leave_scope): Don't pop_visibility. ! * name-lookup.h (struct cp_binding_level): Remove has_visibility. ! * parser.c (cp_parser_namespace_definition): Call ! handle_namespace_attrs and pop_visibility as appropriate. ! PR c++/11756 ! * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry. ! 2007-10-03 Alexandre Oliva ! * decl.c (duplicate_decls): Preserve linkage flags for mere ! redeclarations of gnu_inline definitions. ! 2007-10-03 Jason Merrill ! PR c++/15764 ! * decl.c (wrap_cleanups_r): New fn. ! (wrap_temporary_cleanups): New fn. ! (initialize_local_var): Call it. ! 2007-09-29 Jason Merrill ! PR c++/33094 ! * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member ! constant to not have DECL_EXTERNAL if it's file-local. ! 2007-09-28 Ollie Wild Revert - 2007-09-27 Ollie Wild - - * typeck2.c (digest_init): Call cplus_expand_constant after - convert_for_initialization. - * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed. - * expr.c (cplus_expand_constant): Updated function description. - - 2007-09-28 Jason Merrill - - PR c++/10179 - * class.c (layout_empty_base): Take rli parameter, update - rli->record_align if empty base has user-specified alignment. - (build_base_field): Pass rli to it. - - 2007-09-28 Paolo Carlini - - PR c++/33213 - * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION. - - 2007-09-28 Paolo Carlini - - PR c++/33118 - * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT. - (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK. - (dump_parameters): Just call dump_type for argument packs too. - - 2007-09-28 Jakub Jelinek - - PR c++/31434 - * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION - qualification by creating qualified PACK_EXPANSION_PATTERN and - then calling make_pack_expansion on it. - - 2007-09-27 Ollie Wild - - * typeck2.c (digest_init): Call cplus_expand_constant after - convert_for_initialization. - * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed. - * expr.c (cplus_expand_constant): Updated function description. - - 2007-09-27 Jason Merrill - - PR c++/33571 - * decl2.c (is_late_template_attribute): Don't crash on unknown - attribute. - - 2007-09-27 Paolo Carlini - - PR c++/33493 - * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR. - * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing - spaces in the formatting. - * cxx-pretty-print.h (pp_cxx_delete_expression): Declare. - - 2007-09-27 Jakub Jelinek - - * error.c (cxx_print_error_function): Add third argument, pass - it over to lhd_print_error_function. - (cp_print_error_function): If diagnostic->abstract_origin, print - virtual backtrace. - * cp-tree.h (struct diagnostic_info): New forward decl. - (cxx_print_error_function): Add third argument. - - 2007-09-25 Simon Martin - - PR c++/33207 - * name-lookup.c (pushtag): Do not create an implicit typedef before - the associated type declaration is known to be valid. - - 2007-09-25 Jakub Jelinek - - * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids - rather than pointers. - - 2007-09-24 Danny Smith - - PR c++/14688 - * search.c (check_final_overrider): Fail if - targetm.comp_type_attributes returns 0. - - 2007-09-24 Jason Merrill - - PR c++/33239 - * pt.c (resolve_typename_type): Don't look things up in the original - template if it would mean losing template arguments. - - 2007-09-24 Jakub Jelinek - - PR c++/33506 - * cp-tree.h (cxx_type_hash_eq): New prototype. - * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine. - * tree.c (cxx_type_hash_eq): New function. - - 2007-09-24 Douglas Gregor - - PR c++/33185 - * tree.c (cp_build_qualified_type_real): Build a canonical - ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type. - - 2007-09-24 Douglas Gregor - - PR c++/33112 - PR c++/33185 - * tree.c (cplus_array_compare): Compare pointers, not types. - (build_cplus_array_type_1): Store new array type into the hash - table before building the canonical type; build the canonical type - correctly. - (cp_build_qualified_type_real): Put all of the array types with - cv-qualified element types into the C++ array hash table, built as - variants of the unqualified versions. - - 2007-09-23 Jason Merrill - - PR c++/16370 - * decl.c (grokdeclarator): Look through implicit TYPE_DECLs - for deprecation warnings. - - 2007-09-22 Jason Merrill - - PR c++/15269 - * call.c (build_over_call): Warn about deprecated virtuals. - - PR c++/19407 - * cp-tree.h (ATTR_IS_DEPENDENT): New macro. - (MAYBE_TAGGED_TYPE_P): Remove. - * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT - instead of calling is_late_template_attribute again. - (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag. - (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL. - Don't crash on typedefs from non-template classes. - * decl2.c (grokfield): Don't sorry about attrs on template parms. - (is_late_template_attribute): All attributes applied to template - parms or typename types are dependent. Static. - (splice_template_attributes): Pass decl through. - (save_template_attributes): Likewise. - - 2007-09-20 Jakub Jelinek - - PR c++/33496 - * pt.c (tsubst_copy) : Handle error_mark_node - returned from tsubst_pack_expansion. - (tsubst_copy_and_build) : Likewise. - (tsubst_copy_and_build) : Likewise. - - 2007-09-20 Paolo Carlini - - PR c++/33460 - * semantics.c (finish_id_expression): Use consistently - context_for_name_lookup. - * decl.c (fixup_anonymous_aggr): Fix error message for - anonymous struct (vs union). - - 2007-09-19 Jason Merrill - - PR c++/7586 - * pt.c (tsubst): Handle typedefs by looking for the specialization. - (retrieve_specialization): Only tagged types use - DECL_TEMPLATE_INSTANTIATIONS. - (instantiate_class_template): Push nested classes too. - (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for - tagged types. - * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro. - * init.c (is_aggr_type): Remove redundant tests. - * class.c (push_nested_class): Use CLASS_TYPE_P. - - 2007-09-20 Paolo Carlini - - PR c++/33459 - * init.c (build_zero_init): If, recursively, build_zero_init - returns a NULL_TREE, do not append it to the VEC of constructors. - - 2007-09-18 Jason Merrill - - PR c++/17743 - * pt.c (apply_late_template_attributes): Set processing_template_decl. - (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass - ATTR_FLAG_TYPE_IN_PLACE. - (tsubst): Do unqualified lookup to find typedefs from current class. - [ARRAY_TYPE]: Propagate alignment info. - * decl2.c (is_late_template_attribute): Only defer handling of - attribute aligned if the expression is dependent. - (save_template_attributes): If we're deferring any attributes, - make this a naming typedef. - - 2007-09-18 Paolo Carlini - - PR c++/33462 (again) - * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print - va_arg instead of __builtin_va_arg. - - 2007-09-18 Paolo Carlini - - PR c++/33462 - * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add. - (pp_cxx_primary_expression): Use it. - * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare. - * error.c (dump_expr): Use it. - - 2007-09-18 Paolo Carlini - - PR c++/33463 - * cxx-pretty-print.c (pp_cxx_postfix_expression): Split - out case TYPEID_EXPR to... - (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren - and pp_cxx_right_paren. - * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare. - * error.c (dump_expr): Use it. - - 2007-09-18 Paolo Carlini - - PR c++/33464 - * cxx-pretty-print.c (pp_cxx_trait_expression): Add. - (pp_cxx_primary_expression): Use it. - * cxx-pretty-print.h (pp_cxx_trait_expression): Declare. - * error.c (dump_expr): Use it. - - 2007-09-16 Paolo Carlini - - PR c++/33124 - * init.c (build_new): Remove warning for zero-element - allocations. - - 2007-09-16 Nathan Sidwell - - PR c++/32756 - * call.c (maybe_handle_implicit_object): Set this_p, clear - rvaluedness_matches_p. - (compare_ics): Do not compare rvaluedness matching when one of the - operands is an implicit object. - - 2007-09-14 Jason Merrill - - PR c++/17743, c++/19163 - * decl2.c (is_late_template_attribute): New fn. - (splice_template_attributes, save_template_attributes): New fns. - (cplus_decl_attributes): Call save_template_attributes. - * pt.c (apply_late_template_attributes): New fn. - (instantiate_class_template, tsubst_decl): Use it. - * cp-tree.h: Declare is_late_template_attribute. - - 2007-09-13 Tom Tromey - - * parser.c (cp_lexer_new_main): Don't use - c_lex_return_raw_strings. - (cp_lexer_get_preprocessor_token): Update. Add special case when - lexer is NULL. - - 2007-09-11 Jan Hubicka - - * method.c (use_thunk): Use tree_rest_of_compilation - * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill. - (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define. - * cp-tree.h (expand_body): Kill. - (emit_associated_thunks): Declare. - * semantics.c (emit_associated_thunks): Export. - (expand_body): Kill. - - 2007-09-09 David Daney - - PR c++/33324 - * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR - to calculate cookie_ptr. - - 2007-09-08 Jason Merrill - - PR c++/33342 - * pt.c (most_specialized_class): Set processing_template_decl - while tsubsting partial spec args. - - 2007-09-06 Jason Merrill - - * decl2.c (get_guard): Copy visibility from the guarded variable. ! 2007-09-06 Jan Hubicka ! ! * semantics.c (expand_body): Do not mark arguments of clones used. ! ! 2007-09-06 Paolo Carlini ! ! PR c++/32674 ! * decl.c (cp_finish_decl): When processing_template_decl, ! deal correctly with init as TREE_LIST. ! ! 2007-09-06 Tom Tromey ! ! * decl.c (finish_function): Put return's location on line zero of ! file. ! ! 2007-09-05 Jason Merrill ! ! PR c++/15745 ! * except.c (prepare_eh_type): Use type_decays_to. ! ! PR c++/15097 ! * init.c (build_delete): Use build_headof to get the address of the ! complete object if we aren't using the deleting destructor. ! * rtti.c (build_headof): No longer static. ! * cp-tree.h: Declare it. ! ! 2007-09-06 Jakub Jelinek ! ! * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX ! decl if a prototype for XX is provided with throw(). ! ! PR c++/33289 ! * decl.c (builtin_function_1): Set DECL_ANTICIPATED also ! on __*_chk non-__builtin_* decls. ! ! 2007-09-05 Paolo Carlini ! ! PR c++/30302 ! * semantics.c (finish_id_expression): Use context_for_name_lookup ! insted of DECL_CONTEXT, to see through anonymous structs and unions. ! * class.c (finish_struct_anon): Deal correctly with anonymous ! structs (vs unions, as GNU extension) in error messages. ! ! 2007-09-05 Jan Hubicka ! ! * sematics.c (expand_body): Remove unnecesary import_export_decl ! call, DECL_EXTERNAL checks and current_function_decl saving. ! ! 2007-09-05 Paolo Carlini ! ! PR c++/29731 (again) ! * parser.c (cp_parser_primary_expression): Return error_mark_node ! when a statement-expression is found in a template-argument list. ! ! 2007-09-04 Jason Merrill ! ! * except.c (initialize_handler_parm): Use ! fold_build_cleanup_point_expr. ! ! PR c++/31419 ! * call.c (reference_binding): Don't look for user-defined conversions ! to the same type. ! ! PR c++/31411 ! * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside ! the MUST_NOT_THROW_EXPR. ! ! 2007-09-04 Richard Sandiford ! ! * decl.c (cp_finish_decl): Call determine_visibility before ! make_rtl_for_nonlocal_decl. ! ! 2007-09-04 Jason Merrill ! ! PR c++/14032 ! * pt.c (most_specialized_class): Substitute outer template ! arguments into the arguments of a member template partial ! specialization. ! (strip_innermost_template_args): New fn. ! ! 2007-09-03 Daniel Jacobowitz ! ! * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB. ! ! 2007-09-03 Kaveh R. Ghazi ! ! * call.c (name_as_c_string): Supply a TYPE for CONST_CAST. ! * decl.c (cp_make_fname_decl): Likewise, ! * parser.c (cp_parser_string_literal): Likewise, ! * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE. ! * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): ! Likewise, ! ! 2007-09-02 Paolo Carlini ! ! PR c++/33208 ! * typeck.c (build_unary_op): Fix error message for ! Boolean expression as operand to operator--. ! ! 2007-09-01 Kaveh R. Ghazi ! ! * tree.c (pod_type_p, zero_init_p): Use strip_array_types. ! * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): ! Likewise. ! ! 2007-08-31 Douglas Gregor ! ! PR c++/32597 ! * init.c (build_default_init): Make extern. ! * cp-tree.h (build_default_init): Declare here. ! * pt.c (tsubst_expr): When the instantiation of the initializer of ! a variable results in an empty list, default-initialize the ! variable. ! (tsubst_copy_and_build): When the instantiation of the initializer ! in a new expression results in an empty initializer list, ! default-initialize it. ! ! 2007-08-31 Douglas Gregor ! ! * mangle.c (write_type): Change mangling of rvalue reference from ! `RR' to `O'. ! ! 2007-08-31 Jakub Jelinek ! ! * decl.c (duplicate_decls): Remove duplicated line. ! ! 2007-08-31 Paolo Carlini ! ! PR c++/33210 ! * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with ! BOUND_TEMPLATE_TEMPLATE_PARM. ! ! 2007-08-31 Paolo Carlini ! ! PR c++/32113 ! * search.c (lookup_member): Check the name argument for ! error_mark_node. ! 2007-08-31 Paolo Carlini ! PR c++/33212 ! * parser.c (cp_parser_trait_expr): Check rerurn value of ! cp_parser_type_id. ! 2007-08-30 Ollie Wild ! * cvt.c (cp_convert_to_pointer): Remove force parameter. Call ! convert_ptrmem for pointer to member conversions. ! (convert_to_pointer_force): Update cp_convert_to_pointer call. ! (ocp_convert): Update cp_convert_to_pointer call. ! * typeck.c (convert_ptrmem): Add conditional for null pointers to ! members. ! (build_static_cast_1): Check can_convert for conversions in either ! direction. ! (get_delta_difference_1): New function. ! (get_delta_difference): Refactor to call get_delta_difference_1. ! 2007-08-30 Jakub Jelinek ! * decl.c (start_preparsed_function): Set ! DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions. ! 2007-08-28 Paolo Carlini ! PR c++/33209 ! * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and ! BOUND_TEMPLATE_TEMPLATE_PARM. ! 2007-08-28 Jakub Jelinek ! PR c++/32596 ! PR c++/32400 ! * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN ! and DECL_NOT_REALLY_EXTERN if tmpl_func is not public. ! 2007-08-27 Jason Merrill ! PR c++/29000 ! * pt.c (build_non_dependent_expr, type_dependent_expression_p): ! Look inside STMT_EXPR. ! * semantics.c (stmt_expr_value_expr): New fn. ! * cp-tree.h: Declare it. ! PR c++/28558 ! * decl.c (groktypename): Ignore attributes applied to class type. ! 2007-08-28 Richard Guenther ! * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS. ! 2007-08-28 Gabriel Dos Reis ! ! * error.c (dump_expr): Handle COMPLEX_CST. ! * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise. ! (pp_cxx_expression): Likewise. ! 2007-08-27 Alexandre Oliva ! * decl.c (GNU_INLINE_P): New. ! (duplicate_decls): Handle gnu_inline. Merge attributes and ! some flags in overriding definitions. ! (redeclaration_error_message): Handle gnu_inline. ! (start_preparsed_function): Likewise. ! 2007-08-25 Kaveh R. Ghazi ! * call.c (sufficient_parms_p): Constify. ! * class.c (same_signature_p): Likewise. ! * cp-gimplify.c (is_invisiref_parm, ! cxx_omp_privatize_by_reference): Likewise. ! * cp-objcp-common.c (has_c_linkage): Likewise. ! * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK, ! sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p, ! grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for, ! num_artificial_parms_for, comp_template_parms, ! template_parameter_pack_p, any_dependent_template_arguments_p, ! any_type_dependent_arguments_p, any_value_dependent_elements_p, ! repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p, ! zero_init_p, member_p, cp_lvalue_kind, ! builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p, ! varargs_function_p, is_dummy_object, special_function_kind, ! string_conv_p, type_unknown_p, comp_except_specs, compparms, ! comp_cv_qualification, is_bitfield_expr_with_lowered_type, ! unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly, ! cp_has_mutable_p, at_least_as_qualified_p, ! invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise. ! * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise. ! * except.c (nothrow_libfn_p): Likewise. ! * method.c (skip_artificial_parms_for, num_artificial_parms_for): ! Likewise. ! * pt.c (comp_template_parms, template_parameter_pack_p, ! any_type_dependent_arguments_p, any_value_dependent_elements_p, ! any_dependent_template_arguments_p): Likewise. ! * repo.c (repo_export_class_p): Likewise. ! * semantics.c (anon_aggr_type_p): Likewise. ! * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p, ! builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p, ! varargs_function_p, member_p, is_dummy_object, pod_type_p, ! zero_init_p, special_function_p): Likewise. ! * typeck.c (comp_array_types, type_unknown_p, comp_except_specs, ! comp_array_types, at_least_as_qualified_p, comp_cv_qualification, ! compparms, invalid_nonstatic_memfn_p, ! is_bitfield_expr_with_lowered_type, unlowered_expr_type, ! string_conv_p, ptr_reasonably_similar, cp_type_readonly, ! cp_has_mutable_p, lvalue_or_else): Likewise. ! 2007-08-25 Paolo Bonzini ! * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case. ! * cp-objcp-common.c (cp_tree_size): Ditto. ! * tree.c (cp_walk_subtrees): Ditto ! * cp-tree.def (TINST_LEVEL): Go away. ! * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level, ! move together with other non-tree structs. ! (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL. ! (union lang_tree_node): Eliminate tinst_level field. ! (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate. ! (current_instantiation, outermost_tinst_level): Return ! a "struct tinst_level *". ! * error.c (print_instantiation_partial_context): Change second ! parameter to a "struct tinst_level *". Replace accessor macros ! with field access. ! (print_instantiation_full_context): Likewise. ! * lex.c (in_main_input_context): Likewise. ! * pt.c (struct pending_templates): New. ! (pending_templates, last_pending_template): Use it as a type. ! (current_tinst_level): Change typo to "struct tinst_level *" ! (reopen_tinst_level): Accept "struct tinst_level *", return decl. ! (add_pending_template): Construct a "struct pending_template". ! Replace TINST_LEVEL accessor macros with field access. ! (push_tinst_level): Likewise, using GGC_NEW instead of make_node. ! (pop_tinst_level): Likewise. ! (instantiate_pending_templates): Likewise. Factor common code used ! when an instantiation has been done. ! (outermost_tinst_level): Replace tree_last with loop. ! (current_instantiation): Return a "struct tinst_level *". ! 2007-08-24 Ollie Wild ! * name-lookup.c (add_decl_to_level): Remove addition to vtables chain. ! * name-lookup.h (cp_binding_level): Remove vtables member. ! 2007-08-24 Richard Guenther ! * tree.c (cp_cannot_inline_tree_fn): Remove. ! * cp-tree.h (cp_cannot_inline_tree_fn): Likewise. ! * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN): ! Remove define. ! 2007-08-24 Jakub Jelinek ! PR c++/32567 ! * typeck.c (build_unary_op) : Return ! error_mark_node right away if build_expr_type_conversion ! returned it. ! PR c++/32898 ! * name-lookup.c (set_decl_namespace): lookup_qualified_name failure ! is error_mark_node rather than NULL_TREE. * pt.c (check_explicit_specialization): Likewise. ! PR c++/31941 ! * error.c (resolve_virtual_fun_from_obj_type_ref): Handle ! TARGET_VTABLE_USES_DESCRIPTORS targets properly. ! ! 2007-08-22 Jason Merrill ! ! PR c++/29365 ! * pt.c (outermost_tinst_level): New function. ! * lex.c (in_main_input_context): New function. ! * cp-tree.h: Declare it. ! * decl2.c (constrain_class_visibility): Use it to avoid warning ! about uses of the anonymous namespace in the main input file. ! ! 2007-08-21 Jakub Jelinek ! ! * init.c (build_new_1): Use get_target_expr instead of save_expr. ! ! 2007-08-20 Pawel Sikora ! ! PR c++/7302 ! * class.c (finish_struct_1): Warn when a class has virtual ! functions and accessible non-virtual destructor. ! ! 2007-08-20 Richard Guenther ! ! PR c++/22369 ! PR c++/22451 ! * call.c (build_new_method_call): Convert initializer to ! the basetype. ! * init.c (build_aggr_init): Do not fiddle with types. ! (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR. ! * except.c (build_throw): Do not drop qualifiers for the ! pointer type. ! * typeck.c (get_member_function_from_ptrfunc): Do not ! fiddle with types, instead convert. ! (build_ptrmemfunc1): Convert to the target type for ! initialization. ! (gfc_trans_allocate): Convert result to target type. ! * cp-objcp-common.c (cxx_get_alias_set): Pointers to ! pointer-to-member structures shall have alias set zero as well. ! ! 2007-08-20 Richard Guenther ! ! * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): ! Remove. ! * cp-tree.h (cp_auto_var_in_fn_p): Remove. ! (nonstatic_local_decl_p): Likewise. ! * tree.c (cp_auto_var_in_fn_p): Remove. ! * decl.c (nonstatic_local_decl_p): Remove. ! ! 2007-08-20 Richard Guenther ! ! * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): ! Remove define. ! * tree.h (cp_walk_tree): New define to walk_tree_1 with ! cp_walk_subtrees lh parameter. ! (cp_walk_tree_without_duplicates): New define to ! walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter. ! * tree.c (count_trees): Call ! cp_walk_tree_without_duplicates. ! (verify_stmt_tree): Call cp_walk_tree. ! (break_out_target_exprs): Likewise. ! (WALK_SUBTREE): Likewise. ! * cp-gimplify.c (cp_genericize): Likewise. ! * cp-pt.c (find_parameter_packs_r): Likewise. ! (uses_parameter_packs): Likewise. ! (make_pack_expansion): Likewise. ! (check_for_bare_parameter_packs): Likewise. ! (for_each_template_parm): Likewise. ! * decl.c (check_default_argument): Call ! cp_walk_tree_without_duplicates. ! * except.c (build_throw): Likewise. ! * decl2.c (type_visibility): Likewise. ! * semantics.c (expand_or_defer_fn): Likewise. ! (finalize_nrv): Call cp_walk_tree. ! ! 2007-08-20 Jakub Jelinek ! ! PR c++/33025 ! * init.c (build_new_1): Rename placement_var variable to placement_expr. ! Initialize it with save_expr rather than get_temp_regvar. ! ! 2007-08-17 Andrew Pinski ! ! PR c++/28989 ! * tree.c (lvalue_p_1 ): SAVE_EXPRs are never ! lvalues. ! ! 2007-08-17 Ollie Wild ! ! PR c++/31749 ! * name-lookup.c (do_nonmember_using_decl): Shift implicit type ! declarations into appropriate slots for comparison. Fix type ! comparison. ! ! 2007-08-17 Paolo Carlini ! ! PR c++/32112 ! * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE. ! * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise. ! ! 2007-08-17 Paolo Carlini ! ! PR c++/32870 ! * parser.c (cp_parser_class_head): Improve error message. ! ! 2007-08-16 Seongbae Park ! ! * pt.c (instantiate_decl): Set input_location ! for the function end. ! ! 2007-08-16 Kaveh R. Ghazi ! * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size): ! Constify. ! * cp-tree.h (local_variable_p, nonstatic_local_decl_p, ! class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals, ! cxx_incomplete_type_diagnostic, cxx_incomplete_type_error, ! cxx_warn_unused_global_decl, cp_expr_size): Likewise. ! * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise. ! * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise. ! * typeck.c (cp_type_quals): Likewise. ! * typeck2.c (cxx_incomplete_type_diagnostic, ! cxx_incomplete_type_error): Likewise. ! 2007-08-16 Paolo Carlini ! PR c++/31132 ! * pt.c (tsubst_friend_function): When check_classfn ! returns error_mark_node likewise return it. ! 2007-08-15 Jakub Jelinek ! PR c++/32992 ! * typeck.c (check_return_expr): Don't NRV optimize vars in ! anonymous unions. ! * decl.c (finish_function): Comment fix. ! 2007-08-15 Paolo Carlini ! PR c++/33035 ! * pt.c (push_template_decl_real): Depending on TYPE_P ! use either TYPE_CONTEXT or DECL_CONTEXT. ! 2007-08-14 Mark Mitchell ! * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if ! constructors and destructors return this. ! 2007-08-14 Paolo Carlini ! PR c++/27211 ! * decl2.c (check_classfn): Return error_mark_node in case of error; ! in that case, do not call add_method. ! * decl.c (start_decl): Deal with check_classfn returning error_mark_node. - (grokfndecl): Likewise. - * pt.c (tsubst_friend_function): Likewise. - - 2007-08-14 Andrew Pinski - - PR c++/30428 - * typeck.c (build_binary_op): Disallow vector float types with - BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR. - - 2007-08-11 Ian Lance Taylor - - * cp-objcp-common.c (cxx_get_alias_set): Change return type to - alias_set_type. - * cp-tree.h (cxx_get_alias_set): Update declaration. - - 2007-08-10 Ollie Wild - - * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous - type lookups. - (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous - function parameter. - (unqualified_namespace_lookup): Fix ambiguous_decl call. - (lookup_using_namespace): Fix ambiguous_decl call. - (qualified_lookup_using_namespace): Fix ambiguous_decl call. - - 2007-08-10 Kaveh R. Ghazi - - * call.c (name_as_c_string): Use CONST_CAST. - * decl.c (build_decl): Likewise. - * parser.c (cp_parser_string_literal): Likewise. - - 2007-08-10 Paolo Carlini - - PR c++/17763 - * error.c (dump_expr): Consistently use the *_cxx_* - variants of the pretty-print functions. - - 2007-08-10 Paolo Carlini - - PR c++/22256 - * decl.c (check_special_function_return_type): Just error - on return type specified for conversion operator. - - 2007-08-09 Daniel Berlin - - * typeck2.c (readonly_error): Handle general expressions. - * error.c (dump_expr): Handle POINTER_PLUS_EXPR - - 2007-08-06 Dan Hipschman - - * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to - access function name. - - 2007-08-04 Alfred Minarik - - PR pch/13676 - * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header. - * g++spec.c (lang_specific_driver): Check them. - - 2007-08-06 Paolo Carlini - - PR c++/19532 - * pt.c (inline_needs_template_parms): Fix comment; change return type - to bool. - - 2007-08-05 Volker Reichelt - - Revert: - 2007-03-26 Dirk Mueller - - * parser.c (cp_parser_member_declaration): Pedwarn - about stray semicolons after member declarations. - - 2007-08-02 Lee Millward - - PR c++/30849 - PR c++/30850 - PR c++/30851 - * parser.c (cp_parser_asm_definition): Detect and discard asm - statements with invalid inputs or outputs. - (cp_parser_asm_operand_list): Return error mark node if any - of the operands are invalid. Adjust documentation. - - 2007-08-02 Nick Clifton - - * typeck.c: Change copyright header to refer to version 3 of the - GNU General Public License and to point readers at the COPYING3 - file and the FSF's license web page. - * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, - config-lang.in, cp-tree.def, call.c, decl.h, ptree.c, - Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c, - cp-objcp-common.h, except.c, error.c, operators.def, cvt.c, - tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c, - cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c, - cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c, - name-lookup.h, parser.c: Likewise. - - 2007-08-01 Kaveh R. Ghazi - - PR middle-end/32668 - * call.c (magic_varargs_p): Honor the "type generic" attribute. - - 2007-07-30 Paolo Carlini ! PR c++/32108 ! * semantics.c (finish_label_stmt): Reject the __label__ ! extension outside function scopes. ! ! 2007-07-29 Kaveh R. Ghazi ! * parser.c (eof_token): Un-constify. ! (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc, ! cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious ! casts. ! 2007-07-28 Kazu Hirata ! * pt.c, tree.c, typeck2.c: Fix comment typos. ! 2007-07-28 Simon Martin ! Mark Mitchell ! PR c++/30917 ! * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be ! hidden due to friend declarations in local classes. ! 2007-07-27 Douglas Gregor ! * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. ! * cp-tree.def (DECLTYPE_TYPE): New. ! * error.c (dump_type): Dump DECLTYPE_TYPE nodes. ! (dump_type_prefix): Ditto. ! (dump_type_suffix): Ditto. ! * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes. ! * mangle.c (write_type): Handle DECLTYPE_TYPE. ! * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate types. - (DECLTYPE_TYPE_EXPR): New. - (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New. - (finish_declared_type): Declare. - * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print - DECLTYPE_TYPE nodes. - (pp_cxx_type_id): Ditto. - * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children. - (tsubst): Substitute into a DECLTYPE_TYPE node. - (tsubst_copy): Ditto. - (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE - nodes. - (dependent_type_p_r): DECLTYPE_TYPE types are always dependent. - * semantics.c (finish_typeof): TYPEOF_TYPE types need to use - structural equality (because we can't hash the expressions). - (finish_declared_type): New. - * lex.c (reswords): Add "decltype" keyword. - * parser.c cp_lexer_next_token_is_decl_specifier_keyword - (cp_parser_postfix_expression): Add member_access_only_p to - restrict postfix expression to member access expressions. - (cp_parser_unary_expression): Update call to - cp_parser_postfix_expression to reflect new parameter. - (cp_parser_declared_type): New. - (cp_parser_simple_type_specifier): Parse decltype types. - - 2007-07-27 Mark Mitchell - - PR c++/32346 - * call.c (convert_for_arg_passing): Only widen bitfields to their - declared types if necessary. - - 2007-07-25 Kaveh R. Ghazi - - * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand): - Constify. - - 2007-07-25 Kaveh R. Ghazi - - * decl.c (typename_hash, typename_compare): Constify. - * mangle.c (hash_type, compare_type): Likewise. - * pt.c (eq_local_specializations, hash_local_specialization): - Likewise. - * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq, - list_hash): Likewise. - * typeck2.c (pat_compare): Likewise. - - 2007-07-24 Nathan Sidwell - - * method.c (implicitly_declare_fn): Increase alignment if member - function pointer format requires it. ! 2007-07-24 Paolo Carlini ! PR c++/29001 ! * typeck.c (check_return_expr): Do not pass a null argument ! to null_ptr_cst_p. ! 2007-07-24 Paolo Carlini ! PR c++/32561 ! * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P ! only on VAR_DECL. ! 2007-07-22 Nathan Sidwell ! PR c++/32839 ! * typeck.c (convert_arguments): Only use default args if we have ! a function decl. ! PR c++/30818 ! * typeck.c (structural_comptypes): No need to check ! resolve_typename_type return value here. ! * cp-tree.h (TYPENAME_IS_RESOLVING_P): New. ! * pt.c (resolve_typename_type): Follow typename typedefs. Return ! original type rather than error_mark_node in case of failure. ! * parser.c (cp_parser_nested_name_specifier_opt): Adjust ! resolve_typename_type result check. ! (cp_parser_direct_declarator, cp_parser_head, ! cp_parser_constructor_declarator_p): Likewise. ! 2007-07-12 Kazu Hirata ! * pt.c (template_parms_variadic_p): Remove. ! * cp-tree.h: Remove the prototype for template_parms_variadic_p. ! 2007-07-12 Jakub Jelinek ! PR c++/30854 ! * error.c (dump_expr) : Pass true as last ! argument to dump_aggr_init_expr_args instead of false. ! 2007-07-11 Douglas Gregor ! * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the ! canonical types; otherwise, fall back to structural type ! comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an ! internal compiler error if the canonical types are wrong. ! ! 2007-07-11 Paolo Carlini ! PR c++/32560 ! * parser.c (cp_parser_make_indirect_declarator): When the ! the code argument is ERROR_MARK return cp_error_declarator. ! 2007-07-09 Geoffrey Keating ! PR 32617 ! * decl.c (cxx_init_decl_processing): Don't set ! force_align_functions_log. ! (grokfndecl): Honour ptrmemfunc_vbit_in_pfn. ! * typeck.c (cxx_alignof_expr): When alignof is used on a plain ! FUNCTION_DECL, return its alignment. ! 2007-07-09 Richard Guenther ! * decl.c (start_preparsed_function): Do not promote return type. ! 2007-07-08 Paolo Carlini ! PR c++/30535 ! * pt.c (unify): Never pass error_mark_node to template_decl_level. ! 2007-07-07 Mark Mitchell ! PR c++/32232 ! * pt.c (resolve_overloaded_unification): Robustify. Return a ! bool, not an int. ! (type_unification_real): Adjust accordingly. ! 2007-07-06 Richard Guenther ! * init.c (build_new_1): Use the correct pointer type. ! * typeck2.c (build_m_component_ref): Likewise. ! 2007-07-05 Mark Mitchell ! PR c++/32245 ! * init.c (build_zero_init): Always build an initializer for ! non-static storage. ! * typeck2.c (build_functional_cast): Use build_zero_init. ! PR c++/32251 ! * init.c (build_new_1): Always pass the allocation function to ! build_op_delete_call. ! * call.c (build_op_delete_call): Handle operator delete with a ! variable-argument list. Do not issue an error when no matching ! deallocation function is available for a new operator. ! PR c++/31992 ! * cp-tree.h (any_value_dependent_elements_p): Declare it. ! * decl.c (value_dependent_init_p): New function. ! (cp_finish_decl): Use it. ! * pt.c (value_dependent_expression_p): Use ! any_value_dependent_elements_p. ! * parser.c (cp_parser_primary_expression): Add comment about ! treating dependent qualified names as integral ! constant-expressions. ! 2007-07-04 Douglas Gregor ! * decl.c (build_ptrmemfunc_type): Always use structural equality ! tests when comparing pointer-to-member-function types, because the ! handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical ! types. ! ! 2007-07-03 Mark Mitchell ! * init.c (build_new): Tweak comment. ! 2007-06-29 Dave Brolley ! PR c++/31743 ! * parser.c (cp_parser_new_type_id): Don't reduce a named array ! type to its base type and number of elements here. ! * init.c (build_new): Call complete_type_or_else to ensure that the ! type is complete and to issue a diagnostic if it is not. ! (build_new_1): Don't call complete_type_or_else here. ! 2007-07-03 Richard Guenther ! PR c++/32609 ! * class.c (fixed_type_or_null): Re-lookup the hashtable slot ! after recursing. ! 2007-07-02 Simon Baldwin ! * parser.c (cp_parser_elaborated_type_specifier): Added a warning ! for inner-style nested forward declarations that don't declare ! anything useful. ! 2007-07-02 Jakub Jelinek ! PR c++/31748 ! * semantics.c (finish_omp_clauses): Use %qD instead of %qE for ! DECL_P in not a variable and appears more than once error messages. ! 2007-07-01 Ollie Wild ! * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden. ! (select_decl): Remove function. ! (unqualified_namespace_lookup): Populate binding by calling ! ambiguous_decl. Remove select_decl call. ! (lookup_qualified_name): Remove select_decl call. ! * decl.c (lookup_and_check_tag): Check for ambiguous references. ! * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error ! generation when name lookup is ambiguous. ! 2007-06-29 Douglas Gregor ! PR c++/31724 ! * init.c (build_new_1): Use structural equality on the copy of the ! array type. ! 2007-06-28 Geoffrey Keating ! * decl2.c (determine_visibility): Implement ! flag_visibility_ms_compat effect on type info. ! * decl.c (cxx_init_decl_processing): Implement ! global effect of flag_visibility_ms_compat. ! 2007-06-28 Geoffrey Keating ! * decl2.c (start_objects): Mark constructor-running function ! as artificial. ! 2007-06-26 Simon Martin ! PR c++/32111 ! * decl.c (grokdeclarator): Reset friendp for member functions declared ! friend of their own class. ! 2007-06-23 Mark Mitchell ! * decl2.c (determine_visibility): Don't look for dllexport here. ! (determine_visibility_from_class): Tidy. ! 2007-06-18 Simon Baldwin ! PR c++/31923 ! * parser.c (cp_parser_single_declaration): Added check for storage ! class other than sc_none in parsed declaration, and a flag to indicate ! if the call is part of an explicit template specialization parse. ! * (cp_parser_explicit_specialization): Specialization check flag added ! to call to cp_parser_single_declaration(), set true. ! * (cp_parser_template_declaration_after_export): Specialization check ! flag added to call to cp_parser_single_declaration(), set false. ! * pt.c (check_explicit_specialization): Added code to copy visiblity ! and linkage from the templated function to the explicit specialization. ! 2007-06-15 Andrew Pinski ! * typeck.c (build_binary_op): For templates build the ! expression in pieces to avoid the assert in build2_stat. ! (get_member_function_from_ptrfunc): ! Change over to using POINTER_PLUS_EXPR and convert ! the second operand to sizetype. ! * typeck2.c (build_m_component_ref): Likewise. ! * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR ! instead of PLUS_EXPR for pointers. ! (build_new_1): Likewise. ! (build_vec_delete_1): Likewise. ! (build_vec_delete): Likewise. ! * class.c (build_base_path): Likewise. ! (build_base_path): Likewise. ! (convert_to_base_statically): Likewise. ! (fixed_type_or_null): Handle POINTER_PLUS_EXPR. ! (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR ! instead of PLUS_EXPR. ! (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR ! instead of PLUS_EXPR for pointers. ! * call.c (build_special_member_call): Likewise. ! * rtti.c (build_headof): Likewise. ! Use sizetype instead of ptrdiff_type_node. ! (tinfo_base_init): Create a POINTER_PLUS_EXPR ! instead of PLUS_EXPR for pointers. ! * except.c (expand_start_catch_block): Do a ! NEGATIVE and then a POINTER_PLUS_EXPR instead ! of a MINUS_EXPR. ! * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert ! PLUS_EXPR on pointer types over to use ! POINTER_PLUS_EXPR and remove the conversion ! to the pointer types. ! * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for ! adding to a pointer type. Use size_int instead of ! ssize_int. Convert the index to sizetype before ! adding it to the pointer. ! 2007-06-15 Mark Mitchell ! * cp-tree.h (DECL_VAR_MARKED_P): Remove. ! (DECL_ANON_UNION_VAR_P): New macro. ! * class.c (fixed_type_or_null): Tidy. Use a hash table, rather ! than DECL_VAR_MARKED_P, to keep track of which variables we have ! seen. ! * decl.c (redeclaration_error_message): Complain about redeclaring ! anonymous union members at namespace scope. ! * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P. ! 2007-06-14 Geoff Keating ! * decl2.c (determine_visibility): Ensure that functions with ! hidden types as parameters are hidden. ! PR 31093 ! * decl2.c (determine_visibility): Remove duplicate code for ! handling type info. ! 2007-06-12 Ian Lance Taylor ! PR libstdc++/29286 ! * init.c (avoid_placement_new_aliasing): New static function. ! (build_new_1): Call it. ! 2007-06-11 Rafael Avila de Espindola ! * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove. ! (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove. ! 2007-06-08 Jakub Jelinek ! PR c++/32177 ! * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr ! on init, the non-decl cond operand and increment value. ! 2007-06-07 Simon Martin ! PR c++/30759 ! * decl.c (check_initializer): Report an error when a brace enclosed ! initializer is used for a non-aggregate type in C++98. ! (redeclaration_error_message): Rewrote flag_cpp0x in terms of ! cxx_dialect. ! (grokdeclarator): Likewise. ! (move_fn_p): Likewise. ! * typeck.c (check_return_expr): Likewise. ! * call.c (reference_binding): Likewise. ! * error.c (cp_cpp_error): Likewise. ! * pt.c (check_default_tmpl_args): Likewise. (tsubst): Likewise. ! * lex.c (init_reswords): Likewise. ! * parser.c (p_parser_primary_expression): Likewise. ! (TOKEN_PRECEDENCE): Likewise. ! (cp_parser_init_declarator): Likewise. ! (cp_parser_ptr_operator): Likewise. ! (cp_parser_parameter_declaration): Likewise. ! (cp_parser_enclosed_template_argument_list): Likewise. ! (cp_parser_skip_to_end_of_template_parameter_list): Likewise. ! (cp_parser_next_token_ends_template_argument_p): Likewise. ! ! 2007-06-04 Simon Baldwin ! ! * decl.c (grokdeclarator): Readability change. Moved case labels ! into direct switch statement scope. ! ! 2007-06-04 Paolo Carlini ! ! * call.c (convert_like_real): Remove pointless code. ! ! 2007-05-31 Mark Mitchell ! ! * decl.c (get_atexit_fn_ptr_type): New function. ! (get_atexit_node): Use it. ! (start_cleanup_fn): Likewise. ! (register_dtor_fn): Use the object's destructor, instead of a ! separate cleanup function, where possible. ! * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator. ! (atexit_fn_ptr_type_node): New macro. ! * decl2.c (build_cleanup): Use build_address. ! ! 2007-05-31 Daniel Berlin ! ! * typeck.c (build_binary_op): Include types in error. ! ! 2007-05-31 Jakub Jelinek ! ! PR c++/31806 ! * decl.c (cp_finish_decl): Also clear was_readonly if a static var ! needs runtime initialization. ! ! 2007-05-31 Paolo Carlini ! ! PR c++/32158 ! * semantics.c (finish_trait_expr): Complete the types. ! ! 2007-05-30 Russell Yanofsky ! Douglas Gregor ! Pedro Lamarao ! Howard Hinnant ! ! PR c++/7412 ! PR c++/29939 ! * typeck.c (comptypes): Don't consider rvalue and lvalue ! reference types to be equivalent. ! (check_return_expr): Move from certain lvalues when returning ! them. ! * decl.c (grokdeclarator): Implement reference collapsing. ! (copy_fn_p): Don't consider constructors taking rvalue references ! to be copy constructors. ! (move_fn_p): New. ! * call.c (conversion): New "rvaluedness_matches_p" member. ! (convert_class_to_reference): Require reference type as first ! parameter instead of base type. ! (reference_binding): Add logic to handle rvalue references. ! (implicit_conversion): Update inaccurate comment. ! (convert_like_real): Disable creation of temporaries that are ! impossible to initialize for types with move constructors. ! (build_over_call): Elide move constructors when possible. ! (maybe_handle_implicit_object): Set "rvaluedness_matches_p". ! (maybe_handle_ref_bind): Return conversion instead of type node. ! (compare_ics): Add logic to use "rvaluedness_matches_p" values to ! determine preferred conversion sequences. ! * cp-tree.h (TYPE_REF_IS_RVALUE): New. ! (LOOKUP_PREFER_RVALUE): New. ! (DECL_MOVE_CONSTRUCTOR_P): New. ! (struct cp_declarator): Add "reference" member for reference ! types, with new "rvalue_ref" flag. ! (cp_build_reference_type): Declare. ! (move_fn_p): Declare. ! * error.c (dump_type_prefix): Format rvalue reference types ! correctly in error messages. ! * except.c (build_throw): Move from certain lvalues when ! throwing. ! * mangle.c (write_type): Mangle rvalue references differently ! than regular references. ! * parser.c (make_reference_declarator): Add boolean parameter for ! rvalue references. ! (cp_parser_make_indirect_declarator): New. ! (cp_parser_new_declarator_opt): Call ! cp_parser_make_indirect_declarator. ! (cp_parser_conversion_declarator_opt): Ditto. ! (cp_parser_declarator): Ditto. ! (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference ! declarators. ! * pt.c (tsubst): Implement reference collapsing. ! (maybe_adjust_types_for_deduction): Implement special template ! parameter deduction rule for rvalue references. ! (type_unification_real): Update calls to ! maybe_adjust_types_for_deduction. ! (try_one_overload): Ditto. ! (unify_pack_expansion): Ditto. ! * tree.c (lvalue_p_1): Handle rvalue reference types. ! (cp_build_reference_type): New. ! ! 2007-05-30 Jakub Jelinek ! ! PR c++/31809 ! * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC ! variables that need runtime initialization. ! ! 2007-05-28 Andrew Pinski ! ! PR c++/31339 ! * typeck.c (build_unary_op ): Return the error_mark_node ! if either the real or imaginary parts would an ! error_mark_node. ! ! 2007-05-25 Simon Martin ! Manuel Lopez-Ibanez ! ! PR c++/31745 ! * parser.c (cp_parser_skip_to_closing_brace): Return true if the next ! token is a closing brace, false if there are no tokens left. ! (cp_parser_namespace_alias_definition): Only consume the next token if ! it is a closing brace. ! ! * parser.c (cp_parser_class_specifier): Likewise. ! ! 2007-05-25 H.J. Lu ! ! * semantics.c (finish_member_declaration): Fix a typo in the ! last checkin. ! ! 2007-05-25 Douglas Gregor ! ! PR c++/31431 ! PR c++/31432 ! PR c++/31434 ! PR c++/31435 ! PR c++/31437 ! PR c++/31438 ! PR c++/31442 ! PR c++/31443 ! PR c++/31444 ! PR c++/31445 ! * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes. ! * cp-tree.h (check_for_bare_parameter_packs): Returns bool. ! * pt.c (check_for_bare_parameter_packs): Return bool indicated ! whether everything was okay. Fix indentation. ! (push_template_decl_real): Check for bare parameter packs in ! function parameters; where errors occur, mark the parameter types ! with ERROR_MARK_NODEs to avert ICEs. ! (coerce_template_parameter_pack): New. ! (coerce_template_parms): Moved parameter pack coercion into ! coerce_template_parameter_pack, and permit it anywhere in the ! template parameter list (not just at the end). Parameter and ! argument indices can vary (somewhat) separately now, so add ! PARM_IDX and ARG_IDX. ! (fn_type_unification): Don't set an argument pack as incomplete if ! no argument pack was deduced. ! (type_unification_real): If a type parameter is a parameter pack ! and has not otherwise been deduced, it will be deduced to an empty ! parameter pack. ! (more_specialized_fn): Use the actual lengths of the argument ! lists when comparing against expansions. ! * semantics.c (finish_member_declaration): If a field's type has ! bare parameter packs, error and set its type to ERROR_MARK_NODE. ! ! 2007-05-24 Danny Smith ! ! PR target/27067 ! * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name. ! ! 2007-05-22 Ollie Wild ! ! * name-lookup.c (ambiguous_decl): Adds check for hidden types. ! (unqualified_namespace_lookup): Adds check for hidden types. ! ! 2007-05-22 Ollie Wild ! ! * decl.c (duplicate_decls): Verify namespace names are unique. ! ! 2007-05-21 Mark Mitchell ! ! * decl.c (cxx_maybe_build_cleanup): Handle ! __attribute__((cleanup)). ! ! 2007-05-19 Manuel Lopez-Ibanez ! ! * cvt.c (cp_convert_and_check): Don't check warnings if the ! conversion failed. ! ! 2007-05-18 Geoffrey Keating ! ! * mangle.c (write_real_cst): Use 'unsigned long' for %lx. ! ! 2007-05-14 Paolo Carlini ! ! PR c++/29928 ! * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the ! type only if is a class type (5.2.8/4). ! ! 2007-05-14 Rafael Avila de Espindola ! ! * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove. ! * decl.c (grokdeclarator): Use unsigned_type_for instead of ! c_common_unsigned_type. ! ! 2007-05-11 Silvius Rus ! ! * typeck.c (build_indirect_ref): Add call to ! strict_aliasing_warning. ! (build_reinterpret_cast_1): Condition call to ! strict_aliasing_warning. ! ! 2007-05-11 Jan Hubicka ! ! * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn. ! * decl2.c (start_objects): ctors and dtors are no longer public. ! (cp_write_global_declarations): Do not call c_build_cdtor_fns. ! ! 2007-05-07 Andrew Pinski ! ! * typeck.c (build_unary_op): Remove code that used to ! handle non lvalue increments/decrements. ! ! 2007-05-07 Mike Stump ! ! * parser.c (check_empty_body): Add. ! (cp_parser_iteration_statement): Add call to check_empty_body. ! ! 2007-05-05 Geoffrey Keating ! ! PR 31775 ! * mangle.c (write_mangled_name): Mangle static variable names. ! (write_unqualified_name): Use local-source-name for ! namespace-scope static variables. ! ! 2007-05-04 Dirk Mueller ! ! * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is ! not in effect. ! ! 2007-05-02 Seongbae Park ! ! PR c++/31663 ! * decl2.c (constrain_class_visibility): ! Use strip_pointer_or_array_types instead of strip_array_types. ! ! 2007-04-28 Andrew Pinski ! ! PR C++/30221 ! * decl.c (reshape_init_r): Don't reshape the first element if it ! is a pointer to member function. ! ! 2007-04-27 Simon Baldwin ! ! * decl.c (grokparms): Changed message format from %qD to %qE. ! ! 2007-04-27 Douglas Gregor ! ! * error.c (maybe_warn_variadic_templates): Variadic templates are ! now in C++0x, so only warn about them in C++98 mode. ! ! 2007-04-26 Andrew Pinski ! ! PR C++/30016 ! * typeck.c (build_reinterpret_cast_1): Only allow conversion to ! integeral types from vectors types. ! ! 2007-04-26 Jakub Jelinek ! ! PR c++/31598 ! * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO ! for type dependent OMP_CLAUSE_DECLs. ! ! 2007-04-24 Mark Mitchell ! ! PR c++/31338 ! * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE. ! * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as ! COMPLEX_TYPE is now an ARITHMETIC_TYPE. ! * init.c (build_zero_init): Adjust, as ! COMPLEX_TYPE is now a SCALAR_TYPE. ! * typeck2.c (digest_init): Allow brace-enclosed initializers for ! COMPLEX_TYPE, even though that is now a SCALAR_TYPE. ! ! 2007-04-25 Paolo Carlini ! ! * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust ! per N2255; rename as classtype_has_nothrow_assign_or_copy_p. ! (trait_expr_value): Adjust. ! ! 2007-04-23 Simon Baldwin ! ! * decl.c (grokparms): Added new error for duplicate function ! parameters names in function prototypes, to match gcc behavior. ! ! 2007-04-23 Jan Hubicka ! ! * decl2.c (finish_objects): Do not call target constructor/destructor ! bits dirrectly. ! ! 2007-04-21 Andrew Pinski ! ! * cp-tree.h (lang_tree_node): Use GENERIC_NEXT ! instead of checking GIMPLE_STMT_P in chain_next. ! ! 2007-04-17 Mark Mitchell ! ! PR c++/31513 ! * call.c (convert_for_arg_passing): Convert bitfields to their ! declared types. ! ! 2007-04-17 Simon Martin ! ! PR c++/31517 ! * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs. ! 2007-04-16 Seongbae Park ! PR c++/29365 ! * decl2.c (constrain_class_visibility): ! Do not warn about the use of anonymous namespace in the main input file. ! 2007-04-15 Mark Mitchell ! * cp-tree.h (current_template_parms): Fix typo in comment. ! 2007-04-15 Kazu Hirata ! * cp-tree.h, error.c: Fix comment typos. ! 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 ! * 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 ! * 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 ! * 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 ! ! * 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 ! * parser.c (struct cp_parser): New IN_IF_STMT. ! (cp_parser_statement_seq_opt): Handle an unexpected 'else', ! returning if parsing the body of an 'if' statement or issuing an ! error and continuing. ! (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing ! body of 'if'. ! (cp_parser_jump_statement): Mask new IN_IF_STMT bit. ! ! 2007-03-02 Simon Martin ! ! PR c++/28253 ! * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders ! for thunks. ! ! 2007-03-02 Geoffrey Keating ! ! * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling ! Objective-C++. Don't exit early if -shared-libgcc needs to be ! added. ! ! 2007-03-02 Manuel Lopez-Ibanez ! ! * typeck.c (common_base_type): Delete unused function. ! ! 2007-03-01 Brooks Moses ! ! * Make-lang.in: Add dummy lang.install-pdf target. ! ! 2007-03-01 Simon Baldwin ! ! PR c++/23689 ! * decl.c (check_tag_decl): Added new warning for typedef ignored ! when it precedes an otherwise valid non-typedef declaration. ! ! 2007-02-28 Sandra Loosemore ! ! * typeck.c (build_function_call): Store converted arguments ! in a stack-allocated array instead of building a list. ! (convert_arguments): Store arguments in the array passed in as an ! argument, and return the actual number of arguments. ! * call.c (build_call): Delete, and replace with... ! (build_call_n, build_call_a): New. ! (build_op_delete_call): Rewrite to avoid constructing argument lists. ! (build_over_call): Store converted arguments in a stack-allocated ! array instead of building a list. ! (build_cxx_call): Pass arguments in an array instead of as a list. ! (build_java_interface_fn_ref): Rewrite to avoid constructing ! argument lists. ! * tree.h: Update declarations to reflect above changes. ! * method.c (use_thunk): Use a stack-allocated array to hold ! the arguments instead of a list. ! * rtti.c (throw_bad_cast): Update call to cxx_call. ! (throw_bad_typeid): Likewise. ! (build_dynamic_cast_1): Likewise. ! * init.c (build_builtin_delete_call): Use build_call_n. ! * decl.c (expand_static_init): Likewise. ! * except.c (cp_protect_cleanup_actions): Likewise. ! * cp-gimplify.c (genericize_eh_spec_block): Likewise. ! (gimplify_must_not_throw_expr): Likewise. ! (cxx_omp_apply_fn): Use build_call_a. ! ! 2007-02-26 Mark Mitchell ! ! * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn. ! * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns. ! ! 2007-02-25 Mark Mitchell ! ! * cp-tree.h (static_ctors): Remove. ! * cp-tree.h (static_dtors): Likewise. ! * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for ! refactoring of tree_map hierarchy. ! (decl_shadowed_for_var_insert): Likewise. ! * semantics.c (expand_body): Use c_expand_body. ! (expand_or_defer_fn): Don't update static_ctors or static_dtors. ! * decl2.c (static_ctors): Remove. ! (static_dtors): Likewise. ! (generate_ctor_or_dtor_function): Pass NULL_TREE to ! objc_generate_static_init_call. Do not call static_[cd]tors. ! (generate_ctor_and_dtor_functions_for_priority): Do not check for ! static_[cd]tors. ! (cp_write_global_declarations): Likewise. ! ! 2007-02-23 Richard Guenther ! ! * class.c (note_name_declared_in_class): Make declaration ! changes meaning a pedwarn. ! ! 2007-02-22 Michael Matz ! ! PR c++/29433 ! * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag. ! * error.c (dump_aggr_type, dump_simple_decl, dump_decl, ! dump_function_decl): Guard emitting outer scopes by new flag. ! * cp-lang.c (cxx_dwarf_name): New function. ! (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name. ! * pt.c (classtype_mangled_name, mangle_class_name_for_template): ! Remove functions. ! (push_template_decl_real, lookup_template_class): Remove calls ! to above functions. ! ! 2007-02-19 Mark Mitchell ! ! * call.c (build_new_method_call): Ensure that explicit calls of ! destructors have type "void". ! ! 2007-02-19 Manuel Lopez-Ibanez ! ! * typeck.c (build_binary_op): Replace -Wstring-literal-comparison ! and -Walways-true with -Waddress. ! * cvt.c (convert_to_void): Replace unconditional warning with ! -Waddress. ! ! 2007-02-18 Kazu Hirata ! ! * decl.c, tree.c: Fix comment typos. ! ! 2007-02-15 Andrew Pinski ! ! PR C++/30158 ! * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the ! statement expression if we had an error mark node. ! ! 2007-02-15 Sandra Loosemore ! Brooks Moses ! Lee Millward ! ! * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. ! Change class to tcc_vl_exp. ! ! * call.c (build_call): Use build_call_list instead ! of build3. ! (build_over_call): Likewise. ! (build_new_method_call): Use build_min_non_dep_call_list ! instead of build_min_non_dep. ! ! * error.c (dump_call_expr_args): New function. ! (dump_aggr_init_expr_args): New function. ! (dump_expr) : Use them. ! Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. ! ! * cvt.c (convert_to_void): Use build_call_array instead ! of build3; use new AGGR_INIT_EXPR accessor macros. ! ! * mangle.c (write_expression): Use TREE_OPERAND_LENGTH ! instead of TREE_CODE_LENGTH. ! ! * dump.c (cp_dump_tree) : Update to use new ! AGGR_INIT_EXPR accessor macros. ! ! * cp-gimplify.c (cp_gimplify_init_expr): Use ! AGGR_INIT_EXPR_SLOT to set the slot operand. ! ! * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. ! (AGGR_INIT_EXPR_SLOT): New macro. ! (AGGR_INIT_EXPR_ARG): New macro. ! (aggr_init_expr_nargs): New macro. ! (AGGR_INIT_EXPR_ARGP): New macro. ! (aggr_init_expr_arg_iterator): New. ! (init_aggr_init_expr_arg_iterator): New. ! (next_aggr_init_expr_arg): New. ! (first_aggr_init_expr_arg): New. ! (more_aggr_init_expr_args_p): New. ! (FOR_EACH_AGGR_INIT_EXPR_ARG): New. ! (stabilize_aggr_init): New declaration. ! (build_min_non_dep_call_list): Likewise. ! ! * tree.c (process_aggr_init_operands): New function. ! (build_aggr_init_array) New function. ! (build_cplus_new): Update to use new CALL_EXPR and ! AGGR_INIT_EXPR accessor macros. Replace use of build3 with ! build_aggr_init_array. ! (build_min_non_dep_call_list) New function. ! (build_min_nt): Assert input code parameter is not a variable ! length expression class. ! (build_min, build_min_non_dep): Likewise. ! (cp_tree_equal) : Iterate through the arguments ! to check for equality instead of recursing. Handle tcc_vl_exp ! tree code classes. ! (stabilize_call): Update to only handle CALL_EXPRs, not ! AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. ! (stabilize_aggr_init): New function. ! (stabilize_init): Use it. ! ! * cxx-pretty-print.c (pp_cxx_postfix_expression) ! : Update to use new CALL_EXPR and ! AGGR_INIT_EXPR accessor macros and argument iterators. ! ! * pt.c (tsubst_copy) : Replace build_nt with ! build_vl_exp. Iterate through the operands, recursively ! processing each one. ! (tsubst_copy_and_build) : Update to use new ! CALL_EXPR accessor macros. ! (value_dependent_expression_p) : Handle tcc_vl_exp ! tree code classes. Use TREE_OPERAND_LENGTH instead of ! TREE_CODE_LENGTH. ! ! * semantics.c (finish_call_expr): Use build_nt_call_list ! instead of build_nt. ! (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR ! accessor macros. Use build_call_array to construct the ! CALL_EXPR node instead of build3 ! ! * decl2.c (build_offset_ref_call_from_tree): Use ! build_nt_call_list and build_min_non_dep_call_list instead ! of build_min_nt and build_min_non_dep. ! ! * parser.c (cp_parser_postfix_expression) : ! Use build_nt_call_list instead of build_min_nt. ! ! 2007-02-15 Manuel Lopez-Ibanez ! ! PR c++/28943 ! * call.c (build_conditional_expr): Improve error message. ! ! 2007-02-13 Dirk Mueller ! ! * friend.c (do_friend): Annotate warning about friend ! declarations in templates with OPT_Wnon_template_friend. ! Convert informal message from warning() to inform(). ! ! 2007-02-12 Simon Martin ! Mark Mitchell ! ! PR c++/14622 ! * pt.c (do_decl_instantiation): Detect type mismatches in explicit ! instantiations for variables. ! ! 2007-02-12 Manuel Lopez-Ibanez ! ! PR middle-end/7651 ! * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings. ! Check warn_unused_value just once. ! ! 2007-02-11 Mark Mitchell ! ! PR c++/26988 ! * pt.c (determine_specialization): Use skip_artificial_parms_for. ! (fn_type_unificiation): Likewise. ! (get_bindings): Likewise. ! ! o2007-02-06 Mark Mitchell ! ! PR target/29487 ! * decl.c (finish_function): Use DECL_REPLACEABLE. ! * tree.c (cp_cannot_inline_tree_fn): Likewise. ! ! 2007-02-10 Gabriel Dos Reis ! ! * parser.c (cp_parser_primary_expression): Reformat overly long lines. ! ! 2007-02-10 Richard Henderson , Jakub Jelinek ! ! * decl.c (grokvardecl): Don't error if !have_tls. ! (grokdeclarator): Likewise. ! * parser.c (cp_parser_omp_threadprivate): Likewise. ! ! 2007-02-07 Jakub Jelinek ! ! PR c++/30703 ! * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref ! parameters and result decls in omp clauses. ! (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs ! by reference. ! ! 2007-02-05 Dirk Mueller ! ! PR bootstrap/30510 ! * parser.c (cp_parser_class_specifier): Always initialize bases. ! ! 2007-02-05 Paolo Bonzini ! ! * cp-tree.h (OMP_ATOMIC_CODE): Delete. ! (OMP_ATOMIC_DEPENDENT_P): Rewrite. ! * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC ! expressions. ! * semantics.c (finish_omp_atomic): Store a whole expression node ! in operand 1, and integer_zero_node in operand 0, for dependent ! OMP_ATOMIC. Rewrite to make flow easier to understand. ! ! 2007-02-03 Gabriel Dos Reis ! ! * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0. ! ! 2007-02-04 Kazu Hirata ! ! * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c, ! parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions. ! ! 2007-02-03 Douglas Gregor ! ! * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x ! keyword warning to -Wc++0x-compat. ! ! 2007-02-03 Gabriel Dos Reis ! ! * decl.c (grokdeclarator): Update documentation. ! ! 2007-02-02 Jakub Jelinek ! ! PR c++/30536 ! * decl.c (grokdeclarator): If __thread is used together with ! a storage class other than extern and static, clear thread_p ! after issuing diagnostics and fall through to checking the ! storage class. ! ! 2007-01-30 Roger Sayle ! ! * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when ! calculating the size of an array (to avoid recursive errors). ! ! 2007-01-30 Manuel Lopez-Ibanez ! ! PR c++/24745 ! * typeck.c (build_binary_op): Fix logic for warning. Move warning ! to -Wpointer-arith. ! * call.c (convert_like_real): Don't warn when converting to ! boolean type. ! ! 2007-01-29 Manuel Lopez-Ibanez ! ! * decl.c (pop_label): Replace warning with call to ! warn_for_unused_label. ! ! 2007-01-28 Andrew Pinski ! ! PR C++/28988 ! * semantics.c (finish_pseudo_destructor_expr): Check the ! destrutor name by calling check_dtor_name. ! ! 2007-01-24 Douglas Gregor ! ! * lex.c (D_CPP0X): Rename. ! (D_CXX0X): To this. ! (reswords): D_CPP0X -> D_CXX0X. ! (init_reswords): Ditto. ! * parser.c (cp_lexer_get_preprocessor_token): Warn about the use ! of C++0x keywords as identifiers. ! ! 2007-01-23 Simon Martin ! ! PR c++/27492 ! * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for ! function decls. ! ! 2007-01-23 Ian Lance Taylor ! ! * typeck.c (convert_for_assignment): Only warn about a = b = c ! when converting to bool. ! ! 2007-01-23 Roger Sayle ! ! * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with ! TREE_OVERFLOW. ! * typeck.c (ignore_overflows): Remove the remaining uses of ! TREE_CONSTANT_OVERFLOW. ! ! 2007-01-20 Jan Hubicka ! ! * decl2.c (start_objects, start_static_storage_duration_function): ! Do not make the functions uninlinable. ! ! 2007-01-17 Ian Lance Taylor ! ! * class.c (add_method): Call VEC_reserve_exact rather than passing ! a negative size to VEC_reserve. ! ! 2007-01-11 Simon Martin ! ! PR c++/29573 ! * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees. ! ! 2007-01-10 Mark Mitchell ! ! PR c++/28999 ! * decl.c (make_typename_type): If the qualified name is not a ! type, issue an error. ! * parser.c (cp_parser_elaborated_type_specifier): Fix comment ! formatting. ! ! 2007-01-08 Geoffrey Keating ! ! * rtti.c: Include target.h. ! (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (), ! don't emit typeinfo for fundamental types as weak. ! * Make-lang.in (cp/rtti.o): Update and correct dependencies. ! ! 2007-01-08 Richard Guenther ! ! * cvt.c (cp_convert_to_pointer): Use build_int_cst_type. ! ! 2007-01-08 Mark Shinwell ! ! * call.c (standard_conversion): Pass flag to ! vector_types_convertible_p to disallow emission of note. ! * typeck.c (convert_for_assignment): Pass flag to ! vector_types_convertible_p to allow emission of note. ! (ptr_reasonably_similar): Pass flag to vector_types_convertible_p ! to disallow emission of note. ! ! 2007-01-07 Manuel Lopez-Ibanez ! ! PR c++/28986 ! * typeck.c (build_binary_op): Call overflow_warning if ! TREE_OVERFLOW_P is true for the result and not for any of the ! operands. ! ! 2007-01-06 Lee Millward ! ! PR c++/19439 ! * class.c (add_method): Don't wait until template ! instantiation time to complain about duplicate methods. ! ! 2007-01-05 Manuel Lopez-Ibanez ! ! PR c/19978 ! * semantics.c (finish_unary_op_expr): Warn only if result ! overflowed and operands did not. ! ! 2007-01-05 Ian Lance Taylor ! ! * typeck.c (build_binary_op): Warn about comparing a non-weak ! address to NULL. ! ! 2007-01-05 Douglas Gregor ! ! * pt.c (tsubst): Propagate the need for structural equality checks ! when reducing the level of template parameters. ! ! 2007-01-03 Kazu Hirata ! ! * pt.c: Fix a comment typo. ! ! 2007-01-02 Ian Lance Taylor ! ! * semantics.c (maybe_convert_cond): Optionally warn when using an ! assignment as a condition. ! * typeck.c (convert_for_assignment): Optionally warn about ! assigning the result of an assignment to a bool. ! ! 2007-01-02 Douglas Gregor ! ! * pt.c (canonical_template_parms): Correct typo in comment. ! ! 2007-01-02 Douglas Gregor ! ! * typeck.c (structural_comptypes): Renamed from "comptypes". ! (comptypes): Use canonical type information to perform fast type ! comparison. When VERIFY_CANONICAL_TYPES, verify that the ! canonical type comparison returns the same results as we would see ! from the current, structural check. Support COMPARE_STRUCTURAL ! when we need structural checks. ! * decl.c (typename_compare): Fix comment. ! (build_typename_type): TYPENAME_TYPE nodes require structural ! equality checks, because they resolve different based on the ! current class type. ! (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes ! require structural equality checks (for now). ! (build_ptrmemfunc_type): Build the canonical pointer to member ! function type. ! (compute_array_index_type): Whenever we build a new index type ! to represent the size of an array in a template, we need to mark ! this index type as requiring structural equality. This goes for ! arrays with value-dependent sizes with the current ABI, or all ! arrays with ABI-1. ! * tree.c (cplus_array_hash): New. ! (struct cplus_array_info): New. ! (cplus_array_compare): New. ! (cplus_array_htab): New. ! (build_cplus_array_type_1): Use a hash table to cache the array ! types we build. Build the canonical array type for each array ! type. ! (cp_build_qualified_type_real): When building a cv-qualified array ! type, use the hash table of array types and build canonical array ! types as necessary. ! (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes ! use structural equality (for now). ! * cp-tree.h (COMPARE_STRUCTURAL): New. ! * pt.c (canonical_template_parms): New. ! (canonical_type_parameter): New. ! (process_template_parm): Find the canonical type parameter. ! (lookup_template_class): When we have named the primary template ! type, set the canonical type for our template class to the primary ! template type. If any of the template arguments need structural ! equality checks, the template class needs structural equality ! checks. ! (tsubst): When reducing the level of a template template ! parameter, we require structural equality tests for the resulting ! parameter because its template parameters have not had their types ! canonicalized. When reducing a template type parameter, find the ! canonical reduced type parameter. ! (any_template_arguments_need_structural_equality_p): New. --- 1,730 ---- ! 2009-04-21 Release Manager ! * GCC 4.4.0 released. ! 2009-04-14 Jason Merrill ! PR c++/39763 ! * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings ! about shadowing by tentative parms. ! 2009-04-13 Jason Merrill ! PR c++/39480 ! * call.c (build_over_call): Don't call memcpy if the target is ! the same as the source. ! PR c++/39750 ! * pt.c (uses_template_parms): Handle CONSTRUCTOR. ! 2009-04-12 Jason Merrill ! PR c++/39742 ! * call.c (joust): Don't crash on variadic fn. ! 2009-04-10 H.J. Lu Backport from mainline: ! 2009-04-10 Jason Merrill ! PR c++/28301 ! * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return ! if we see a close brace without an open brace. ! 2009-04-08 Dodji Seketeli ! PR c++/39637 ! * parser.c (cp_parser_enumerator_definition): Make sure the ! initializer of the enumerator doesn't contain any bare parameter pack. ! 2009-04-07 Jason Merrill ! PR c++/34691 ! * name-lookup.c (merge_functions): Keep multiple extern "C" functions. ! * call.c (joust): Complain about mismatched default arguments ! in extern "C" functions. ! * class.c (resolve_address_of_overloaded_function): Handle multiple ! extern "C" functions. ! * pt.c (resolve_overloaded_unification): Likewise. ! * decl.c (grokdeclarator): Reject pointer to qualified function type. ! PR c++/37806, core issue 547 ! * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals ! to a typedef. ! * tree.c (cp_build_qualified_type_real): Don't apply restrict to a ! function type. ! * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG. ! * decl.c (groktypename): Add is_template_arg parameter. ! (grokdeclarator): Allow function cv-quals on a template type arg. ! * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add ! is_template_arg argument in calls to groktypename. ! * cp-tree.h: Adjust prototype. ! * error.c (dump_type_prefix, dump_type_suffix): Fix plain ! FUNCTION_TYPE printing. ! 2009-04-06 Jason Merrill ! PR c++/35146 ! * pt.c (fn_type_unification): For DEDUCE_EXACT check that ! the deduced template arguments give us the parameter types ! we're looking for. ! 2009-04-05 Jason Merrill ! C++ DR 613 ! * semantics.c (finish_non_static_data_member): Allow such references ! without an associated object in sizeof/decltype/alignof. ! 2009-04-03 Jason Merrill ! PR c++/39608 ! * semantics.c (finish_id_expression): Don't assume a dependent ! member of the current instantiation isn't a valid integral ! constant expression. Check dependent_scope_p. ! * pt.c (dependent_scope_p): Check TYPE_P. ! (tsubst_copy): If args is null, just return. ! 2009-04-02 Jason Merrill ! * mangle.c (write_expression): Mangle dependent name as ! source-name. ! PR c++/38030, 38850, 39070 ! * pt.c (type_dependent_expression_p_push): New fn. ! (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the ! substitution makes the call non-dependent. Preserve koenig_p. ! * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup ! for non-dependent calls. ! * semantics.c (finish_call_expr): Revert earlier changes. ! * cp-tree.h: Revert change to finish_call_expr prototype. ! 2009-03-30 Jakub Jelinek Revert ! 2009-03-27 Manuel Lopez-Ibanez ! PR c++/35652 ! * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum. ! 2009-03-28 Jakub Jelinek ! PR c++/39554 ! * parser.c (cp_parser_postfix_expression): Don't call ! warning_if_disallowed_function_p. ! 2009-03-27 Andrew Pinski ! PR c++/38638 ! * parser.c (cp_parser_elaborated_type_specifier): If we have a ! typename tag and don't have either a TYPE_DECL or a ! TEMPLATE_ID_EXPR, set the type to NULL. ! 2009-03-27 Simon Martin ! PR c++/37647 ! * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class ! scope. ! 2009-03-27 Simon Martin ! PR c++/29727 ! * decl.c (check_array_designated_initializer): Handle error_mark_node. ! 2009-03-27 Manuel Lopez-Ibanez ! PR c++/35652 ! * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum. ! 2009-03-26 Andrew Haley ! PR C++/39380 ! * decl2.c (possibly_inlined_p): If java exceptions are in use ! don't inline a decl unless it is explicitly marked inline. ! * lex.c: (pragma_java_exceptions): New variable. ! (handle_pragma_java_exceptions): Set pragma_java_exceptions. ! * cp-tree.h (pragma_java_exceptions): Declare new variable. ! 2009-03-24 Jason Merrill ! PR c++/28274 ! * name-lookup.c (pushdecl_maybe_friend): Check default args later. ! 2009-03-23 Jakub Jelinek ! PR c/39495 ! * semantics.c (handle_omp_for_class_iterator): Swap cond operands and ! code if iter is the second operand. ! * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p ! argument. If it is set, don't build the toplevel expression with ! build_x_binary_op, but build2. ! (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust ! callers. ! (cp_parser_omp_for_cond): Don't assume the first operand of the ! comparison must be decl. ! 2009-03-23 Jason Merrill ! PR c++/37729 ! * pt.c (make_fnparm_pack): Split out from... ! (instantiate_decl): ...here. ! (tsubst_pack_expansion): Handle being called in a late-specified ! return type. ! PR c++/39526 ! * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing ! a parm with a parm. ! 2009-03-20 Jason Merrill ! PR c++/28879 ! * parser.c (cp_parser_direct_declarator): In a template, wrap ! non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set. ! * pt.c (tsubst): Preserve it in a partial instantiation. ! (dependent_type_p_r): Don't check value_dependent_expression_p. ! * decl.c (compute_array_index_type): Don't check ! value_dependent_expression_p if TREE_SIDE_EFFECTS. ! C++ core issue 703 ! * typeck2.c (check_narrowing): Don't complain about loss of ! precision when converting a floating-point constant. ! 2009-03-19 Jakub Jelinek ! PR c/39495 ! * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL. ! (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond. ! 2009-03-18 Jakub Jelinek ! * parser.c (struct cp_token): Reorder fields for 64-bit hosts. ! (eof_token): Adjust. ! 2009-03-18 H.J. Lu ! PR c++/39425 ! * parser.c (cp_parser_explicit_specialization): Don't skip the ! rest of the specialization when begin_specialization returns ! false. ! 2009-03-17 Jason Merrill ! * decl.c (grokfndecl): Set DECL_CONTEXT on parms. ! (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms. * pt.c (check_explicit_specialization): Likewise. + (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a + local specialization. + * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name. + * decl2.c (parm_index): New fn. + * semantics.c (finish_decltype_type): Don't use describable_type. + * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR. + Give a sorry for unsupported codes rather than crash. Mangle + conversions with other than 1 operand. New mangling for PARM_DECL. + * operators.def (ALIGNOF_EXPR): Mangle as "az". ! 2009-03-17 Jing Yu ! PR middle-end/39378 ! * method.c (use_thunk): Change is_thunk from crtl to cfun. ! 2009-03-17 Paolo Carlini ! PR c++/39475 ! * semantics.c (check_trait_type): New. ! (finish_trait_expr): Use it. ! 2009-03-17 Jakub Jelinek ! * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs ! instead of calling imported_module_or_decl debug hook if ! building_stmt_tree (). ! * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand ! is a NAMESPACE_DECL. ! PR debug/37890 ! * name-lookup.c (do_namespace_alias): Don't call global_decl debug ! hook at function scope. ! PR debug/39471 ! * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME ! on IMPORTED_DECL. ! 2009-03-09 Jakub Jelinek ! PR c++/39371 ! * semantics.c (finish_switch_cond): Don't call get_unwidened. ! * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument ! instead of TREE_TYPE (cond). ! 2009-03-08 H.J. Lu ! PR c++/39060 ! * parser.c (cp_parser_late_parsing_default_args): Continue ! the loop when cp_parser_assignment_expression returns error_mark_node. ! 2009-03-07 Jason Merrill ! PR c++/39367 ! * init.c (build_new_1): Don't use a VLA type. ! (build_vec_init): Handle getting a pointer for BASE. ! 2009-03-06 H.J. Lu ! PR c++/37520 ! * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL ! when mangling symbols. ! 2009-03-06 Paolo Carlini ! PR c++/33492 ! * error.c (dump_expr): Don't try to print THROW_EXPRs in full. ! 2009-03-06 Alexandre Oliva ! * decl.c (record_builtin_java_type): Use canonicalized integer types. ! 2009-03-04 Jason Merrill ! PR c++/38908 ! * class.c (is_really_empty_class): New fn. ! * cp-tree.h: Declare it. ! * cp-objcp-common.c (cp_expr_size): Use it. ! PR c++/13549 ! * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR. ! * parser.c (cp_parser_postfix_expression): Call it for ! TEMPLATE_ID_EXPR. ! * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR. ! (get_first_fn): Likewise. ! PR c++/9634 ! PR c++/29469 ! PR c++/29607 ! Implement DR 224. ! * decl.c (make_typename_type): Do look inside currently open classes. ! * parser.c (cp_parser_lookup_name): Likewise. ! (cp_parser_template_name): Likewise. ! * pt.c (dependent_scope_p): New function. ! * cp-tree.h: Declare it. ! * class.c (currently_open_class): Return fast if T isn't a class. ! 2009-02-26 H.J. Lu ! PR c++/37789 ! * parser.c (cp_parser_mem_initializer): Return error_mark_node ! if cp_parser_mem_initializer_id returns error_mark_node. ! 2009-02-24 Richard Guenther ! PR c++/39242 ! * pt.c (instantiate_decl): Do not instantiate extern, non-inline ! declared functions. ! 2009-02-23 H.J. Lu ! PR c++/36411 ! * pt.c (coerce_template_template_parms): Return 0 if parameter ! is error_mark_node. ! 2009-02-23 Jason Merrill ! * pt.c (unify): Call maybe_adjust_types_for_deduction when ! deducing from an initializer list. ! 2009-02-20 Jason Merrill ! PR c++/39225 ! * decl.c (grokdeclarator): Handle ~identifier. ! 2009-02-19 Jakub Jelinek ! PR target/39175 ! * decl2.c (determine_visibility): If visibility changed and ! DECL_RTL has been already set, call make_decl_rtl to update symbol ! flags. ! 2009-02-19 H.J. Lu ! PR c++/39188 ! * cp-tree.h (maybe_commonize_var): New. ! * decl.c (maybe_commonize_var): Make it extern. ! * decl2.c (finish_anon_union): Call maybe_commonize_var. ! 2009-02-18 H.J. Lu ! PR c++/39219 ! * parser.c (cp_parser_enum_specifier): Apply all attributes. ! 2009-02-18 Jason Merrill ! * cfns.h: Tweak pathname for cfns.gperf. ! 2009-02-13 Jason Merrill ! PR c++/39070 ! * semantics.c (finish_call_expr): Change koenig_p parm to int. ! If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates. ! * cp-tree.h: Adjust prototype. ! * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1. ! 2009-02-12 Jason Merrill ! PR c++/38950 ! * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type. ! 2009-02-11 Jason Merrill ! PR c++/39153 ! * decl2.c (cp_write_global_declarations): ! Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL. ! PR c++/30111 ! * init.c (build_value_init_noctor): Split out from... ! (build_value_init): ...here. ! (expand_aggr_init_1): Handle value-initialization. ! * cp-tree.h: Add declaration. ! * class.c (type_has_user_provided_constructor): ! Handle non-class arguments. ! 2009-02-10 Jason Merrill ! PR c++/38649 ! * class.c (defaultable_fn_p): Handle ... properly. ! PR c++/36744 ! * tree.c (lvalue_p_1): Condition rvalue ref handling on ! treat_class_rvalues_as_lvalues, too. ! 2009-02-10 Paolo Carlini ! PR c++/34397 ! * typeck.c (build_x_array_ref): New. ! * cp-tree.h: Declare it. ! * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF. ! 2009-02-09 Jason Merrill ! PR c++/39109 ! * semantics.c (simplify_aggr_init_expr): Do zero-initialization here. ! * init.c (build_value_init): Not here. Don't build a TARGET_EXPR. ! * tree.c (get_target_expr): Handle AGGR_INIT_EXPR. ! * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling ! for build_value_init TARGET_EXPR. ! * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro. ! 2009-02-06 Paolo Carlini ! PR c++/35147 ! PR c++/37737 ! * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH. ! 2009-02-04 Jakub Jelinek ! PR c++/39095 ! * operators.def: Use COMPONENT_REF code for ->/pt operator again, ! remove ./dt operator. ! * mangle.c (write_expression): Handle COMPONENT_REF after handling ! ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it ! write_string ("dt") instead of using operators.def. ! 2009-02-03 Jason Merrill ! * typeck.c (cp_build_unary_op): Only complain about taking address ! of main if pedantic. ! 2009-02-03 Jakub Jelinek ! PR inline-asm/39059 ! * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs. ! PR c++/39056 ! * typeck2.c (digest_init_r): Don't call process_init_constructor ! for COMPLEX_TYPE. ! 2009-02-03 Paolo Bonzini ! PR c++/36897 ! * pt.c (convert_nontype_argument_function): Expect expr to be an ! ADDR_EXPR. ! PR c++/37314 ! * typeck.c (merge_types): Call resolve_typename_type if only ! one type is a typename. ! 2009-02-02 Jason Merrill ! PR c++/39054 ! * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node ! in BIT_NOT_EXPR. ! 2009-02-01 Paolo Carlini ! PR c++/39053 ! * parser.c (cp_parser_pure_specifier): If there are no tokens left ! do not call cp_lexer_consume_token. ! 2009-01-30 Jakub Jelinek ! PR c++/39028 ! * parser.c (cp_parser_already_scoped_statement): Handle __label__ ! declarations. ! 2009-01-30 Paolo Carlini ! PR c++/33465 ! * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR. ! 2009-01-30 Paolo Carlini ! PR c++/38655 ! * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE. ! 2009-01-29 Paolo Carlini ! * typeck.c (invalid_nonstatic_memfn_p): Use ! DECL_NONSTATIC_MEMBER_FUNCTION_P. ! 2009-01-27 Paolo Carlini ! PR c++/37554 ! * call.c (build_over_call): If convert_for_arg_passing returns ! error_mark_node unconditionally return it. ! 2009-01-22 Adam Nemet ! * class.c (check_field_decls): Also inherit packed for bitfields ! regardless of their type. ! 2009-01-22 Dodji Seketeli ! PR c++/38930 ! * decl2.c (grokfield): Reverting changes of PR c++/26693 ! (save_template_attributes): Likewise. ! * decl.c (grokdeclarator): Likewise. ! * name-lookup.c (pushdecl_maybe_friend): Likewise. ! * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise. ! (append_type_to_template_for_access_check): Likewise. ! * semantics.c (check_accessibility_of_qualified_id): Likewise. ! * pt.c (instantiate_class_template, instantiate_template ): Likewise. (tsubst): Likewise. ! (resolve_type_name_type): Likewise. ! (append_type_to_template_for_access_check): Likewise. ! 2009-01-21 Dodji Seketeli ! PR c++/26693 ! * decl2.c (grokfield): when a typedef appears in a ! class, create the typedef variant type node for it. ! (save_template_attributes): Creating typedef variant type node ! here is now useless. ! * decl.c (grokdeclarator): If the typedef'ed struct/class was ! anonymous, set the proper type name to all its type variants. ! * name-lookup.c (pushdecl_maybe_friend): Reuse the ! set_underlying_type function to install typedef variant types. ! * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor ! macro. ! (append_type_to_template_for_access_check): New entry points. ! * semantics.c (check_accessibility_of_qualified_id): ! When a typedef that is a member of a class appears in a template, ! add it to the template. It will be ... ! * pt.c (instantiate_class_template, instantiate_template ): ... access ! checked at template instantiation time. ! (tsubst): Handle the case of being called with NULL args. ! (resolve_type_name_type): The type name should be the name of the ! main type variant. ! (append_type_to_template_for_access_check): New entry point. ! 2009-01-19 Jason Merrill ! PR c++/23287 ! * parser.c (cp_parser_unqualified_id): In a template, ! accept ~identifier. ! * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE. ! 2009-01-16 Jason Merrill ! PR c++/38877 ! * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF. ! * init.c (build_new): Don't call describable_type unless we ! have an auto. ! PR c++/29470 ! * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags. ! PR c++/38579 ! * search.c (protected_accessible_p): N doesn't vary. ! 2009-01-15 Jason Merrill ! PR c++/38850 ! * pt.c (tsubst_copy_and_build): Tell finish_call_expr to ! accept hidden friends. ! 2009-01-15 Andrew Pinski ! PR C++/29388 ! * decl.c (grokdeclarator): Check for a non namespace/class context. ! 2009-01-15 Jason Merrill ! PR c++/36334 ! PR c++/37646 ! * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to ! a function isn't necessarily an lvalue. Take tree, not const_tree. ! (lvalue_p, real_lvalue_p): Take tree, not const_tree. ! * typeck.c (lvalue_or_else): Likewise. ! * cp-tree.h: Adjust prototypes. ! 2009-01-15 Steve Ellcey ! PR c++/38357 ! * pt.c (tsubst): Check for NULL args. ! 2009-01-15 Dodji Seketeli ! PR c++/38636 ! * name-lookup.c (pushtag): Don't create members to types that are not ! being created. ! 2009-01-14 Nick Clifton ! PR c++/37862 ! * parser.c: Pass cp_id_kind computed in ! cp_parser_postfix_dot_deref_expression to ! cp_parser_primary_expression. ! 2009-01-13 Jakub Jelinek ! PR c++/38795 ! * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR, ! STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same ! as CAST_EXPR. ! 2009-01-12 Jason Merrill ! Steve Ellcey ! PR c++/35109 ! * name-lookup.c (lookup_name_real): Keep looking past a hidden ! binding. ! 2009-01-12 Dodji Seketeli ! PR c++/36019 ! * pt.c (parameter_of_template_p): New function. * cp-tree.h: Declare it. ! * name-lookup.c (binding_to_template_parms_of_scope_p): New ! function. ! (outer_binding): Take template parameters in account when looking for ! a name binding. ! 2009-01-12 Jason Merrill ! PR c++/31488 ! * tree.c (pod_type_p): Return 1 for structs created by the back end. ! 2009-01-12 Jakub Jelinek ! PR c/32041 ! * parser.c (cp_parser_builtin_offsetof): Allow `->' in ! offsetof member-designator, handle it as `[0].'. ! PR c++/38794 ! * decl.c (start_function): If grokdeclarator hasn't returned ! FUNCTION_DECL nor error_mark_node, issue diagnostics. ! 2009-01-11 Jakub Jelinek ! PR c++/36254 ! * cp-gimplify.c (genericize_if_stmt): Renamed from ... ! (gimplify_if_stmt): ... this. ! (cp_gimplify_expr): Don't handle IF_STMT here. ! (cp_genericize_r): Call genericize_if_stmt for IF_STMT. ! 2009-01-10 Andrew Pinski ! PR c++/38648 ! * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl. ! PR c++/36695 ! * typeck2.c (build_functional_cast): Check for reference type and NULL ! PARMS. ! 2009-01-09 Steve Ellcey ! * typeck.c (cp_build_unary_op): Check for ERROR_MARK. ! 2009-01-09 Jakub Jelinek ! PR c++/35335 ! * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR. ! 2009-01-09 John F. Carr ! PR c++/37877 ! * parser.c (cp_parser_class_specifier): Clear ! parser->in_unbraced_linkage_specification_p while parsing class ! specifiers. ! 2009-01-07 Jakub Jelinek ! PR c++/38725 ! * semantics.c (finish_goto_stmt): Convert destination to ! void *. ! 2009-01-06 Jason Merrill ! PR c++/35297 ! PR c++/35477 ! PR c++/35784 ! PR c++/36846 ! PR c++/38276 ! * pt.c (check_default_tmpl_args): Don't complain about ! out-of-order parameter packs in the enclosing class ! or parameter packs after default args. ! (coerce_template_parms): If we have more than one ! parameter pack, don't flatten argument packs. ! (template_args_equal): Handle argument packs. ! (comp_template_args): Don't flatten argument packs. ! (check_instantiated_arg): Split out from... ! (check_instantiated_args): Here. Handle arg packs. ! (convert_template_argument): Just check that nontype argument ! packs have the right type. ! 2009-01-05 Dodji Seketeli ! PR c++/38472 ! * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo. ! 2009-01-05 Jason Merrill ! PR c++/38698 ! * typeck2.c (process_init_constructor_union): Handle union with ! no fields. ! * mangle.c (write_expression): Remove mangling for zero-operand ! casts. ! PR c++/38701 ! * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid ! defaulting. ! PR c++/38702 ! * class.c (defaultable_fn_p): Only operator== can be a copy ! assignment operator. ! 2009-01-02 Jason Merrill ! PR c++/38698 ! * typeck2.c (process_init_constructor_union): Handle excess initializers. ! (process_init_constructor_record): Likewise. + PR c++/38684 + * typeck2.c (digest_init_r): Don't use process_init_constructor + for non-aggregate classes. diff -Nrcpad gcc-4.3.3/gcc/cp/ChangeLog-1998 gcc-4.4.0/gcc/cp/ChangeLog-1998 *** gcc-4.3.3/gcc/cp/ChangeLog-1998 Wed May 18 14:10:35 2005 --- gcc-4.4.0/gcc/cp/ChangeLog-1998 Fri Sep 5 11:07:45 2008 *************** Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi *** 495,501 **** * decl.c (require_complete_types_for_parms): Call layout_decl after we've completed the type. ! 1998-11-21 Martin von Löwis * decl2.c (validate_nonmember_using_decl): Allow using templates from the global namespace. --- 495,501 ---- * decl.c (require_complete_types_for_parms): Call layout_decl after we've completed the type. ! 1998-11-21 Martin von Löwis * decl2.c (validate_nonmember_using_decl): Allow using templates from the global namespace. *************** Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi *** 769,775 **** * method.c (build_overload_value): Handle REFERENCE_TYPE. ! 1998-11-08 Martin von Löwis * decl.c (grokdeclarator): Allow namespace-scoped members if they are friends. --- 769,775 ---- * method.c (build_overload_value): Handle REFERENCE_TYPE. ! 1998-11-08 Martin von Löwis * decl.c (grokdeclarator): Allow namespace-scoped members if they are friends. *************** Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi *** 1081,1091 **** * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all non-converting constructors. ! 1998-10-24 Martin von Löwis * gxxint.texi: Correct documentation for n, N, Q, and B. ! 1998-10-23 Martin von Löwis * parse.y (condition): Convert VAR_DECL from reference to indirect reference. --- 1081,1091 ---- * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all non-converting constructors. ! 1998-10-24 Martin von Löwis * gxxint.texi: Correct documentation for n, N, Q, and B. ! 1998-10-23 Martin von Löwis * parse.y (condition): Convert VAR_DECL from reference to indirect reference. *************** Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi *** 1219,1225 **** * decl.c (grokdeclarator): Use them. * tree.c (canonical_type_variant): Likewise. ! 1998-10-22 Martin von Löwis * parse.y (named_class_head): Push into class while parsing the base class list. --- 1219,1225 ---- * decl.c (grokdeclarator): Use them. * tree.c (canonical_type_variant): Likewise. ! 1998-10-22 Martin von Löwis * parse.y (named_class_head): Push into class while parsing the base class list. *************** Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi *** 1264,1270 **** * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args. ! 1998-10-18 Martin von Löwis * decl2.c (validate_nonmember_using_decl): Fix using-directives of std if std is ignored. --- 1264,1270 ---- * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args. ! 1998-10-18 Martin von Löwis * decl2.c (validate_nonmember_using_decl): Fix using-directives of std if std is ignored. *************** Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi *** 1659,1665 **** * pt.c (instantiate_decl): Do save and restore file position. ! 1998-10-05 Martin von Löwis * method.c (build_decl_overload_real): Clear numeric_output_need_bar after __. --- 1659,1665 ---- * pt.c (instantiate_decl): Do save and restore file position. ! 1998-10-05 Martin von Löwis * method.c (build_decl_overload_real): Clear numeric_output_need_bar after __. *************** Thu Oct 1 10:43:45 1998 Nick Clifton *** 1793,1799 **** (finish_anon_union): Also complain about local anon unions with no members. ! 1998-09-25 Martin von Löwis * decl.c (lookup_namespace_name): If the name is a namespace, return it immediately. --- 1793,1799 ---- (finish_anon_union): Also complain about local anon unions with no members. ! 1998-09-25 Martin von Löwis * decl.c (lookup_namespace_name): If the name is a namespace, return it immediately. *************** Tue Sep 22 21:01:19 1998 Gerald Pfeifer *** 1905,1911 **** * decl2.c (grokfield): Likewise. * pt.c (finish_member_template_decl): Likewise. ! 1998-09-20 Martin von Löwis * method.c (hack_identifier): Finding multiple members is always an error. --- 1905,1911 ---- * decl2.c (grokfield): Likewise. * pt.c (finish_member_template_decl): Likewise. ! 1998-09-20 Martin von Löwis * method.c (hack_identifier): Finding multiple members is always an error. *************** Mon Sep 21 01:53:05 1998 Felix Lee * decl.c (make_typename_type): If context is a namespace, the code is in error. --- 2017,2023 ---- * error.c (dump_type_real): Handle NAMESPACE_DECL. * parse.y (base_class.1): Avoid crash on error. ! 1998-09-08 Martin von Löwis * decl.c (make_typename_type): If context is a namespace, the code is in error. *************** Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi *** 2495,2501 **** * lex.c (real_yylex): Don't warn about long long constants if we're allowing long long. ! 1998-08-24 Martin von Löwis * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of accessing bindings directly. --- 2495,2501 ---- * lex.c (real_yylex): Don't warn about long long constants if we're allowing long long. ! 1998-08-24 Martin von Löwis * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of accessing bindings directly. *************** Fri Aug 14 16:42:27 1998 Nick Clifton *** 3143,3149 **** * decl.c (qualify_lookup): New fn. (lookup_name_real): Use it. ! 1998-07-16 Martin v. Loewis * decl2.c (add_using_namespace): When directly using a namespace that was indirect before, promote it. --- 3143,3149 ---- * decl.c (qualify_lookup): New fn. (lookup_name_real): Use it. ! 1998-07-16 Martin v. Löwis * decl2.c (add_using_namespace): When directly using a namespace that was indirect before, promote it. *************** Fri Aug 14 16:42:27 1998 Nick Clifton *** 3184,3190 **** * decl.c (push_using_directive): Iterate over namespaces used indirectly. ! 1998-07-15 Martin v. Löwis * decl2.c (add_using_namespace): Iterate over namespaces used indirectly. --- 3184,3190 ---- * decl.c (push_using_directive): Iterate over namespaces used indirectly. ! 1998-07-15 Martin v. Löwis * decl2.c (add_using_namespace): Iterate over namespaces used indirectly. *************** Fri Aug 14 16:42:27 1998 Nick Clifton *** 3218,3224 **** * parse.y (using_directive): New nonterminal. (extdef, simple_stmt): Use it. ! 1998-07-14 Martin von Löwis * decl2.c (add_function): Move error message ... (arg_assoc_namespace): ... from here. --- 3218,3224 ---- * parse.y (using_directive): New nonterminal. (extdef, simple_stmt): Use it. ! 1998-07-14 Martin von Löwis * decl2.c (add_function): Move error message ... (arg_assoc_namespace): ... from here. *************** Tue Jul 14 20:09:22 1998 Jeffrey A Law *** 3238,3244 **** * call.c (joust): Don't warn about "confusing" conversions to the same type. ! 1998-07-14 Martin von Löwis * class.c (push_nested_class): Complain about namespaces. * decl.c (start_decl): Enter the object's namespace. --- 3238,3244 ---- * call.c (joust): Don't warn about "confusing" conversions to the same type. ! 1998-07-14 Martin von Löwis * class.c (push_nested_class): Complain about namespaces. * decl.c (start_decl): Enter the object's namespace. *************** Tue Jul 14 20:09:22 1998 Jeffrey A Law *** 3257,3263 **** * init.c (build_offset_ref): Call mark_used and convert_from_reference for namespace members. ! Mon Jul 13 23:25:28 1998 Martin von Löwis * search.c (my_tree_cons): The bitfield is at index 2. --- 3257,3263 ---- * init.c (build_offset_ref): Call mark_used and convert_from_reference for namespace members. ! Mon Jul 13 23:25:28 1998 Martin von Löwis * search.c (my_tree_cons): The bitfield is at index 2. *************** Mon Jul 13 17:21:01 1998 Nick Clifton *** 3266,3272 **** * lang-options.h: Format changed to work with new --help support in gcc/toplev.c ! 1998-07-12 Martin von Löwis * decl2.c (build_expr_from_tree): Change calls of do_identifier. Do Koenig lookup in CALL_EXPR. --- 3266,3272 ---- * lang-options.h: Format changed to work with new --help support in gcc/toplev.c ! 1998-07-12 Martin von Löwis * decl2.c (build_expr_from_tree): Change calls of do_identifier. Do Koenig lookup in CALL_EXPR. *************** Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi *** 3484,3490 **** * sig.c (build_signature_pointer_or_reference_type): Don't set DECL_CONTEXT. ! 1998-06-24 Martin v. Löwis Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace. * cp-tree.h (FROB_CONTEXT): New macro. --- 3484,3490 ---- * sig.c (build_signature_pointer_or_reference_type): Don't set DECL_CONTEXT. ! 1998-06-24 Martin v. Löwis Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace. * cp-tree.h (FROB_CONTEXT): New macro. *************** Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi *** 3858,3864 **** * error.c (cp_printers): Use 'o' instead of '_' for the null entry. ! 1998-06-05 Martin v. Loewis * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare. * decl.c (lookup_name_real): Add namespaces_only parameter. --- 3858,3864 ---- * error.c (cp_printers): Use 'o' instead of '_' for the null entry. ! 1998-06-05 Martin v. Löwis * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare. * decl.c (lookup_name_real): Add namespaces_only parameter. *************** Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi *** 3886,3892 **** * error.c (dump_expr): Clean up NEW_EXPR case. ! 1998-06-04 Martin von Löwis Suggested by Brendan Kehoe * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL, --- 3886,3892 ---- * error.c (dump_expr): Clean up NEW_EXPR case. ! 1998-06-04 Martin von Löwis Suggested by Brendan Kehoe * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL, *************** Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi *** 4039,4045 **** * decl.c (pushdecl): Don't copy the type_decl. ! 1998-05-26 Martin v. Löwis * class.c (pushclass): Always store TYPE_MAIN_VARIANT in current_class_type. --- 4039,4045 ---- * decl.c (pushdecl): Don't copy the type_decl. ! 1998-05-26 Martin v. Löwis * class.c (pushclass): Always store TYPE_MAIN_VARIANT in current_class_type. *************** Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi *** 4060,4066 **** * decl.c (pushtag): Avoid crashing on erroneous input. ! 1998-05-25 Martin v. Löwis * decl.c (push_namespace): Only produce one unique name for anonymous namespaces. --- 4060,4066 ---- * decl.c (pushtag): Avoid crashing on erroneous input. ! 1998-05-25 Martin v. Löwis * decl.c (push_namespace): Only produce one unique name for anonymous namespaces. *************** Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi *** 4127,4133 **** used as expression. * typeck.c (decay_conversion): Likewise. ! 1998-05-24 Martin von Löwis * error.c (dump_expr): Support namespaces. --- 4127,4133 ---- used as expression. * typeck.c (decay_conversion): Likewise. ! 1998-05-24 Martin von Löwis * error.c (dump_expr): Support namespaces. *************** Thu May 21 11:54:44 1998 Dave Brolley *** 4248,4254 **** * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types. In fact, don't use DECL_CONTEXT at all here. ! 1998-05-20 Martin von Loewis * decl.c (record_unknown_type): New function. (init_decl_processing): Call it for the unknown and global type --- 4248,4254 ---- * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types. In fact, don't use DECL_CONTEXT at all here. ! 1998-05-20 Martin von Löwis * decl.c (record_unknown_type): New function. (init_decl_processing): Call it for the unknown and global type *************** Mon May 18 03:00:57 1998 Jason Merrill *** 4366,4372 **** * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG. ! Mon May 18 01:43:01 1998 Martin v. Loewis * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE for a type unless it is one. --- 4366,4372 ---- * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG. ! Mon May 18 01:43:01 1998 Martin v. Löwis * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE for a type unless it is one. *************** Mon May 18 01:24:08 1998 Jeffrey A Law *** 4380,4386 **** * Makefile.in (BISON): Use bison from the build tree if it exists. (FLEX): Likewise. ! Sun May 17 14:52:08 1998 Martin v. Loewis * typeck.c (type_unknown_p): Return true for TREE_LIST also. --- 4380,4386 ---- * Makefile.in (BISON): Use bison from the build tree if it exists. (FLEX): Likewise. ! Sun May 17 14:52:08 1998 Martin v. Löwis * typeck.c (type_unknown_p): Return true for TREE_LIST also. *************** Sat May 9 14:44:37 1998 Jason Merrill *** 4620,4626 **** * decl.c (lookup_name_real): Use it. * search.c (lookup_field): Likewise. ! Fri May 8 23:32:42 1998 Martin von Loewis * cp-tree.def (OVERLOAD): New node. * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE, --- 4620,4626 ---- * decl.c (lookup_name_real): Use it. * search.c (lookup_field): Likewise. ! Fri May 8 23:32:42 1998 Martin von Löwis * cp-tree.def (OVERLOAD): New node. * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE, *************** Wed Feb 25 00:35:33 1998 Jason Merrill *** 5894,5900 **** * decl.c (get_unique_name): Tweak from earlier in the name. ! Tue Feb 24 22:15:04 1998 Martin von Loewis * cp-tree.def: Add CPLUS_BINDING node. * cp-tree.h (tree_binding): New struct. --- 5894,5900 ---- * decl.c (get_unique_name): Tweak from earlier in the name. ! Tue Feb 24 22:15:04 1998 Martin von Löwis * cp-tree.def: Add CPLUS_BINDING node. * cp-tree.h (tree_binding): New struct. diff -Nrcpad gcc-4.3.3/gcc/cp/ChangeLog-1999 gcc-4.4.0/gcc/cp/ChangeLog-1999 *** gcc-4.3.3/gcc/cp/ChangeLog-1999 Wed Jun 15 00:41:35 2005 --- gcc-4.4.0/gcc/cp/ChangeLog-1999 Fri Sep 5 11:07:45 2008 *************** Wed Nov 10 12:43:21 1999 Philippe De Mu *** 914,920 **** * semantics.c (begin_new_placement): Remove. (finish_new_placement): Likewise. ! 1999-11-05 Martin v. Löwis * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. (DECL_TEMPLATE_INFO): Use it. --- 914,920 ---- * semantics.c (begin_new_placement): Remove. (finish_new_placement): Likewise. ! 1999-11-05 Martin v. Löwis * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. (DECL_TEMPLATE_INFO): Use it. *************** Fri Sep 24 10:48:10 1999 Bernd Schmidt *** 1714,1720 **** * typeck.c (mark_addressable): Addressed variables are implicitly used. ! 1999-09-23 Martin v. Löwis * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise. --- 1714,1720 ---- * typeck.c (mark_addressable): Addressed variables are implicitly used. ! 1999-09-23 Martin v. Löwis * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise. *************** Fri Sep 24 10:48:10 1999 Bernd Schmidt *** 1733,1739 **** * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned int' for wchar_t. ! 1999-09-23 Martin v. Löwis * ir.texi: Fix formatting errors and typos. --- 1733,1739 ---- * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned int' for wchar_t. ! 1999-09-23 Martin v. Löwis * ir.texi: Fix formatting errors and typos. *************** Fri Sep 24 10:48:10 1999 Bernd Schmidt *** 1769,1775 **** * decl2.c (lang_decode_option): Adjust, in the wake of recent changes to option processing. ! 1999-09-21 Martin v. Löwis * typeck.c (get_member_function_from_ptrfunc): Allow extraction of function pointer from pmfs with no object given. --- 1769,1775 ---- * decl2.c (lang_decode_option): Adjust, in the wake of recent changes to option processing. ! 1999-09-21 Martin v. Löwis * typeck.c (get_member_function_from_ptrfunc): Allow extraction of function pointer from pmfs with no object given. *************** Mon Sep 20 10:49:05 1999 Bernd Schmidt *** 1922,1928 **** (cp_finish_decl): Adjust call to layout_var_decl. * pt.c (tsubst_expr): Make sure to initialize stmt before using it. ! 1999-09-18 Martin von Loewis * typeck.c (get_member_function_from_ptrfunc): Always consider virtuality inside member pointer. --- 1922,1928 ---- (cp_finish_decl): Adjust call to layout_var_decl. * pt.c (tsubst_expr): Make sure to initialize stmt before using it. ! 1999-09-18 Martin von Löwis * typeck.c (get_member_function_from_ptrfunc): Always consider virtuality inside member pointer. *************** Mon Aug 23 22:17:20 1999 Mumit Khan * lex.c (do_identifier): Remove unnecessary lookup of class field. ! 1999-08-09 Martin v. Loewis * decl2.c (set_decl_namespace): Do not complain about non-matching decls if processing a template. --- 3751,3761 ---- (build_functional_cast): Likewise. * xref.c (GNU_xref_decl): Likewise. ! 1999-08-10 Martin v. Löwis * lex.c (do_identifier): Remove unnecessary lookup of class field. ! 1999-08-09 Martin v. Löwis * decl2.c (set_decl_namespace): Do not complain about non-matching decls if processing a template. *************** Wed Jul 7 01:26:47 1999 Alexandre Oliv *** 4559,4565 **** maybe_push_cache_obstack. * search.c (push_class_decls): Likewise. ! 1999-06-14 Martin von Löwis * pt.c (tsubst_friend_function): Push into namespace of friend function before pushdecl'ing it. --- 4559,4565 ---- maybe_push_cache_obstack. * search.c (push_class_decls): Likewise. ! 1999-06-14 Martin von Löwis * pt.c (tsubst_friend_function): Push into namespace of friend function before pushdecl'ing it. *************** Tue May 18 00:21:34 1999 Zack Weinberg *** 4972,4978 **** * pt.c (check_explicit_specialization): Improve error messages. ! 1999-05-04 Martin von Löwis * typeck.c (string_conv_p): Use same_type_p to check whether we try to convert between char and wchar_t. --- 4972,4978 ---- * pt.c (check_explicit_specialization): Improve error messages. ! 1999-05-04 Martin von Löwis * typeck.c (string_conv_p): Use same_type_p to check whether we try to convert between char and wchar_t. *************** Tue May 18 00:21:34 1999 Zack Weinberg *** 4989,4995 **** * typeck.c (build_const_cast): Tighten checks for legality. ! 1999-05-02 Martin von Löwis * init.c (build_member_call): Lookup names coming from namespace-scoped LOOKUP_EXPR. --- 4989,4995 ---- * typeck.c (build_const_cast): Tighten checks for legality. ! 1999-05-02 Martin von Löwis * init.c (build_member_call): Lookup names coming from namespace-scoped LOOKUP_EXPR. *************** Tue May 18 00:21:34 1999 Zack Weinberg *** 4998,5004 **** * gxxint.texi: Add documentation for 'I'. ! 1999-05-02 Martin von Löwis * tinfo.cc (operator==): Qualify type_info with std::. --- 4998,5004 ---- * gxxint.texi: Add documentation for 'I'. ! 1999-05-02 Martin von Löwis * tinfo.cc (operator==): Qualify type_info with std::. *************** Wed Apr 28 11:42:22 1999 Andreas Schwab *** 5391,5397 **** * typeck.c (build_unary_op): Handle taking the address of a unique bound non-static member function. ! 1999-04-13 Martin von Loewis * lang-options.h (-Wdeprecated): New flag. * decl2.c (warn_deprecated): New flag. --- 5391,5397 ---- * typeck.c (build_unary_op): Handle taking the address of a unique bound non-static member function. ! 1999-04-13 Martin von Löwis * lang-options.h (-Wdeprecated): New flag. * decl2.c (warn_deprecated): New flag. *************** Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi *** 5833,5839 **** (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call, gen_assign, GNU_xref_member): Const-ify a char*. ! 1999-03-25 Martin von Löwis * gxxint.texi: Remove old discussion on copying virtual bases. --- 5833,5839 ---- (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call, gen_assign, GNU_xref_member): Const-ify a char*. ! 1999-03-25 Martin von Löwis * gxxint.texi: Remove old discussion on copying virtual bases. *************** Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi *** 5866,5872 **** * lex.c (do_identifier): If we got error_mark_node, call lookup_name again. ! 1999-03-24 Martin von Löwis * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty classes. --- 5866,5872 ---- * lex.c (do_identifier): If we got error_mark_node, call lookup_name again. ! 1999-03-24 Martin von Löwis * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty classes. *************** Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi *** 5984,5990 **** * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c. ($(srcdir)/cp/parse.c): Moved from ../Makefile.in. ! 1999-03-17 Martin von Löwis * parse.y (named_complex_class_head_sans_basetype): Do not push a scope for error_mark_node. --- 5984,5990 ---- * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c. ($(srcdir)/cp/parse.c): Moved from ../Makefile.in. ! 1999-03-17 Martin von Löwis * parse.y (named_complex_class_head_sans_basetype): Do not push a scope for error_mark_node. *************** Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi *** 6064,6070 **** * sig.c (build_signature_table_constructor): Use cp_error. ! 1999-03-13 Martin von Löwis * semantics.c (finish_switch_cond): Handle error cases gracefully. Detected by g++.law/enum5.C. --- 6064,6070 ---- * sig.c (build_signature_table_constructor): Use cp_error. ! 1999-03-13 Martin von Löwis * semantics.c (finish_switch_cond): Handle error cases gracefully. Detected by g++.law/enum5.C. *************** Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi *** 6078,6084 **** * typeck2.c (process_init_constructor): Return error if one argument is in error. Detected by g++.benjamin/13478.C. ! 1999-03-12 Martin von Löwis * decl.c (select_decl): Allow class templates when we need types. * decl2.c (ambiguous_decl): Likewise. --- 6078,6084 ---- * typeck2.c (process_init_constructor): Return error if one argument is in error. Detected by g++.benjamin/13478.C. ! 1999-03-12 Martin von Löwis * decl.c (select_decl): Allow class templates when we need types. * decl2.c (ambiguous_decl): Likewise. *************** Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi *** 6217,6223 **** * decl2.c (import_export_class): Also return if CLASSTYPE_INTERFACE_ONLY is set. ! 1999-03-03 Martin von Löwis * decl.c (push_overloaded_decl): Only overwrite the old binding if there was one. --- 6217,6223 ---- * decl2.c (import_export_class): Also return if CLASSTYPE_INTERFACE_ONLY is set. ! 1999-03-03 Martin von Löwis * decl.c (push_overloaded_decl): Only overwrite the old binding if there was one. *************** Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi *** 6304,6310 **** * typeck.c (convert_for_assignment): Allow boolean integral constant expressions to convert to null pointer. ! 1999-02-24 Martin von Loewis * decl.c (lookup_namespace_name): Resolve namespace aliases. --- 6304,6310 ---- * typeck.c (convert_for_assignment): Allow boolean integral constant expressions to convert to null pointer. ! 1999-02-24 Martin von Löwis * decl.c (lookup_namespace_name): Resolve namespace aliases. *************** Sun Jan 31 20:34:29 1999 Zack Weinberg *** 6558,6564 **** expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, expand_generic_desc): Likewise. ! 1999-01-25 Martin von Löwis * tree.c (equal_functions): New function. (ovl_member): Call it. --- 6558,6564 ---- expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, expand_generic_desc): Likewise. ! 1999-01-25 Martin von Löwis * tree.c (equal_functions): New function. (ovl_member): Call it. *************** Sun Jan 31 20:34:29 1999 Zack Weinberg *** 6567,6573 **** * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf. ! 1999-01-25 Martin von Loewis * decl.c (decls_match): Return 1 if old and new are identical. (push_overloaded_decl): Set OVL_USED when PUSH_USING. --- 6567,6573 ---- * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf. ! 1999-01-25 Martin von Löwis * decl.c (decls_match): Return 1 if old and new are identical. (push_overloaded_decl): Set OVL_USED when PUSH_USING. diff -Nrcpad gcc-4.3.3/gcc/cp/ChangeLog-2000 gcc-4.4.0/gcc/cp/ChangeLog-2000 *** gcc-4.3.3/gcc/cp/ChangeLog-2000 Wed May 18 14:10:35 2005 --- gcc-4.4.0/gcc/cp/ChangeLog-2000 Fri Sep 5 11:07:45 2008 *************** *** 2256,2262 **** * parse.y (member_init): Just pass in the type. * init.c (expand_member_init): Handle getting a type. ! 2000-07-04 Martin v. Löwis Jason Merrill * decl.c (finish_function): Warn if a function has no return --- 2256,2262 ---- * parse.y (member_init): Just pass in the type. * init.c (expand_member_init): Handle getting a type. ! 2000-07-04 Martin v. Löwis Jason Merrill * decl.c (finish_function): Warn if a function has no return *************** *** 2602,2608 **** * decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace. (push_namespace): Set DECL_CONTEXT for a new NAMESPACE_DECL. ! 2000-06-24 Martin v. Löwis * parse.y (complex_direct_notype_declarator): Support global_scope. * Makefile.in: Adjust conflict count. --- 2602,2608 ---- * decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace. (push_namespace): Set DECL_CONTEXT for a new NAMESPACE_DECL. ! 2000-06-24 Martin v. Löwis * parse.y (complex_direct_notype_declarator): Support global_scope. * Makefile.in: Adjust conflict count. *************** *** 3787,3793 **** * semantics.c (finish_member_declaration): Don't mark members of classes declared in an extern "C" region as extern "C". ! 2000-05-22 Martin v. Löwis * decl2.c (qualified_lookup_using_namespace): Look through namespace aliases. --- 3787,3793 ---- * semantics.c (finish_member_declaration): Don't mark members of classes declared in an extern "C" region as extern "C". ! 2000-05-22 Martin v. Löwis * decl2.c (qualified_lookup_using_namespace): Look through namespace aliases. *************** *** 4241,4247 **** * ir.texi: Correct typo. ! 2000-04-25 Martin v. Löwis * decl.c (grokdeclarator): Reject VLAs as members. --- 4241,4247 ---- * ir.texi: Correct typo. ! 2000-04-25 Martin v. Löwis * decl.c (grokdeclarator): Reject VLAs as members. *************** *** 4540,4546 **** (interface_only): Don't declare. (interface_unknown): Likewise. ! 2000-04-11 Martin v. Löwis * tree.h (HAVE_TEMPLATES): Remove definition. * lang-options.h (-fthis-is-variable): Remove documentation. --- 4540,4546 ---- (interface_only): Don't declare. (interface_unknown): Likewise. ! 2000-04-11 Martin v. Löwis * tree.h (HAVE_TEMPLATES): Remove definition. * lang-options.h (-fthis-is-variable): Remove documentation. *************** *** 4595,4601 **** (__pointer_to_member_type_info::__do_catch): Remove. (__pointer_to_member_type_info::__pointer_catch): Implement. ! 2000-04-10 Martin v. Löwis * lex.c (init_parse): Remove traces of classof and headof. * decl2.c (flag_operator_names): Default to 1. --- 4595,4601 ---- (__pointer_to_member_type_info::__do_catch): Remove. (__pointer_to_member_type_info::__pointer_catch): Implement. ! 2000-04-10 Martin v. Löwis * lex.c (init_parse): Remove traces of classof and headof. * decl2.c (flag_operator_names): Default to 1. *************** Wed Apr 5 15:12:18 MET DST 2000 Jan Hu *** 5308,5314 **** * init.c (build_offset_ref): Handle the case of a templated member function. ! 2000-03-19 Martin v. Löwis * except.c (expand_exception_blocks): Clear catch_clauses_last. --- 5308,5314 ---- * init.c (build_offset_ref): Handle the case of a templated member function. ! 2000-03-19 Martin v. Löwis * except.c (expand_exception_blocks): Clear catch_clauses_last. *************** Wed Apr 5 15:12:18 MET DST 2000 Jan Hu *** 5334,5340 **** (layout_class_type): Implement new ABI handling of bitfields longer than their types. ! 2000-03-18 Martin v. Löwis * parse.y (extdefs): Call ggc_collect. * parse.c: Regenerated. --- 5334,5340 ---- (layout_class_type): Implement new ABI handling of bitfields longer than their types. ! 2000-03-18 Martin v. Löwis * parse.y (extdefs): Call ggc_collect. * parse.c: Regenerated. *************** Wed Apr 5 15:12:18 MET DST 2000 Jan Hu *** 5785,5791 **** * init.c (construct_virtual_bases): Fix thinko. * typeck.c (expand_ptrmemfunc_cst): Fix thinko. ! 2000-03-01 Martin von Loewis * decl.c (current_function_decl): Move to toplev.c. --- 5785,5791 ---- * init.c (construct_virtual_bases): Fix thinko. * typeck.c (expand_ptrmemfunc_cst): Fix thinko. ! 2000-03-01 Martin von Löwis * decl.c (current_function_decl): Move to toplev.c. *************** Wed Apr 5 15:12:18 MET DST 2000 Jan Hu *** 5944,5950 **** * decl.c (decls_match): Remove obsolete static member nadgering. ! 2000-02-21 Martin v. Löwis * decl.c (grokdeclarator): Change ANSI to ISO. * lex.c (consume_string, readescape, do_identifier): Likewise. --- 5944,5950 ---- * decl.c (decls_match): Remove obsolete static member nadgering. ! 2000-02-21 Martin v. Löwis * decl.c (grokdeclarator): Change ANSI to ISO. * lex.c (consume_string, readescape, do_identifier): Likewise. *************** Wed Apr 5 15:12:18 MET DST 2000 Jan Hu *** 6088,6094 **** * decl.c (redeclaration_error_message): Allow redeclaration of namespace-scope decls. ! 2000-02-18 Martin von Loewis * typeck2.c (my_friendly_abort): Use GCCBUGURL. --- 6088,6094 ---- * decl.c (redeclaration_error_message): Allow redeclaration of namespace-scope decls. ! 2000-02-18 Martin von Löwis * typeck2.c (my_friendly_abort): Use GCCBUGURL. *************** Wed Apr 5 15:12:18 MET DST 2000 Jan Hu *** 6971,6977 **** * optimize.c (copy_body_r): Clear the operand three of a TARGET_EXPR when copying it. ! 2000-01-14 Martin v. Löwis * method.c (build_decl_overload_real): Check whether we are in :: before returning __builtin_new/delete. --- 6971,6977 ---- * optimize.c (copy_body_r): Clear the operand three of a TARGET_EXPR when copying it. ! 2000-01-14 Martin v. Löwis * method.c (build_decl_overload_real): Check whether we are in :: before returning __builtin_new/delete. *************** Wed Apr 5 15:12:18 MET DST 2000 Jan Hu *** 7268,7274 **** (fixup_vtable_deltas1): Likewise. (finish_struct_1): Likewise. ! 2000-01-01 Martin v. Löwis * call.c (build_new_method_call): Also check destructors. --- 7268,7274 ---- (fixup_vtable_deltas1): Likewise. (finish_struct_1): Likewise. ! 2000-01-01 Martin v. Löwis * call.c (build_new_method_call): Also check destructors. diff -Nrcpad gcc-4.3.3/gcc/cp/ChangeLog-2005 gcc-4.4.0/gcc/cp/ChangeLog-2005 *** gcc-4.3.3/gcc/cp/ChangeLog-2005 Fri May 4 00:16:02 2007 --- gcc-4.4.0/gcc/cp/ChangeLog-2005 Fri Sep 5 11:07:45 2008 *************** *** 113,119 **** * mangle.c (write_bare_function_type): Mangle return type for methods of Java classes ! 2005-12-08 Th�dore Papadopoulo * call.c (build_conditional_expr): Print types in error messages. --- 113,119 ---- * mangle.c (write_bare_function_type): Mangle return type for methods of Java classes ! 2005-12-08 Théodore Papadopoulo * call.c (build_conditional_expr): Print types in error messages. *************** *** 125,135 **** * cp-gimplify.c (gimplify_cp_loop): Use fold_build3. ! 2005-12-07 Rafael �ila de Esp�dola * Make-lang.in (c++.all.build, c++.install-normal): Remove. ! 2005-12-07 Rafael �ila de Esp�dola * Make-lang.in: Remove all dependencies on s-gtype. --- 125,135 ---- * cp-gimplify.c (gimplify_cp_loop): Use fold_build3. ! 2005-12-07 Rafael Ãvila de Espíndola * Make-lang.in (c++.all.build, c++.install-normal): Remove. ! 2005-12-07 Rafael Ãvila de Espíndola * Make-lang.in: Remove all dependencies on s-gtype. diff -Nrcpad gcc-4.3.3/gcc/cp/ChangeLog-2006 gcc-4.4.0/gcc/cp/ChangeLog-2006 *** gcc-4.3.3/gcc/cp/ChangeLog-2006 Fri May 4 00:16:02 2007 --- gcc-4.4.0/gcc/cp/ChangeLog-2006 Fri Sep 5 11:07:45 2008 *************** *** 458,464 **** * typeck.c (build_binary_op): Duplicate warning message for better translation. ! 2006-10-23 Rafael Avila de Espindola * decl.c (builtin_function_1): Move common code to add_builtin_function. --- 458,464 ---- * typeck.c (build_binary_op): Duplicate warning message for better translation. ! 2006-10-23 Rafael Ãvila de Espíndola * decl.c (builtin_function_1): Move common code to add_builtin_function. *************** *** 2846,2852 **** * decl.c (grok_op_properties): Check for ellipsis in arguments of operators. ! 2006-02-20 Rafael Ávila de Espíndola * Make-lang.in (C++): Remove. (.PHONY): Remove C++. --- 2846,2852 ---- * decl.c (grok_op_properties): Check for ellipsis in arguments of operators. ! 2006-02-20 Rafael Ãvila de Espíndola * Make-lang.in (C++): Remove. (.PHONY): Remove C++. *************** *** 3336,3342 **** (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. ! 2006-01-16 Rafael �ila de Esp�dola * g++spec.c (lang_specific_spec_functions): Remove. --- 3336,3342 ---- (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. ! 2006-01-16 Rafael Ãvila de Espíndola * g++spec.c (lang_specific_spec_functions): Remove. diff -Nrcpad gcc-4.3.3/gcc/cp/ChangeLog-2007 gcc-4.4.0/gcc/cp/ChangeLog-2007 *** gcc-4.3.3/gcc/cp/ChangeLog-2007 Thu Jan 1 00:00:00 1970 --- gcc-4.4.0/gcc/cp/ChangeLog-2007 Thu Feb 26 15:31:11 2009 *************** *** 0 **** --- 1,3336 ---- + 2007-12-20 Jason Merrill + + PR c++/34111 + * call.c (standard_conversion): Derived-to-base is considered a + standard conversion. + + 2007-12-19 Jakub Jelinek + + PR c++/34513 + * parser.c (cp_parser_omp_parallel): For non-combined parallel + call cp_parser_statement rather than + cp_parser_already_scoped_statement. + + 2007-12-18 Jason Merrill + + PR c++/34206 + * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't + use template parms. + (dependent_type_p_r): Handle the domain of an array. + + 2007-12-18 Douglas Gregor + Jakub Jelinek + + PR c++/32565 + PR c++/33943 + PR c++/33965 + * pt.c (template_template_parm_bindings_ok_p): New; verifies + bindings of template template parameters after all template + arguments have been deduced. + (coerce_template_parms): Don't complain when COMPLAIN doesn't + include tf_error. + (fn_type_unification): Use template_template_parm_bindings_ok_p. + (unify): Deal with variadic, bound template template parameters. + (get_class_bindings): Use template_template_parm_bindings_ok_p. + + 2007-12-18 Jakub Jelinek + + PR c++/34488 + * decl.c (grokdeclarator): Reject friend sfk_constructor + FUNCTION_TYPE. + + 2007-12-17 Jakub Jelinek + + PR c/34506 + * parser.c (cp_parser_omp_all_clauses): Accept optional comma + in between clauses. + + 2007-12-15 Alexandre Oliva + + PR debug/7081 + * cp-lang.c (cp_classify_record): New. + (LANG_HOOKS_CLASSIFY_RECORD): Override. + + 2007-12-11 Jakub Jelinek + + PR c++/34238 + * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change. + + PR c++/34364 + * rtti.c (build_dynamic_cast): Call convert_from_reference even for + dynamic_cast in a template. + + 2007-12-10 Simon Martin + + PR c++/34059 + * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from + MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO. + + 2007-12-10 Jakub Jelinek + + PR c++/34395 + * error.c (dump_type_prefix, dump_type_suffix): Handle + TYPE_PACK_EXPANSION. + + PR c++/34394 + * error.c (dump_expr): Handle ABS_EXPR. + + 2007-12-09 Jakub Jelinek + + PR c++/34178 + PR c++/34340 + * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P + in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. + Return 2 also if DECL_EXPLICIT_INSTANTIATION. + * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when + flag_use_repository and repo_emit_p returned 2. + + 2007-12-06 Jakub Jelinek + + PR c++/34336 + * tree.c (stabilize_call, stabilize_init): Do nothing if + processing_template_decl. + + 2007-12-05 Jakub Jelinek + + PR c++/34271 + * semantics.c (finish_decltype_type): For SCOPE_REF issue an + error instead of assertion failure. + * parser.c (cp_parser_decltype): If closing paren is not found, + return error_mark_node. + + 2007-12-04 Douglas Gregor + + PR c++/34101 + * name-lookup.c (arg_assoc_template_arg): Recurse on argument + packs. + (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here, + since arg_assoc_template_arg will deal with them (better). + + 2007-12-04 Douglas Gregor + + PR c++/33509 + * pt.c (tsubst_exception_specification): Handle substitutions into + member templates, where tsubst_pack_expansion returns a + TYPE_PACK_EXPANSION. + + 2007-12-04 Douglas Gregor + + PR c++/33091 + * pt.c (unify_pack_expansion): If we didn't deduce any actual + bindings for the template parameter pack, don't try to keep the + empty deduced arguments. + (unify): If a parameter is a template-id whose template argument + list contains a pack expansion that is not at the end, then we + cannot unify against that template-id. + + 2007-12-02 Paolo Carlini + + PR c++/34061 + * pt.c (current_template_args): Use error_operand_p. + + 2007-12-02 Paolo Carlini + + PR c++/34273 + * error.c (dump_decl): Handle TREE_BINFO. + + 2007-12-01 Ollie Wild + + PR c++/8171 + * typeck.c (build_binary_op): Add conversion of pointers to function + members appearing as operands to the equality operators. + + 2007-11-30 Jakub Jelinek + + PR c++/34275 + * error.c (dump_expr): Handle OBJ_TYPE_REF. + + 2007-11-29 Jakub Jelinek + + PR c++/34270 + * tree.c (lvalue_p_1) : Handle x ?: y + in templates. + * typeck.c (is_bitfield_expr_with_lowered_type) : + Likewise. + + PR c++/34267 + PR c++/34268 + * parser.c (cp_parser_decltype): Don't call finish_id_expression + on ~type. + * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs + and ~type early. + + 2007-11-27 Jakub Jelinek + + PR tree-optimization/34181 + * method.c (use_thunk): Don't inline the call in the thunk. + + PR c++/34213 + * tree.c (decl_linkage): Static data members and static member + functions in anonymous ns classes are lk_external. + + 2007-11-26 Andreas Krebbel + + PR c++/34081 + * decl.c (start_preparsed_function): Pass + processing_template_decl for the new allocate_struct_function + parameter. + + 2007-11-25 Richard Guenther + + * decl.c (poplevel): Use BLOCK_CHAIN. + + 2007-11-24 Ollie Wild + + * typeck.c (delta_from_ptrmemfunc): New function. + (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc. + (build_binary_op): Call delta_from_ptrmemfunc. + + 2007-11-23 Jakub Jelinek + + PR c++/30293 + PR c++/30294 + * decl.c (cp_finish_decl): Disallow variable or field + definitions if extern "Java" aggregates. + (grokparms): Disallow parameters with extern "Java" + aggregates. + (check_function_type): Disallow function return values + with extern "Java" aggregates. + * init.c (build_new_1): Disallow placement new with + extern "Java" aggregates. + + 2007-11-23 Mark Mitchell + Manuel Lopez-Ibanez + + PR c++/5310 + * call.c (convert_like_real): Build a zero constant when __null is + converted to an integer type. + + 2007-11-22 Jakub Jelinek + + PR c++/34094 + * decl2.c (cp_write_global_declarations): Issue error about static + data members in anonymous namespace which are declared and used, + but not defined. + + 2007-11-20 Jakub Jelinek + + PR c++/34089 + * parser.c (cp_parser_class_head): Reject function template ids. + + PR c++/28879 + * tree.c (build_cplus_array_type_1): Don't pass any VLA types + when processing_template_decl to build_array_type. + + PR c++/33962 + * pt.c (more_specialized_fn): Don't segfault if one or + both argument list end with ellipsis. + + 2007-11-18 Jakub Jelinek + + PR c++/30988 + * semantics.c (finish_call_expr): Set + current_function_returns_abnormally if fn is noreturn FUNCTION_DECL + or OVERLOAD with all noreturn functions. + + 2007-11-16 Jakub Jelinek + + PR c++/34100 + * pt.c (apply_late_template_attributes): Do nothing if decl's type is + error_mark_node. + + 2007-11-13 Jakub Jelinek + + PR c++/34054 + PR c++/34056 + PR c++/34057 + PR c++/34058 + PR c++/34060 + * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error, + set to error_mark_node the outermost POINTER_TYPE to the pack if + it is seen in a POINTER_TYPE. + (push_template_decl_real): If check_for_bare_parameter_packs + fails for function return type, set the return type to + integer_type_node. If check_for_bare_parameter_packs failed + for non-function, return error_mark_node. + + PR c++/29225 + * call.c (build_new_op): Call resolve_args before calling + build_over_call. + + 2007-11-11 Tom Tromey + + PR c++/17577: + * lex.c (handle_pragma_implementation): Use cpp_included_before. + + 2007-11-12 Manuel Lopez-Ibanez + + PR c++/8570 + * pt.c (redeclare_class_template): Update error message. Use a + note to show the previous declaration. + (tsubst_friend_class): Use the location of the friend template as + the input location before calling redeclare_class_template. + + 2007-11-11 Jakub Jelinek + + PR c++/34068 + * semantics.c (finish_pseudo_destructor_expr): Handle + object == error_mark_node. + + 2007-11-10 Jakub Jelinek + + PR c++/32241 + * pt.c (tsubst_copy_and_build) : If object_type + is not scalar type, let finish_class_member_access_expr handle + diagnostics. Pass BIT_NOT_EXPR argument to + finish_pseudo_destructor_expr. Handle SCOPE_REF properly. + + 2007-11-09 Douglas Gregor + + PR c++/33510 + * decl.c (cp_complete_array_type): If any of the initializer + elements are pack expansions, don't compute the array size yet. + + 2007-11-08 Andrew Pinski + + PR c++/30297: + * tree.c (decl_linkage): Fields have no linkage. + + 2007-11-08 Daniel Jacobowitz + + * class.c (build_ctor_vtbl_group): Lay out the new type and decl. + + 2007-11-07 Douglas Gregor + + PR c++/33045 + PR c++/33837 + PR c++/33838 + * semantics.c (finish_decltype_type): See through INDIRECT_REFs. + Be careful with ERROR_MARK_NODEs. + * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL + argument. + + 2007-11-07 Jakub Jelinek + + PR c++/33501 + * call.c (build_over_call): Don't check TREE_ADDRESSABLE + on incomplete type. + + 2007-11-06 Douglas Gregor + + PR c++/33977 + PR c++/33886 + * tree.c (c_build_qualified_type): Define bridge to + cp_build_qualified_type. + + 2007-11-06 Douglas Gregor + + PR c++/31439 + PR c++/32114 + PR c++/32115 + PR c++/32125 + PR c++/32126 + PR c++/32127 + PR c++/32128 + PR c++/32253 + PR c++/32566 + * typeck.c (check_return_expr): Pass address of retval to + check_for_bare_parameter_packs. + * class.c (build_base_field): Tolerate bases that have no layout + due to errors. + (end_of_base): Ditto. + * tree.c (canonical_type_variant): Be careful with + ERROR_MARK_NODE. + * cp-tree.h (check_for_bare_parameter_packs): Now accepts a + tree*. + * pt.c (find_parameter_pack_data): Add set_packs_to_error field, + which states whether parameter packs should be replaced with + ERROR_MARK_NODE. + (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever + possible. If set_packs_to_error is set true, replace the parameter + pack with ERROR_MARK_NODE. Manage our own pointer sets. + (uses_parameter_packs): Don't set parameter packs to + ERROR_MARK_NODE. + (check_for_bare_parameter_packs): Now takes a pointer to a tree, + which may be modified (if it is a parameter pack). Instructs + find_parameter_packs_r to replace parameter packs with + ERROR_MARK_NODE (so that they won't cause errors later on). + (process_template_parm): Pass pointer to + check_for_bare_parameter_packs. + (process_partial_specialization): Replace pack expansions before + the end of the template argument list with ERROR_MARK_NODE. + (push_template_decl_real): Pass pointer to + check_for_bare_parameter_packs. Replace parameter packs not at the + end of the template parameter list with ERROR_MARK_NODE. + (convert_template_argument): Be more careful about using DECL_NAME + on only declarations. + (unify): Can't unify against ERROR_MARK_NODE. + * semantics.c (finish_cond): Pass pointer to + check_for_bare_parameter_packs. + (finish_expr_stmt): Ditto. + (finish_for_expr): Ditto. + (finish_switch_cond): Pass pointer to + check_for_bare_parameter_packs, and call it before we put the + condition into the statement. + (finish_mem_initializers): Pass pointer to + check_for_bare_parameter_packs. + (finish_member_declaration): Ditto. + * parser.c (cp_parser_base_clause): Ditto. + + 2007-11-06 Jakub Jelinek + + PR target/33168 + * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already + with the final TREE_READONLY flag in place. processing_template_decl + is known to be 0 in this part of function. + + PR c++/33894 + * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not + OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC. + * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P. + * semantics.c (finish_omp_atomic): Revert most of the + 2007-02-05 changes, just keep the new representation of + OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC. + + 2007-11-05 H.J. Lu + + PR c++/33871 + * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked + local. + + 2007-11-05 Douglas Gregor + + PR c++/33996 + PR c++/33235 + PR c++/33930 + * typeck.c (merge_types): Don't lose rvalue references when + merging types. + * call.c (build_over_call): Don't elide move constructors just + because the copy constructor is trivial (!). + (compare_ics): If comparing cv-qualifiers fails, we can still order + based on binding lvalues vs. rvalues. + + 2007-11-05 Douglas Gregor + + PR c++/33939 + * pt.c (unify_pack_expansion): bring handling of function call + arguments into line with type_unification_real. + + 2007-11-05 Manuel Lopez-Ibanez + + * typeck.c (build_binary_op): Use pedwarn instead of error for + consistency. + + 2007-11-05 Jakub Jelinek + + PR c++/33836 + * parser.c (cp_parser_unary_expression): For &&label call + cp_parser_non_integral_constant_expression and return error_mark_node + if it returned true. + + PR c++/33969 + * decl.c (grokdeclarator): Don't call build_memfn_type if type + is neither FUNCTION_TYPE nor METHOD_TYPE. + + 2007-11-02 Jakub Jelinek + + PR c++/33516 + * parser.c (cp_parser_nested_name_specifier_opt): Use + TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete + typedef of currently open class. + + 2007-11-02 Paolo Carlini + + PR c++/33495 + * error.c (dump_expr): Deal specially with statements. + + 2007-11-01 Jason Merrill + + PR c++/30897 + * pt.c (push_template_decl_real): Set DECL_CONTEXT on template + template parms. + (lookup_template_class): Use it to get the outer template args + for instantiating one. + + PR c++/29236 + * pt.c (reduce_template_parm_level): tsubst the parameters + of a template template parm. + + 2007-11-01 Douglas Gregor + + PR c++/33955 + * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE. + + 2007-11-01 Jakub Jelinek + + PR c++/32384 + * parser.c (cp_parser_postfix_dot_deref_expression): If + POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor + first and if that succeeds and type is SCALAR_TYPE_P, create + PSEUDO_DTOR_EXPR. + + PR c++/32260 + * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment. + (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo + as for std::type_info. + + 2007-10-31 Paolo Carlini + + PR c++/33494 + * cxx-pretty-print.c (pp_cxx_typeid_expression, + pp_cxx_delete_expression): Change to static linkage. + * cxx-pretty-print.h: Adjust declarations. + * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR, + MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR, + MODOP_EXPR): Forward to pp_expression. + + * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR): + Fix typo. + + 2007-10-31 Christian Bruel + Mark Mitchell + + PR c++/19531 + * typeck.c (check_return_expr): Don't set named_return_value_okay_p + if retval is volatile. + + 2007-10-30 Jakub Jelinek + + PR c++/33616 + * decl2.c (build_offset_ref_call_from_tree): Call + build_non_dependent_expr on object prior to building ADDR_EXPR from it + if FN is DOTSTAR_EXPR. + + 2007-10-30 Douglas Gregor + + PR c++/31993 + PR c++/32252 + * pt.c (find_parameter_packs_r): Fix typo in comment. + (convert_template_argument): Look at the pattern of a pack + expansion to determine what kind of entity we're converting. + (coerce_template_parameter_pack): When we have coerced a non-type + template parameter pack, substitute into the type of that pack. + (tsubst_pack_expansion): When our substitution of a parameter pack + is a "trivial" substitution of itself, just substitute into the + pack expansion rather than actually expanding. + + 2007-10-29 Jakub Jelinek + + PR c++/33841 + * class.c (check_bitfield_decl): Don't set field's type to error_mark_node + for non-integral type bitfields. Return true if bitfield is correct, false + error has been diagnosed. + (check_field_decls): If check_bitfield_decl returned false, call also + check_field_decl. + + 2007-10-28 Paolo Carlini + Mark Mitchell + + PR c++/30659 + * pt.c (do_decl_instantiation): If the VAR_DECL is not a + class member error out and return. + + 2007-10-27 Jakub Jelinek + + * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope + to current_function_decl rather than 0. + + PR c++/33844 + * cxx-pretty-print.c (pp_cxx_pm_expression) : Print + ->* rather than .*. + * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR. + + 2007-10-27 Jason Merrill + + PR c++/5247 + * call.c (convert_default_arg): Detect recursion. + + 2007-10-27 Jakub Jelinek + + PR c++/33842 + * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype. + * cxx-pretty-print.c (pp_cxx_primary_expression): Handle + OFFSETOF_EXPR. + (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New + functions. + * error.c (dump_expr): Handle OFFSETOF_EXPR. + + 2007-10-26 Jason Merrill + + PR c++/24791 + * pt.c (get_template_info): New fn. + (template_class_depth): Use it. + (push_template_decl_real): Check that the template args of the + definition match the args of the previous declaration. + + 2007-10-26 Paolo Carlini + + PR c++/31988 + * decl2.c (coerce_new_type): Do not allow a default argument for + the first parameter. + + 2007-10-26 Douglas Gregor + + PR c++/33839 + * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we + don't see the leading '('. Only lookup names if we get an + IDENTIFIER_NODE. + + 2007-10-26 Jakub Jelinek + + PR c++/33744 + * parser.c (cp_parser_parenthesized_expression_list): Set + greater_than_is_operator_p to true in between the parens. + + 2007-10-26 Paolo Carlini + + PR c++/31747 + * decl.c (grokdeclarator): In case of conflicting specifiers + just return error_mark_node. + + 2007-10-26 Ollie Wild + + * expr.c (cxx_expand_expr): Removed. + * cp-tree.h (exx_expand_expr): Removed. + * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr + with c_expand_expr. + + 2007-10-25 Paolo Carlini + + PR c++/33843 + * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR. + + 2007-10-23 Jason Merrill + + PR c++/25950 (DR 391) + * call.c (struct conversion): Remove check_copy_constructor_p. + (reference_binding): Always bind a reference directly to a + compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during + temporary creation. + (check_constructor_callable): Remove. + (convert_like_real): Don't call it. + (initialize_reference): Don't call check_constructor_callable. + (standard_conversion): Check LOOKUP_NO_CONVERSION instead of + LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base + conversions if LOOKUP_NO_TEMP_BIND. + (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND. + (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for + second conversion. + * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove. + + 2007-10-22 Jakub Jelinek + + PR c++/33372 + * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p + before checking if its type is integral. + + 2007-10-22 Jason Merrill + + PR c++/33620 + * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES. + * pt.c (apply_late_template_attributes): Splice out dependent + attributes from DECL_ATTRIBUTES. + + * decl.c (cxx_maybe_build_cleanup): Use build_address. + + 2007-10-17 Manuel Lopez-Ibanez + + * typeck.c (build_binary_op) : Use appropriate warning option + instead of unnamed warning. + + 2007-10-16 Paolo Carlini + + PR c++/31446 + * pt.c (current_template_args): Do not change TREE_LIST elements + with a TREE_VALUE of error_mark_node. + + 2007-10-16 Mark Mitchell + + * typeck.c (cp_apply_type_quals_to_decl): Expand documentation. + * decl.c (start_decl): Tidy. + (start_decl_1): Call cp_apply_type_quals_to_decl after completing + the type. + (grokdeclarator): Clarify comment. + + 2007-10-14 Andrew Pinski + + PR c++/30303 + * decl.c (grokfndecl): Return NULL after the "definition of + implicitly-declared" error happened. + + 2007-10-12 Simon Martin + + PR c++/26698 + * call.c (build_user_type_conversion_1): Do not consider conversion + functions to convert a (possibly cv-qualified) object to the (possibly + cv-qualified) same object type (or a reference to it), to a (possibly + cv-qualified) base class of that type (or a reference to it). + + 2007-10-12 Paolo Carlini + + * pt.c (tsubst): Use template_parm_level_and_index. + + 2007-10-12 Jakub Jelinek + + PR c++/32121 + * parser.c (cp_parser_compound_statement): Handle label-declarations + at the beginning of the compound statement. + (cp_parser_block_declaration): Issue diagnostics about __label__ + not at the beginning of a block. + + 2007-10-11 Paolo Carlini + + PR c++/33461 + * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node + to convert_template_argument. + (coerce_template_parms): Return error_mark_node after fixed-length + error. + (tsubst_decl): Check for error_mark_node the return value of the + first tsubst in 'case VAR_DECL'. + + 2007-10-08 Ollie Wild + + * typeck2.c (digest_init): Call cplus_expand_constant after + convert_for_initialization. + * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed. + * expr.c (cplus_expand_constant): Updated function description. + + 2007-10-04 Jason Merrill + + PR c++/20416 + * call.c (initialize_reference): Handle local static reference + temps properly. + + 2007-10-03 Jason Merrill + + PR c++/32470 + * name-lookup.c (push_namespace_with_attrs): Fold back into... + (push_namespace): Here. + (handle_namespace_attrs): New fn for the attr code. + (leave_scope): Don't pop_visibility. + * name-lookup.h (struct cp_binding_level): Remove has_visibility. + * parser.c (cp_parser_namespace_definition): Call + handle_namespace_attrs and pop_visibility as appropriate. + + PR c++/11756 + * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry. + + 2007-10-03 Alexandre Oliva + + * decl.c (duplicate_decls): Preserve linkage flags for mere + redeclarations of gnu_inline definitions. + + 2007-10-03 Jason Merrill + + PR c++/15764 + * decl.c (wrap_cleanups_r): New fn. + (wrap_temporary_cleanups): New fn. + (initialize_local_var): Call it. + + 2007-09-29 Jason Merrill + + PR c++/33094 + * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member + constant to not have DECL_EXTERNAL if it's file-local. + + 2007-09-28 Ollie Wild + + Revert + 2007-09-27 Ollie Wild + + * typeck2.c (digest_init): Call cplus_expand_constant after + convert_for_initialization. + * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed. + * expr.c (cplus_expand_constant): Updated function description. + + 2007-09-28 Jason Merrill + + PR c++/10179 + * class.c (layout_empty_base): Take rli parameter, update + rli->record_align if empty base has user-specified alignment. + (build_base_field): Pass rli to it. + + 2007-09-28 Paolo Carlini + + PR c++/33213 + * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION. + + 2007-09-28 Paolo Carlini + + PR c++/33118 + * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT. + (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK. + (dump_parameters): Just call dump_type for argument packs too. + + 2007-09-28 Jakub Jelinek + + PR c++/31434 + * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION + qualification by creating qualified PACK_EXPANSION_PATTERN and + then calling make_pack_expansion on it. + + 2007-09-27 Ollie Wild + + * typeck2.c (digest_init): Call cplus_expand_constant after + convert_for_initialization. + * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed. + * expr.c (cplus_expand_constant): Updated function description. + + 2007-09-27 Jason Merrill + + PR c++/33571 + * decl2.c (is_late_template_attribute): Don't crash on unknown + attribute. + + 2007-09-27 Paolo Carlini + + PR c++/33493 + * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR. + * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing + spaces in the formatting. + * cxx-pretty-print.h (pp_cxx_delete_expression): Declare. + + 2007-09-27 Jakub Jelinek + + * error.c (cxx_print_error_function): Add third argument, pass + it over to lhd_print_error_function. + (cp_print_error_function): If diagnostic->abstract_origin, print + virtual backtrace. + * cp-tree.h (struct diagnostic_info): New forward decl. + (cxx_print_error_function): Add third argument. + + 2007-09-25 Simon Martin + + PR c++/33207 + * name-lookup.c (pushtag): Do not create an implicit typedef before + the associated type declaration is known to be valid. + + 2007-09-25 Jakub Jelinek + + * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids + rather than pointers. + + 2007-09-24 Danny Smith + + PR c++/14688 + * search.c (check_final_overrider): Fail if + targetm.comp_type_attributes returns 0. + + 2007-09-24 Jason Merrill + + PR c++/33239 + * pt.c (resolve_typename_type): Don't look things up in the original + template if it would mean losing template arguments. + + 2007-09-24 Jakub Jelinek + + PR c++/33506 + * cp-tree.h (cxx_type_hash_eq): New prototype. + * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine. + * tree.c (cxx_type_hash_eq): New function. + + 2007-09-24 Douglas Gregor + + PR c++/33185 + * tree.c (cp_build_qualified_type_real): Build a canonical + ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type. + + 2007-09-24 Douglas Gregor + + PR c++/33112 + PR c++/33185 + * tree.c (cplus_array_compare): Compare pointers, not types. + (build_cplus_array_type_1): Store new array type into the hash + table before building the canonical type; build the canonical type + correctly. + (cp_build_qualified_type_real): Put all of the array types with + cv-qualified element types into the C++ array hash table, built as + variants of the unqualified versions. + + 2007-09-23 Jason Merrill + + PR c++/16370 + * decl.c (grokdeclarator): Look through implicit TYPE_DECLs + for deprecation warnings. + + 2007-09-22 Jason Merrill + + PR c++/15269 + * call.c (build_over_call): Warn about deprecated virtuals. + + PR c++/19407 + * cp-tree.h (ATTR_IS_DEPENDENT): New macro. + (MAYBE_TAGGED_TYPE_P): Remove. + * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT + instead of calling is_late_template_attribute again. + (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag. + (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL. + Don't crash on typedefs from non-template classes. + * decl2.c (grokfield): Don't sorry about attrs on template parms. + (is_late_template_attribute): All attributes applied to template + parms or typename types are dependent. Static. + (splice_template_attributes): Pass decl through. + (save_template_attributes): Likewise. + + 2007-09-20 Jakub Jelinek + + PR c++/33496 + * pt.c (tsubst_copy) : Handle error_mark_node + returned from tsubst_pack_expansion. + (tsubst_copy_and_build) : Likewise. + (tsubst_copy_and_build) : Likewise. + + 2007-09-20 Paolo Carlini + + PR c++/33460 + * semantics.c (finish_id_expression): Use consistently + context_for_name_lookup. + * decl.c (fixup_anonymous_aggr): Fix error message for + anonymous struct (vs union). + + 2007-09-19 Jason Merrill + + PR c++/7586 + * pt.c (tsubst): Handle typedefs by looking for the specialization. + (retrieve_specialization): Only tagged types use + DECL_TEMPLATE_INSTANTIATIONS. + (instantiate_class_template): Push nested classes too. + (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for + tagged types. + * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro. + * init.c (is_aggr_type): Remove redundant tests. + * class.c (push_nested_class): Use CLASS_TYPE_P. + + 2007-09-20 Paolo Carlini + + PR c++/33459 + * init.c (build_zero_init): If, recursively, build_zero_init + returns a NULL_TREE, do not append it to the VEC of constructors. + + 2007-09-18 Jason Merrill + + PR c++/17743 + * pt.c (apply_late_template_attributes): Set processing_template_decl. + (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass + ATTR_FLAG_TYPE_IN_PLACE. + (tsubst): Do unqualified lookup to find typedefs from current class. + [ARRAY_TYPE]: Propagate alignment info. + * decl2.c (is_late_template_attribute): Only defer handling of + attribute aligned if the expression is dependent. + (save_template_attributes): If we're deferring any attributes, + make this a naming typedef. + + 2007-09-18 Paolo Carlini + + PR c++/33462 (again) + * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print + va_arg instead of __builtin_va_arg. + + 2007-09-18 Paolo Carlini + + PR c++/33462 + * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add. + (pp_cxx_primary_expression): Use it. + * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare. + * error.c (dump_expr): Use it. + + 2007-09-18 Paolo Carlini + + PR c++/33463 + * cxx-pretty-print.c (pp_cxx_postfix_expression): Split + out case TYPEID_EXPR to... + (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren + and pp_cxx_right_paren. + * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare. + * error.c (dump_expr): Use it. + + 2007-09-18 Paolo Carlini + + PR c++/33464 + * cxx-pretty-print.c (pp_cxx_trait_expression): Add. + (pp_cxx_primary_expression): Use it. + * cxx-pretty-print.h (pp_cxx_trait_expression): Declare. + * error.c (dump_expr): Use it. + + 2007-09-16 Paolo Carlini + + PR c++/33124 + * init.c (build_new): Remove warning for zero-element + allocations. + + 2007-09-16 Nathan Sidwell + + PR c++/32756 + * call.c (maybe_handle_implicit_object): Set this_p, clear + rvaluedness_matches_p. + (compare_ics): Do not compare rvaluedness matching when one of the + operands is an implicit object. + + 2007-09-14 Jason Merrill + + PR c++/17743, c++/19163 + * decl2.c (is_late_template_attribute): New fn. + (splice_template_attributes, save_template_attributes): New fns. + (cplus_decl_attributes): Call save_template_attributes. + * pt.c (apply_late_template_attributes): New fn. + (instantiate_class_template, tsubst_decl): Use it. + * cp-tree.h: Declare is_late_template_attribute. + + 2007-09-13 Tom Tromey + + * parser.c (cp_lexer_new_main): Don't use + c_lex_return_raw_strings. + (cp_lexer_get_preprocessor_token): Update. Add special case when + lexer is NULL. + + 2007-09-11 Jan Hubicka + + * method.c (use_thunk): Use tree_rest_of_compilation + * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill. + (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define. + * cp-tree.h (expand_body): Kill. + (emit_associated_thunks): Declare. + * semantics.c (emit_associated_thunks): Export. + (expand_body): Kill. + + 2007-09-09 David Daney + + PR c++/33324 + * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR + to calculate cookie_ptr. + + 2007-09-08 Jason Merrill + + PR c++/33342 + * pt.c (most_specialized_class): Set processing_template_decl + while tsubsting partial spec args. + + 2007-09-06 Jason Merrill + + * decl2.c (get_guard): Copy visibility from the guarded variable. + + 2007-09-06 Jan Hubicka + + * semantics.c (expand_body): Do not mark arguments of clones used. + + 2007-09-06 Paolo Carlini + + PR c++/32674 + * decl.c (cp_finish_decl): When processing_template_decl, + deal correctly with init as TREE_LIST. + + 2007-09-06 Tom Tromey + + * decl.c (finish_function): Put return's location on line zero of + file. + + 2007-09-05 Jason Merrill + + PR c++/15745 + * except.c (prepare_eh_type): Use type_decays_to. + + PR c++/15097 + * init.c (build_delete): Use build_headof to get the address of the + complete object if we aren't using the deleting destructor. + * rtti.c (build_headof): No longer static. + * cp-tree.h: Declare it. + + 2007-09-06 Jakub Jelinek + + * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX + decl if a prototype for XX is provided with throw(). + + PR c++/33289 + * decl.c (builtin_function_1): Set DECL_ANTICIPATED also + on __*_chk non-__builtin_* decls. + + 2007-09-05 Paolo Carlini + + PR c++/30302 + * semantics.c (finish_id_expression): Use context_for_name_lookup + insted of DECL_CONTEXT, to see through anonymous structs and unions. + * class.c (finish_struct_anon): Deal correctly with anonymous + structs (vs unions, as GNU extension) in error messages. + + 2007-09-05 Jan Hubicka + + * sematics.c (expand_body): Remove unnecesary import_export_decl + call, DECL_EXTERNAL checks and current_function_decl saving. + + 2007-09-05 Paolo Carlini + + PR c++/29731 (again) + * parser.c (cp_parser_primary_expression): Return error_mark_node + when a statement-expression is found in a template-argument list. + + 2007-09-04 Jason Merrill + + * except.c (initialize_handler_parm): Use + fold_build_cleanup_point_expr. + + PR c++/31419 + * call.c (reference_binding): Don't look for user-defined conversions + to the same type. + + PR c++/31411 + * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside + the MUST_NOT_THROW_EXPR. + + 2007-09-04 Richard Sandiford + + * decl.c (cp_finish_decl): Call determine_visibility before + make_rtl_for_nonlocal_decl. + + 2007-09-04 Jason Merrill + + PR c++/14032 + * pt.c (most_specialized_class): Substitute outer template + arguments into the arguments of a member template partial + specialization. + (strip_innermost_template_args): New fn. + + 2007-09-03 Daniel Jacobowitz + + * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB. + + 2007-09-03 Kaveh R. Ghazi + + * call.c (name_as_c_string): Supply a TYPE for CONST_CAST. + * decl.c (cp_make_fname_decl): Likewise, + * parser.c (cp_parser_string_literal): Likewise, + * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE. + * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): + Likewise, + + 2007-09-02 Paolo Carlini + + PR c++/33208 + * typeck.c (build_unary_op): Fix error message for + Boolean expression as operand to operator--. + + 2007-09-01 Kaveh R. Ghazi + + * tree.c (pod_type_p, zero_init_p): Use strip_array_types. + * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): + Likewise. + + 2007-08-31 Douglas Gregor + + PR c++/32597 + * init.c (build_default_init): Make extern. + * cp-tree.h (build_default_init): Declare here. + * pt.c (tsubst_expr): When the instantiation of the initializer of + a variable results in an empty list, default-initialize the + variable. + (tsubst_copy_and_build): When the instantiation of the initializer + in a new expression results in an empty initializer list, + default-initialize it. + + 2007-08-31 Douglas Gregor + + * mangle.c (write_type): Change mangling of rvalue reference from + `RR' to `O'. + + 2007-08-31 Jakub Jelinek + + * decl.c (duplicate_decls): Remove duplicated line. + + 2007-08-31 Paolo Carlini + + PR c++/33210 + * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with + BOUND_TEMPLATE_TEMPLATE_PARM. + + 2007-08-31 Paolo Carlini + + PR c++/32113 + * search.c (lookup_member): Check the name argument for + error_mark_node. + + 2007-08-31 Paolo Carlini + + PR c++/33212 + * parser.c (cp_parser_trait_expr): Check rerurn value of + cp_parser_type_id. + + 2007-08-30 Ollie Wild + + * cvt.c (cp_convert_to_pointer): Remove force parameter. Call + convert_ptrmem for pointer to member conversions. + (convert_to_pointer_force): Update cp_convert_to_pointer call. + (ocp_convert): Update cp_convert_to_pointer call. + * typeck.c (convert_ptrmem): Add conditional for null pointers to + members. + (build_static_cast_1): Check can_convert for conversions in either + direction. + (get_delta_difference_1): New function. + (get_delta_difference): Refactor to call get_delta_difference_1. + + 2007-08-30 Jakub Jelinek + + * decl.c (start_preparsed_function): Set + DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions. + + 2007-08-28 Paolo Carlini + + PR c++/33209 + * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and + BOUND_TEMPLATE_TEMPLATE_PARM. + + 2007-08-28 Jakub Jelinek + + PR c++/32596 + PR c++/32400 + * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN + and DECL_NOT_REALLY_EXTERN if tmpl_func is not public. + + 2007-08-27 Jason Merrill + + PR c++/29000 + * pt.c (build_non_dependent_expr, type_dependent_expression_p): + Look inside STMT_EXPR. + * semantics.c (stmt_expr_value_expr): New fn. + * cp-tree.h: Declare it. + + PR c++/28558 + * decl.c (groktypename): Ignore attributes applied to class type. + + 2007-08-28 Richard Guenther + + * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS. + + 2007-08-28 Gabriel Dos Reis + + * error.c (dump_expr): Handle COMPLEX_CST. + * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise. + (pp_cxx_expression): Likewise. + + 2007-08-27 Alexandre Oliva + + * decl.c (GNU_INLINE_P): New. + (duplicate_decls): Handle gnu_inline. Merge attributes and + some flags in overriding definitions. + (redeclaration_error_message): Handle gnu_inline. + (start_preparsed_function): Likewise. + + 2007-08-25 Kaveh R. Ghazi + + * call.c (sufficient_parms_p): Constify. + * class.c (same_signature_p): Likewise. + * cp-gimplify.c (is_invisiref_parm, + cxx_omp_privatize_by_reference): Likewise. + * cp-objcp-common.c (has_c_linkage): Likewise. + * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK, + sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p, + grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for, + num_artificial_parms_for, comp_template_parms, + template_parameter_pack_p, any_dependent_template_arguments_p, + any_type_dependent_arguments_p, any_value_dependent_elements_p, + repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p, + zero_init_p, member_p, cp_lvalue_kind, + builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p, + varargs_function_p, is_dummy_object, special_function_kind, + string_conv_p, type_unknown_p, comp_except_specs, compparms, + comp_cv_qualification, is_bitfield_expr_with_lowered_type, + unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly, + cp_has_mutable_p, at_least_as_qualified_p, + invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise. + * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise. + * except.c (nothrow_libfn_p): Likewise. + * method.c (skip_artificial_parms_for, num_artificial_parms_for): + Likewise. + * pt.c (comp_template_parms, template_parameter_pack_p, + any_type_dependent_arguments_p, any_value_dependent_elements_p, + any_dependent_template_arguments_p): Likewise. + * repo.c (repo_export_class_p): Likewise. + * semantics.c (anon_aggr_type_p): Likewise. + * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p, + builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p, + varargs_function_p, member_p, is_dummy_object, pod_type_p, + zero_init_p, special_function_p): Likewise. + * typeck.c (comp_array_types, type_unknown_p, comp_except_specs, + comp_array_types, at_least_as_qualified_p, comp_cv_qualification, + compparms, invalid_nonstatic_memfn_p, + is_bitfield_expr_with_lowered_type, unlowered_expr_type, + string_conv_p, ptr_reasonably_similar, cp_type_readonly, + cp_has_mutable_p, lvalue_or_else): Likewise. + + 2007-08-25 Paolo Bonzini + + * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case. + * cp-objcp-common.c (cp_tree_size): Ditto. + * tree.c (cp_walk_subtrees): Ditto + * cp-tree.def (TINST_LEVEL): Go away. + * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level, + move together with other non-tree structs. + (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL. + (union lang_tree_node): Eliminate tinst_level field. + (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate. + (current_instantiation, outermost_tinst_level): Return + a "struct tinst_level *". + + * error.c (print_instantiation_partial_context): Change second + parameter to a "struct tinst_level *". Replace accessor macros + with field access. + (print_instantiation_full_context): Likewise. + * lex.c (in_main_input_context): Likewise. + + * pt.c (struct pending_templates): New. + (pending_templates, last_pending_template): Use it as a type. + (current_tinst_level): Change typo to "struct tinst_level *" + (reopen_tinst_level): Accept "struct tinst_level *", return decl. + (add_pending_template): Construct a "struct pending_template". + Replace TINST_LEVEL accessor macros with field access. + (push_tinst_level): Likewise, using GGC_NEW instead of make_node. + (pop_tinst_level): Likewise. + (instantiate_pending_templates): Likewise. Factor common code used + when an instantiation has been done. + (outermost_tinst_level): Replace tree_last with loop. + (current_instantiation): Return a "struct tinst_level *". + + 2007-08-24 Ollie Wild + + * name-lookup.c (add_decl_to_level): Remove addition to vtables chain. + * name-lookup.h (cp_binding_level): Remove vtables member. + + 2007-08-24 Richard Guenther + + * tree.c (cp_cannot_inline_tree_fn): Remove. + * cp-tree.h (cp_cannot_inline_tree_fn): Likewise. + * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN): + Remove define. + + 2007-08-24 Jakub Jelinek + + PR c++/32567 + * typeck.c (build_unary_op) : Return + error_mark_node right away if build_expr_type_conversion + returned it. + + PR c++/32898 + * name-lookup.c (set_decl_namespace): lookup_qualified_name failure + is error_mark_node rather than NULL_TREE. + * pt.c (check_explicit_specialization): Likewise. + + PR c++/31941 + * error.c (resolve_virtual_fun_from_obj_type_ref): Handle + TARGET_VTABLE_USES_DESCRIPTORS targets properly. + + 2007-08-22 Jason Merrill + + PR c++/29365 + * pt.c (outermost_tinst_level): New function. + * lex.c (in_main_input_context): New function. + * cp-tree.h: Declare it. + * decl2.c (constrain_class_visibility): Use it to avoid warning + about uses of the anonymous namespace in the main input file. + + 2007-08-21 Jakub Jelinek + + * init.c (build_new_1): Use get_target_expr instead of save_expr. + + 2007-08-20 Pawel Sikora + + PR c++/7302 + * class.c (finish_struct_1): Warn when a class has virtual + functions and accessible non-virtual destructor. + + 2007-08-20 Richard Guenther + + PR c++/22369 + PR c++/22451 + * call.c (build_new_method_call): Convert initializer to + the basetype. + * init.c (build_aggr_init): Do not fiddle with types. + (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR. + * except.c (build_throw): Do not drop qualifiers for the + pointer type. + * typeck.c (get_member_function_from_ptrfunc): Do not + fiddle with types, instead convert. + (build_ptrmemfunc1): Convert to the target type for + initialization. + (gfc_trans_allocate): Convert result to target type. + * cp-objcp-common.c (cxx_get_alias_set): Pointers to + pointer-to-member structures shall have alias set zero as well. + + 2007-08-20 Richard Guenther + + * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): + Remove. + * cp-tree.h (cp_auto_var_in_fn_p): Remove. + (nonstatic_local_decl_p): Likewise. + * tree.c (cp_auto_var_in_fn_p): Remove. + * decl.c (nonstatic_local_decl_p): Remove. + + 2007-08-20 Richard Guenther + + * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): + Remove define. + * tree.h (cp_walk_tree): New define to walk_tree_1 with + cp_walk_subtrees lh parameter. + (cp_walk_tree_without_duplicates): New define to + walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter. + * tree.c (count_trees): Call + cp_walk_tree_without_duplicates. + (verify_stmt_tree): Call cp_walk_tree. + (break_out_target_exprs): Likewise. + (WALK_SUBTREE): Likewise. + * cp-gimplify.c (cp_genericize): Likewise. + * cp-pt.c (find_parameter_packs_r): Likewise. + (uses_parameter_packs): Likewise. + (make_pack_expansion): Likewise. + (check_for_bare_parameter_packs): Likewise. + (for_each_template_parm): Likewise. + * decl.c (check_default_argument): Call + cp_walk_tree_without_duplicates. + * except.c (build_throw): Likewise. + * decl2.c (type_visibility): Likewise. + * semantics.c (expand_or_defer_fn): Likewise. + (finalize_nrv): Call cp_walk_tree. + + 2007-08-20 Jakub Jelinek + + PR c++/33025 + * init.c (build_new_1): Rename placement_var variable to placement_expr. + Initialize it with save_expr rather than get_temp_regvar. + + 2007-08-17 Andrew Pinski + + PR c++/28989 + * tree.c (lvalue_p_1 ): SAVE_EXPRs are never + lvalues. + + 2007-08-17 Ollie Wild + + PR c++/31749 + * name-lookup.c (do_nonmember_using_decl): Shift implicit type + declarations into appropriate slots for comparison. Fix type + comparison. + + 2007-08-17 Paolo Carlini + + PR c++/32112 + * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE. + * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise. + + 2007-08-17 Paolo Carlini + + PR c++/32870 + * parser.c (cp_parser_class_head): Improve error message. + + 2007-08-16 Seongbae Park + + * pt.c (instantiate_decl): Set input_location + for the function end. + + 2007-08-16 Kaveh R. Ghazi + + * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size): + Constify. + * cp-tree.h (local_variable_p, nonstatic_local_decl_p, + class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals, + cxx_incomplete_type_diagnostic, cxx_incomplete_type_error, + cxx_warn_unused_global_decl, cp_expr_size): Likewise. + * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise. + * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise. + * typeck.c (cp_type_quals): Likewise. + * typeck2.c (cxx_incomplete_type_diagnostic, + cxx_incomplete_type_error): Likewise. + + 2007-08-16 Paolo Carlini + + PR c++/31132 + * pt.c (tsubst_friend_function): When check_classfn + returns error_mark_node likewise return it. + + 2007-08-15 Jakub Jelinek + + PR c++/32992 + * typeck.c (check_return_expr): Don't NRV optimize vars in + anonymous unions. + * decl.c (finish_function): Comment fix. + + 2007-08-15 Paolo Carlini + + PR c++/33035 + * pt.c (push_template_decl_real): Depending on TYPE_P + use either TYPE_CONTEXT or DECL_CONTEXT. + + 2007-08-14 Mark Mitchell + + * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if + constructors and destructors return this. + + 2007-08-14 Paolo Carlini + + PR c++/27211 + * decl2.c (check_classfn): Return error_mark_node in case of error; + in that case, do not call add_method. + * decl.c (start_decl): Deal with check_classfn returning + error_mark_node. + (grokfndecl): Likewise. + * pt.c (tsubst_friend_function): Likewise. + + 2007-08-14 Andrew Pinski + + PR c++/30428 + * typeck.c (build_binary_op): Disallow vector float types with + BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR. + + 2007-08-11 Ian Lance Taylor + + * cp-objcp-common.c (cxx_get_alias_set): Change return type to + alias_set_type. + * cp-tree.h (cxx_get_alias_set): Update declaration. + + 2007-08-10 Ollie Wild + + * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous + type lookups. + (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous + function parameter. + (unqualified_namespace_lookup): Fix ambiguous_decl call. + (lookup_using_namespace): Fix ambiguous_decl call. + (qualified_lookup_using_namespace): Fix ambiguous_decl call. + + 2007-08-10 Kaveh R. Ghazi + + * call.c (name_as_c_string): Use CONST_CAST. + * decl.c (build_decl): Likewise. + * parser.c (cp_parser_string_literal): Likewise. + + 2007-08-10 Paolo Carlini + + PR c++/17763 + * error.c (dump_expr): Consistently use the *_cxx_* + variants of the pretty-print functions. + + 2007-08-10 Paolo Carlini + + PR c++/22256 + * decl.c (check_special_function_return_type): Just error + on return type specified for conversion operator. + + 2007-08-09 Daniel Berlin + + * typeck2.c (readonly_error): Handle general expressions. + * error.c (dump_expr): Handle POINTER_PLUS_EXPR + + 2007-08-06 Dan Hipschman + + * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to + access function name. + + 2007-08-04 Alfred Minarik + + PR pch/13676 + * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header. + * g++spec.c (lang_specific_driver): Check them. + + 2007-08-06 Paolo Carlini + + PR c++/19532 + * pt.c (inline_needs_template_parms): Fix comment; change return type + to bool. + + 2007-08-05 Volker Reichelt + + Revert: + 2007-03-26 Dirk Mueller + + * parser.c (cp_parser_member_declaration): Pedwarn + about stray semicolons after member declarations. + + 2007-08-02 Lee Millward + + PR c++/30849 + PR c++/30850 + PR c++/30851 + * parser.c (cp_parser_asm_definition): Detect and discard asm + statements with invalid inputs or outputs. + (cp_parser_asm_operand_list): Return error mark node if any + of the operands are invalid. Adjust documentation. + + 2007-08-02 Nick Clifton + + * typeck.c: Change copyright header to refer to version 3 of the + GNU General Public License and to point readers at the COPYING3 + file and the FSF's license web page. + * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, + config-lang.in, cp-tree.def, call.c, decl.h, ptree.c, + Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c, + cp-objcp-common.h, except.c, error.c, operators.def, cvt.c, + tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c, + cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c, + cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c, + name-lookup.h, parser.c: Likewise. + + 2007-08-01 Kaveh R. Ghazi + + PR middle-end/32668 + * call.c (magic_varargs_p): Honor the "type generic" attribute. + + 2007-07-30 Paolo Carlini + + PR c++/32108 + * semantics.c (finish_label_stmt): Reject the __label__ + extension outside function scopes. + + 2007-07-29 Kaveh R. Ghazi + + * parser.c (eof_token): Un-constify. + (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc, + cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious + casts. + + 2007-07-28 Kazu Hirata + + * pt.c, tree.c, typeck2.c: Fix comment typos. + + 2007-07-28 Simon Martin + Mark Mitchell + + PR c++/30917 + * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be + hidden due to friend declarations in local classes. + + 2007-07-27 Douglas Gregor + + * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. + * cp-tree.def (DECLTYPE_TYPE): New. + * error.c (dump_type): Dump DECLTYPE_TYPE nodes. + (dump_type_prefix): Ditto. + (dump_type_suffix): Ditto. + * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes. + * mangle.c (write_type): Handle DECLTYPE_TYPE. + * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate + types. + (DECLTYPE_TYPE_EXPR): New. + (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New. + (finish_declared_type): Declare. + * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print + DECLTYPE_TYPE nodes. + (pp_cxx_type_id): Ditto. + * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children. + (tsubst): Substitute into a DECLTYPE_TYPE node. + (tsubst_copy): Ditto. + (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE + nodes. + (dependent_type_p_r): DECLTYPE_TYPE types are always dependent. + * semantics.c (finish_typeof): TYPEOF_TYPE types need to use + structural equality (because we can't hash the expressions). + (finish_declared_type): New. + * lex.c (reswords): Add "decltype" keyword. + * parser.c cp_lexer_next_token_is_decl_specifier_keyword + (cp_parser_postfix_expression): Add member_access_only_p to + restrict postfix expression to member access expressions. + (cp_parser_unary_expression): Update call to + cp_parser_postfix_expression to reflect new parameter. + (cp_parser_declared_type): New. + (cp_parser_simple_type_specifier): Parse decltype types. + + 2007-07-27 Mark Mitchell + + PR c++/32346 + * call.c (convert_for_arg_passing): Only widen bitfields to their + declared types if necessary. + + 2007-07-25 Kaveh R. Ghazi + + * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand): + Constify. + + 2007-07-25 Kaveh R. Ghazi + + * decl.c (typename_hash, typename_compare): Constify. + * mangle.c (hash_type, compare_type): Likewise. + * pt.c (eq_local_specializations, hash_local_specialization): + Likewise. + * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq, + list_hash): Likewise. + * typeck2.c (pat_compare): Likewise. + + 2007-07-24 Nathan Sidwell + + * method.c (implicitly_declare_fn): Increase alignment if member + function pointer format requires it. + + 2007-07-24 Paolo Carlini + + PR c++/29001 + * typeck.c (check_return_expr): Do not pass a null argument + to null_ptr_cst_p. + + 2007-07-24 Paolo Carlini + + PR c++/32561 + * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P + only on VAR_DECL. + + 2007-07-22 Nathan Sidwell + + PR c++/32839 + * typeck.c (convert_arguments): Only use default args if we have + a function decl. + + PR c++/30818 + * typeck.c (structural_comptypes): No need to check + resolve_typename_type return value here. + * cp-tree.h (TYPENAME_IS_RESOLVING_P): New. + * pt.c (resolve_typename_type): Follow typename typedefs. Return + original type rather than error_mark_node in case of failure. + * parser.c (cp_parser_nested_name_specifier_opt): Adjust + resolve_typename_type result check. + (cp_parser_direct_declarator, cp_parser_head, + cp_parser_constructor_declarator_p): Likewise. + + 2007-07-12 Kazu Hirata + + * pt.c (template_parms_variadic_p): Remove. + * cp-tree.h: Remove the prototype for template_parms_variadic_p. + + 2007-07-12 Jakub Jelinek + + PR c++/30854 + * error.c (dump_expr) : Pass true as last + argument to dump_aggr_init_expr_args instead of false. + + 2007-07-11 Douglas Gregor + + * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the + canonical types; otherwise, fall back to structural type + comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an + internal compiler error if the canonical types are wrong. + + 2007-07-11 Paolo Carlini + + PR c++/32560 + * parser.c (cp_parser_make_indirect_declarator): When the + the code argument is ERROR_MARK return cp_error_declarator. + + 2007-07-09 Geoffrey Keating + + PR 32617 + * decl.c (cxx_init_decl_processing): Don't set + force_align_functions_log. + (grokfndecl): Honour ptrmemfunc_vbit_in_pfn. + * typeck.c (cxx_alignof_expr): When alignof is used on a plain + FUNCTION_DECL, return its alignment. + + 2007-07-09 Richard Guenther + + * decl.c (start_preparsed_function): Do not promote return type. + + 2007-07-08 Paolo Carlini + + PR c++/30535 + * pt.c (unify): Never pass error_mark_node to template_decl_level. + + 2007-07-07 Mark Mitchell + + PR c++/32232 + * pt.c (resolve_overloaded_unification): Robustify. Return a + bool, not an int. + (type_unification_real): Adjust accordingly. + + 2007-07-06 Richard Guenther + + * init.c (build_new_1): Use the correct pointer type. + * typeck2.c (build_m_component_ref): Likewise. + + 2007-07-05 Mark Mitchell + + PR c++/32245 + * init.c (build_zero_init): Always build an initializer for + non-static storage. + * typeck2.c (build_functional_cast): Use build_zero_init. + + PR c++/32251 + * init.c (build_new_1): Always pass the allocation function to + build_op_delete_call. + * call.c (build_op_delete_call): Handle operator delete with a + variable-argument list. Do not issue an error when no matching + deallocation function is available for a new operator. + + PR c++/31992 + * cp-tree.h (any_value_dependent_elements_p): Declare it. + * decl.c (value_dependent_init_p): New function. + (cp_finish_decl): Use it. + * pt.c (value_dependent_expression_p): Use + any_value_dependent_elements_p. + * parser.c (cp_parser_primary_expression): Add comment about + treating dependent qualified names as integral + constant-expressions. + + 2007-07-04 Douglas Gregor + + * decl.c (build_ptrmemfunc_type): Always use structural equality + tests when comparing pointer-to-member-function types, because the + handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical + types. + + 2007-07-03 Mark Mitchell + + * init.c (build_new): Tweak comment. + + 2007-06-29 Dave Brolley + + PR c++/31743 + * parser.c (cp_parser_new_type_id): Don't reduce a named array + type to its base type and number of elements here. + * init.c (build_new): Call complete_type_or_else to ensure that the + type is complete and to issue a diagnostic if it is not. + (build_new_1): Don't call complete_type_or_else here. + + 2007-07-03 Richard Guenther + + PR c++/32609 + * class.c (fixed_type_or_null): Re-lookup the hashtable slot + after recursing. + + 2007-07-02 Simon Baldwin + + * parser.c (cp_parser_elaborated_type_specifier): Added a warning + for inner-style nested forward declarations that don't declare + anything useful. + + 2007-07-02 Jakub Jelinek + + PR c++/31748 + * semantics.c (finish_omp_clauses): Use %qD instead of %qE for + DECL_P in not a variable and appears more than once error messages. + + 2007-07-01 Ollie Wild + + * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden. + (select_decl): Remove function. + (unqualified_namespace_lookup): Populate binding by calling + ambiguous_decl. Remove select_decl call. + (lookup_qualified_name): Remove select_decl call. + * decl.c (lookup_and_check_tag): Check for ambiguous references. + * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error + generation when name lookup is ambiguous. + + 2007-06-29 Douglas Gregor + + PR c++/31724 + * init.c (build_new_1): Use structural equality on the copy of the + array type. + + 2007-06-28 Geoffrey Keating + + * decl2.c (determine_visibility): Implement + flag_visibility_ms_compat effect on type info. + * decl.c (cxx_init_decl_processing): Implement + global effect of flag_visibility_ms_compat. + + 2007-06-28 Geoffrey Keating + + * decl2.c (start_objects): Mark constructor-running function + as artificial. + + 2007-06-26 Simon Martin + + PR c++/32111 + * decl.c (grokdeclarator): Reset friendp for member functions declared + friend of their own class. + + 2007-06-23 Mark Mitchell + + * decl2.c (determine_visibility): Don't look for dllexport here. + (determine_visibility_from_class): Tidy. + + 2007-06-18 Simon Baldwin + + PR c++/31923 + * parser.c (cp_parser_single_declaration): Added check for storage + class other than sc_none in parsed declaration, and a flag to indicate + if the call is part of an explicit template specialization parse. + * (cp_parser_explicit_specialization): Specialization check flag added + to call to cp_parser_single_declaration(), set true. + * (cp_parser_template_declaration_after_export): Specialization check + flag added to call to cp_parser_single_declaration(), set false. + * pt.c (check_explicit_specialization): Added code to copy visiblity + and linkage from the templated function to the explicit specialization. + + 2007-06-15 Andrew Pinski + + * typeck.c (build_binary_op): For templates build the + expression in pieces to avoid the assert in build2_stat. + (get_member_function_from_ptrfunc): + Change over to using POINTER_PLUS_EXPR and convert + the second operand to sizetype. + * typeck2.c (build_m_component_ref): Likewise. + * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR + instead of PLUS_EXPR for pointers. + (build_new_1): Likewise. + (build_vec_delete_1): Likewise. + (build_vec_delete): Likewise. + * class.c (build_base_path): Likewise. + (build_base_path): Likewise. + (convert_to_base_statically): Likewise. + (fixed_type_or_null): Handle POINTER_PLUS_EXPR. + (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR + instead of PLUS_EXPR. + (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR + instead of PLUS_EXPR for pointers. + * call.c (build_special_member_call): Likewise. + * rtti.c (build_headof): Likewise. + Use sizetype instead of ptrdiff_type_node. + (tinfo_base_init): Create a POINTER_PLUS_EXPR + instead of PLUS_EXPR for pointers. + * except.c (expand_start_catch_block): Do a + NEGATIVE and then a POINTER_PLUS_EXPR instead + of a MINUS_EXPR. + * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert + PLUS_EXPR on pointer types over to use + POINTER_PLUS_EXPR and remove the conversion + to the pointer types. + * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for + adding to a pointer type. Use size_int instead of + ssize_int. Convert the index to sizetype before + adding it to the pointer. + + 2007-06-15 Mark Mitchell + + * cp-tree.h (DECL_VAR_MARKED_P): Remove. + (DECL_ANON_UNION_VAR_P): New macro. + * class.c (fixed_type_or_null): Tidy. Use a hash table, rather + than DECL_VAR_MARKED_P, to keep track of which variables we have + seen. + * decl.c (redeclaration_error_message): Complain about redeclaring + anonymous union members at namespace scope. + * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P. + + 2007-06-14 Geoff Keating + + * decl2.c (determine_visibility): Ensure that functions with + hidden types as parameters are hidden. + + PR 31093 + * decl2.c (determine_visibility): Remove duplicate code for + handling type info. + + 2007-06-12 Ian Lance Taylor + + PR libstdc++/29286 + * init.c (avoid_placement_new_aliasing): New static function. + (build_new_1): Call it. + + 2007-06-11 Rafael Ãvila de Espíndola + + * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove. + (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove. + + 2007-06-08 Jakub Jelinek + + PR c++/32177 + * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr + on init, the non-decl cond operand and increment value. + + 2007-06-07 Simon Martin + + PR c++/30759 + * decl.c (check_initializer): Report an error when a brace enclosed + initializer is used for a non-aggregate type in C++98. + (redeclaration_error_message): Rewrote flag_cpp0x in terms of + cxx_dialect. + (grokdeclarator): Likewise. + (move_fn_p): Likewise. + * typeck.c (check_return_expr): Likewise. + * call.c (reference_binding): Likewise. + * error.c (cp_cpp_error): Likewise. + * pt.c (check_default_tmpl_args): Likewise. + (tsubst): Likewise. + * lex.c (init_reswords): Likewise. + * parser.c (p_parser_primary_expression): Likewise. + (TOKEN_PRECEDENCE): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_ptr_operator): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_enclosed_template_argument_list): Likewise. + (cp_parser_skip_to_end_of_template_parameter_list): Likewise. + (cp_parser_next_token_ends_template_argument_p): Likewise. + + 2007-06-04 Simon Baldwin + + * decl.c (grokdeclarator): Readability change. Moved case labels + into direct switch statement scope. + + 2007-06-04 Paolo Carlini + + * call.c (convert_like_real): Remove pointless code. + + 2007-05-31 Mark Mitchell + + * decl.c (get_atexit_fn_ptr_type): New function. + (get_atexit_node): Use it. + (start_cleanup_fn): Likewise. + (register_dtor_fn): Use the object's destructor, instead of a + separate cleanup function, where possible. + * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator. + (atexit_fn_ptr_type_node): New macro. + * decl2.c (build_cleanup): Use build_address. + + 2007-05-31 Daniel Berlin + + * typeck.c (build_binary_op): Include types in error. + + 2007-05-31 Jakub Jelinek + + PR c++/31806 + * decl.c (cp_finish_decl): Also clear was_readonly if a static var + needs runtime initialization. + + 2007-05-31 Paolo Carlini + + PR c++/32158 + * semantics.c (finish_trait_expr): Complete the types. + + 2007-05-30 Russell Yanofsky + Douglas Gregor + Pedro Lamarao + Howard Hinnant + + PR c++/7412 + PR c++/29939 + * typeck.c (comptypes): Don't consider rvalue and lvalue + reference types to be equivalent. + (check_return_expr): Move from certain lvalues when returning + them. + * decl.c (grokdeclarator): Implement reference collapsing. + (copy_fn_p): Don't consider constructors taking rvalue references + to be copy constructors. + (move_fn_p): New. + * call.c (conversion): New "rvaluedness_matches_p" member. + (convert_class_to_reference): Require reference type as first + parameter instead of base type. + (reference_binding): Add logic to handle rvalue references. + (implicit_conversion): Update inaccurate comment. + (convert_like_real): Disable creation of temporaries that are + impossible to initialize for types with move constructors. + (build_over_call): Elide move constructors when possible. + (maybe_handle_implicit_object): Set "rvaluedness_matches_p". + (maybe_handle_ref_bind): Return conversion instead of type node. + (compare_ics): Add logic to use "rvaluedness_matches_p" values to + determine preferred conversion sequences. + * cp-tree.h (TYPE_REF_IS_RVALUE): New. + (LOOKUP_PREFER_RVALUE): New. + (DECL_MOVE_CONSTRUCTOR_P): New. + (struct cp_declarator): Add "reference" member for reference + types, with new "rvalue_ref" flag. + (cp_build_reference_type): Declare. + (move_fn_p): Declare. + * error.c (dump_type_prefix): Format rvalue reference types + correctly in error messages. + * except.c (build_throw): Move from certain lvalues when + throwing. + * mangle.c (write_type): Mangle rvalue references differently + than regular references. + * parser.c (make_reference_declarator): Add boolean parameter for + rvalue references. + (cp_parser_make_indirect_declarator): New. + (cp_parser_new_declarator_opt): Call + cp_parser_make_indirect_declarator. + (cp_parser_conversion_declarator_opt): Ditto. + (cp_parser_declarator): Ditto. + (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference + declarators. + * pt.c (tsubst): Implement reference collapsing. + (maybe_adjust_types_for_deduction): Implement special template + parameter deduction rule for rvalue references. + (type_unification_real): Update calls to + maybe_adjust_types_for_deduction. + (try_one_overload): Ditto. + (unify_pack_expansion): Ditto. + * tree.c (lvalue_p_1): Handle rvalue reference types. + (cp_build_reference_type): New. + + 2007-05-30 Jakub Jelinek + + PR c++/31809 + * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC + variables that need runtime initialization. + + 2007-05-28 Andrew Pinski + + PR c++/31339 + * typeck.c (build_unary_op ): Return the error_mark_node + if either the real or imaginary parts would an + error_mark_node. + + 2007-05-25 Simon Martin + Manuel Lopez-Ibanez + + PR c++/31745 + * parser.c (cp_parser_skip_to_closing_brace): Return true if the next + token is a closing brace, false if there are no tokens left. + (cp_parser_namespace_alias_definition): Only consume the next token if + it is a closing brace. + + * parser.c (cp_parser_class_specifier): Likewise. + + 2007-05-25 H.J. Lu + + * semantics.c (finish_member_declaration): Fix a typo in the + last checkin. + + 2007-05-25 Douglas Gregor + + PR c++/31431 + PR c++/31432 + PR c++/31434 + PR c++/31435 + PR c++/31437 + PR c++/31438 + PR c++/31442 + PR c++/31443 + PR c++/31444 + PR c++/31445 + * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes. + * cp-tree.h (check_for_bare_parameter_packs): Returns bool. + * pt.c (check_for_bare_parameter_packs): Return bool indicated + whether everything was okay. Fix indentation. + (push_template_decl_real): Check for bare parameter packs in + function parameters; where errors occur, mark the parameter types + with ERROR_MARK_NODEs to avert ICEs. + (coerce_template_parameter_pack): New. + (coerce_template_parms): Moved parameter pack coercion into + coerce_template_parameter_pack, and permit it anywhere in the + template parameter list (not just at the end). Parameter and + argument indices can vary (somewhat) separately now, so add + PARM_IDX and ARG_IDX. + (fn_type_unification): Don't set an argument pack as incomplete if + no argument pack was deduced. + (type_unification_real): If a type parameter is a parameter pack + and has not otherwise been deduced, it will be deduced to an empty + parameter pack. + (more_specialized_fn): Use the actual lengths of the argument + lists when comparing against expansions. + * semantics.c (finish_member_declaration): If a field's type has + bare parameter packs, error and set its type to ERROR_MARK_NODE. + + 2007-05-24 Danny Smith + + PR target/27067 + * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name. + + 2007-05-22 Ollie Wild + + * name-lookup.c (ambiguous_decl): Adds check for hidden types. + (unqualified_namespace_lookup): Adds check for hidden types. + + 2007-05-22 Ollie Wild + + * decl.c (duplicate_decls): Verify namespace names are unique. + + 2007-05-21 Mark Mitchell + + * decl.c (cxx_maybe_build_cleanup): Handle + __attribute__((cleanup)). + + 2007-05-19 Manuel Lopez-Ibanez + + * cvt.c (cp_convert_and_check): Don't check warnings if the + conversion failed. + + 2007-05-18 Geoffrey Keating + + * mangle.c (write_real_cst): Use 'unsigned long' for %lx. + + 2007-05-14 Paolo Carlini + + PR c++/29928 + * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the + type only if is a class type (5.2.8/4). + + 2007-05-14 Rafael Ãvila de Espíndola + + * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove. + * decl.c (grokdeclarator): Use unsigned_type_for instead of + c_common_unsigned_type. + + 2007-05-11 Silvius Rus + + * typeck.c (build_indirect_ref): Add call to + strict_aliasing_warning. + (build_reinterpret_cast_1): Condition call to + strict_aliasing_warning. + + 2007-05-11 Jan Hubicka + + * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn. + * decl2.c (start_objects): ctors and dtors are no longer public. + (cp_write_global_declarations): Do not call c_build_cdtor_fns. + + 2007-05-07 Andrew Pinski + + * typeck.c (build_unary_op): Remove code that used to + handle non lvalue increments/decrements. + + 2007-05-07 Mike Stump + + * parser.c (check_empty_body): Add. + (cp_parser_iteration_statement): Add call to check_empty_body. + + 2007-05-05 Geoffrey Keating + + PR 31775 + * mangle.c (write_mangled_name): Mangle static variable names. + (write_unqualified_name): Use local-source-name for + namespace-scope static variables. + + 2007-05-04 Dirk Mueller + + * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is + not in effect. + + 2007-05-02 Seongbae Park + + PR c++/31663 + * decl2.c (constrain_class_visibility): + Use strip_pointer_or_array_types instead of strip_array_types. + + 2007-04-28 Andrew Pinski + + PR C++/30221 + * decl.c (reshape_init_r): Don't reshape the first element if it + is a pointer to member function. + + 2007-04-27 Simon Baldwin + + * decl.c (grokparms): Changed message format from %qD to %qE. + + 2007-04-27 Douglas Gregor + + * error.c (maybe_warn_variadic_templates): Variadic templates are + now in C++0x, so only warn about them in C++98 mode. + + 2007-04-26 Andrew Pinski + + PR C++/30016 + * typeck.c (build_reinterpret_cast_1): Only allow conversion to + integeral types from vectors types. + + 2007-04-26 Jakub Jelinek + + PR c++/31598 + * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO + for type dependent OMP_CLAUSE_DECLs. + + 2007-04-24 Mark Mitchell + + PR c++/31338 + * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE. + * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as + COMPLEX_TYPE is now an ARITHMETIC_TYPE. + * init.c (build_zero_init): Adjust, as + COMPLEX_TYPE is now a SCALAR_TYPE. + * typeck2.c (digest_init): Allow brace-enclosed initializers for + COMPLEX_TYPE, even though that is now a SCALAR_TYPE. + + 2007-04-25 Paolo Carlini + + * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust + per N2255; rename as classtype_has_nothrow_assign_or_copy_p. + (trait_expr_value): Adjust. + + 2007-04-23 Simon Baldwin + + * decl.c (grokparms): Added new error for duplicate function + parameters names in function prototypes, to match gcc behavior. + + 2007-04-23 Jan Hubicka + + * decl2.c (finish_objects): Do not call target constructor/destructor + bits dirrectly. + + 2007-04-21 Andrew Pinski + + * cp-tree.h (lang_tree_node): Use GENERIC_NEXT + instead of checking GIMPLE_STMT_P in chain_next. + + 2007-04-17 Mark Mitchell + + PR c++/31513 + * call.c (convert_for_arg_passing): Convert bitfields to their + declared types. + + 2007-04-17 Simon Martin + + PR c++/31517 + * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs. + + 2007-04-16 Seongbae Park + + PR c++/29365 + * decl2.c (constrain_class_visibility): + Do not warn about the use of anonymous namespace in the main input file. + + 2007-04-15 Mark Mitchell + + * cp-tree.h (current_template_parms): Fix typo in comment. + + 2007-04-15 Kazu Hirata + + * cp-tree.h, error.c: Fix comment typos. + + 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 + + * 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 + + * 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 + + * 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 + + * 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 + * parser.c (struct cp_parser): New IN_IF_STMT. + (cp_parser_statement_seq_opt): Handle an unexpected 'else', + returning if parsing the body of an 'if' statement or issuing an + error and continuing. + (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing + body of 'if'. + (cp_parser_jump_statement): Mask new IN_IF_STMT bit. + + 2007-03-02 Simon Martin + + PR c++/28253 + * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders + for thunks. + + 2007-03-02 Geoffrey Keating + + * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling + Objective-C++. Don't exit early if -shared-libgcc needs to be + added. + + 2007-03-02 Manuel Lopez-Ibanez + + * typeck.c (common_base_type): Delete unused function. + + 2007-03-01 Brooks Moses + + * Make-lang.in: Add dummy lang.install-pdf target. + + 2007-03-01 Simon Baldwin + + PR c++/23689 + * decl.c (check_tag_decl): Added new warning for typedef ignored + when it precedes an otherwise valid non-typedef declaration. + + 2007-02-28 Sandra Loosemore + + * typeck.c (build_function_call): Store converted arguments + in a stack-allocated array instead of building a list. + (convert_arguments): Store arguments in the array passed in as an + argument, and return the actual number of arguments. + * call.c (build_call): Delete, and replace with... + (build_call_n, build_call_a): New. + (build_op_delete_call): Rewrite to avoid constructing argument lists. + (build_over_call): Store converted arguments in a stack-allocated + array instead of building a list. + (build_cxx_call): Pass arguments in an array instead of as a list. + (build_java_interface_fn_ref): Rewrite to avoid constructing + argument lists. + * tree.h: Update declarations to reflect above changes. + * method.c (use_thunk): Use a stack-allocated array to hold + the arguments instead of a list. + * rtti.c (throw_bad_cast): Update call to cxx_call. + (throw_bad_typeid): Likewise. + (build_dynamic_cast_1): Likewise. + * init.c (build_builtin_delete_call): Use build_call_n. + * decl.c (expand_static_init): Likewise. + * except.c (cp_protect_cleanup_actions): Likewise. + * cp-gimplify.c (genericize_eh_spec_block): Likewise. + (gimplify_must_not_throw_expr): Likewise. + (cxx_omp_apply_fn): Use build_call_a. + + 2007-02-26 Mark Mitchell + + * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn. + * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns. + + 2007-02-25 Mark Mitchell + + * cp-tree.h (static_ctors): Remove. + * cp-tree.h (static_dtors): Likewise. + * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for + refactoring of tree_map hierarchy. + (decl_shadowed_for_var_insert): Likewise. + * semantics.c (expand_body): Use c_expand_body. + (expand_or_defer_fn): Don't update static_ctors or static_dtors. + * decl2.c (static_ctors): Remove. + (static_dtors): Likewise. + (generate_ctor_or_dtor_function): Pass NULL_TREE to + objc_generate_static_init_call. Do not call static_[cd]tors. + (generate_ctor_and_dtor_functions_for_priority): Do not check for + static_[cd]tors. + (cp_write_global_declarations): Likewise. + + 2007-02-23 Richard Guenther + + * class.c (note_name_declared_in_class): Make declaration + changes meaning a pedwarn. + + 2007-02-22 Michael Matz + + PR c++/29433 + * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag. + * error.c (dump_aggr_type, dump_simple_decl, dump_decl, + dump_function_decl): Guard emitting outer scopes by new flag. + * cp-lang.c (cxx_dwarf_name): New function. + (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name. + * pt.c (classtype_mangled_name, mangle_class_name_for_template): + Remove functions. + (push_template_decl_real, lookup_template_class): Remove calls + to above functions. + + 2007-02-19 Mark Mitchell + + * call.c (build_new_method_call): Ensure that explicit calls of + destructors have type "void". + + 2007-02-19 Manuel Lopez-Ibanez + + * typeck.c (build_binary_op): Replace -Wstring-literal-comparison + and -Walways-true with -Waddress. + * cvt.c (convert_to_void): Replace unconditional warning with + -Waddress. + + 2007-02-18 Kazu Hirata + + * decl.c, tree.c: Fix comment typos. + + 2007-02-15 Andrew Pinski + + PR C++/30158 + * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the + statement expression if we had an error mark node. + + 2007-02-15 Sandra Loosemore + Brooks Moses + Lee Millward + + * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. + Change class to tcc_vl_exp. + + * call.c (build_call): Use build_call_list instead + of build3. + (build_over_call): Likewise. + (build_new_method_call): Use build_min_non_dep_call_list + instead of build_min_non_dep. + + * error.c (dump_call_expr_args): New function. + (dump_aggr_init_expr_args): New function. + (dump_expr) : Use them. + Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. + + * cvt.c (convert_to_void): Use build_call_array instead + of build3; use new AGGR_INIT_EXPR accessor macros. + + * mangle.c (write_expression): Use TREE_OPERAND_LENGTH + instead of TREE_CODE_LENGTH. + + * dump.c (cp_dump_tree) : Update to use new + AGGR_INIT_EXPR accessor macros. + + * cp-gimplify.c (cp_gimplify_init_expr): Use + AGGR_INIT_EXPR_SLOT to set the slot operand. + + * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. + (AGGR_INIT_EXPR_SLOT): New macro. + (AGGR_INIT_EXPR_ARG): New macro. + (aggr_init_expr_nargs): New macro. + (AGGR_INIT_EXPR_ARGP): New macro. + (aggr_init_expr_arg_iterator): New. + (init_aggr_init_expr_arg_iterator): New. + (next_aggr_init_expr_arg): New. + (first_aggr_init_expr_arg): New. + (more_aggr_init_expr_args_p): New. + (FOR_EACH_AGGR_INIT_EXPR_ARG): New. + (stabilize_aggr_init): New declaration. + (build_min_non_dep_call_list): Likewise. + + * tree.c (process_aggr_init_operands): New function. + (build_aggr_init_array) New function. + (build_cplus_new): Update to use new CALL_EXPR and + AGGR_INIT_EXPR accessor macros. Replace use of build3 with + build_aggr_init_array. + (build_min_non_dep_call_list) New function. + (build_min_nt): Assert input code parameter is not a variable + length expression class. + (build_min, build_min_non_dep): Likewise. + (cp_tree_equal) : Iterate through the arguments + to check for equality instead of recursing. Handle tcc_vl_exp + tree code classes. + (stabilize_call): Update to only handle CALL_EXPRs, not + AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. + (stabilize_aggr_init): New function. + (stabilize_init): Use it. + + * cxx-pretty-print.c (pp_cxx_postfix_expression) + : Update to use new CALL_EXPR and + AGGR_INIT_EXPR accessor macros and argument iterators. + + * pt.c (tsubst_copy) : Replace build_nt with + build_vl_exp. Iterate through the operands, recursively + processing each one. + (tsubst_copy_and_build) : Update to use new + CALL_EXPR accessor macros. + (value_dependent_expression_p) : Handle tcc_vl_exp + tree code classes. Use TREE_OPERAND_LENGTH instead of + TREE_CODE_LENGTH. + + * semantics.c (finish_call_expr): Use build_nt_call_list + instead of build_nt. + (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR + accessor macros. Use build_call_array to construct the + CALL_EXPR node instead of build3 + + * decl2.c (build_offset_ref_call_from_tree): Use + build_nt_call_list and build_min_non_dep_call_list instead + of build_min_nt and build_min_non_dep. + + * parser.c (cp_parser_postfix_expression) : + Use build_nt_call_list instead of build_min_nt. + + 2007-02-15 Manuel Lopez-Ibanez + + PR c++/28943 + * call.c (build_conditional_expr): Improve error message. + + 2007-02-13 Dirk Mueller + + * friend.c (do_friend): Annotate warning about friend + declarations in templates with OPT_Wnon_template_friend. + Convert informal message from warning() to inform(). + + 2007-02-12 Simon Martin + Mark Mitchell + + PR c++/14622 + * pt.c (do_decl_instantiation): Detect type mismatches in explicit + instantiations for variables. + + 2007-02-12 Manuel Lopez-Ibanez + + PR middle-end/7651 + * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings. + Check warn_unused_value just once. + + 2007-02-11 Mark Mitchell + + PR c++/26988 + * pt.c (determine_specialization): Use skip_artificial_parms_for. + (fn_type_unificiation): Likewise. + (get_bindings): Likewise. + + o2007-02-06 Mark Mitchell + + PR target/29487 + * decl.c (finish_function): Use DECL_REPLACEABLE. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + + 2007-02-10 Gabriel Dos Reis + + * parser.c (cp_parser_primary_expression): Reformat overly long lines. + + 2007-02-10 Richard Henderson , Jakub Jelinek + + * decl.c (grokvardecl): Don't error if !have_tls. + (grokdeclarator): Likewise. + * parser.c (cp_parser_omp_threadprivate): Likewise. + + 2007-02-07 Jakub Jelinek + + PR c++/30703 + * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref + parameters and result decls in omp clauses. + (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs + by reference. + + 2007-02-05 Dirk Mueller + + PR bootstrap/30510 + * parser.c (cp_parser_class_specifier): Always initialize bases. + + 2007-02-05 Paolo Bonzini + + * cp-tree.h (OMP_ATOMIC_CODE): Delete. + (OMP_ATOMIC_DEPENDENT_P): Rewrite. + * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC + expressions. + * semantics.c (finish_omp_atomic): Store a whole expression node + in operand 1, and integer_zero_node in operand 0, for dependent + OMP_ATOMIC. Rewrite to make flow easier to understand. + + 2007-02-03 Gabriel Dos Reis + + * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0. + + 2007-02-04 Kazu Hirata + + * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c, + parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions. + + 2007-02-03 Douglas Gregor + + * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x + keyword warning to -Wc++0x-compat. + + 2007-02-03 Gabriel Dos Reis + + * decl.c (grokdeclarator): Update documentation. + + 2007-02-02 Jakub Jelinek + + PR c++/30536 + * decl.c (grokdeclarator): If __thread is used together with + a storage class other than extern and static, clear thread_p + after issuing diagnostics and fall through to checking the + storage class. + + 2007-01-30 Roger Sayle + + * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when + calculating the size of an array (to avoid recursive errors). + + 2007-01-30 Manuel Lopez-Ibanez + + PR c++/24745 + * typeck.c (build_binary_op): Fix logic for warning. Move warning + to -Wpointer-arith. + * call.c (convert_like_real): Don't warn when converting to + boolean type. + + 2007-01-29 Manuel Lopez-Ibanez + + * decl.c (pop_label): Replace warning with call to + warn_for_unused_label. + + 2007-01-28 Andrew Pinski + + PR C++/28988 + * semantics.c (finish_pseudo_destructor_expr): Check the + destrutor name by calling check_dtor_name. + + 2007-01-24 Douglas Gregor + + * lex.c (D_CPP0X): Rename. + (D_CXX0X): To this. + (reswords): D_CPP0X -> D_CXX0X. + (init_reswords): Ditto. + * parser.c (cp_lexer_get_preprocessor_token): Warn about the use + of C++0x keywords as identifiers. + + 2007-01-23 Simon Martin + + PR c++/27492 + * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for + function decls. + + 2007-01-23 Ian Lance Taylor + + * typeck.c (convert_for_assignment): Only warn about a = b = c + when converting to bool. + + 2007-01-23 Roger Sayle + + * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with + TREE_OVERFLOW. + * typeck.c (ignore_overflows): Remove the remaining uses of + TREE_CONSTANT_OVERFLOW. + + 2007-01-20 Jan Hubicka + + * decl2.c (start_objects, start_static_storage_duration_function): + Do not make the functions uninlinable. + + 2007-01-17 Ian Lance Taylor + + * class.c (add_method): Call VEC_reserve_exact rather than passing + a negative size to VEC_reserve. + + 2007-01-11 Simon Martin + + PR c++/29573 + * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees. + + 2007-01-10 Mark Mitchell + + PR c++/28999 + * decl.c (make_typename_type): If the qualified name is not a + type, issue an error. + * parser.c (cp_parser_elaborated_type_specifier): Fix comment + formatting. + + 2007-01-08 Geoffrey Keating + + * rtti.c: Include target.h. + (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (), + don't emit typeinfo for fundamental types as weak. + * Make-lang.in (cp/rtti.o): Update and correct dependencies. + + 2007-01-08 Richard Guenther + + * cvt.c (cp_convert_to_pointer): Use build_int_cst_type. + + 2007-01-08 Mark Shinwell + + * call.c (standard_conversion): Pass flag to + vector_types_convertible_p to disallow emission of note. + * typeck.c (convert_for_assignment): Pass flag to + vector_types_convertible_p to allow emission of note. + (ptr_reasonably_similar): Pass flag to vector_types_convertible_p + to disallow emission of note. + + 2007-01-07 Manuel Lopez-Ibanez + + PR c++/28986 + * typeck.c (build_binary_op): Call overflow_warning if + TREE_OVERFLOW_P is true for the result and not for any of the + operands. + + 2007-01-06 Lee Millward + + PR c++/19439 + * class.c (add_method): Don't wait until template + instantiation time to complain about duplicate methods. + + 2007-01-05 Manuel Lopez-Ibanez + + PR c/19978 + * semantics.c (finish_unary_op_expr): Warn only if result + overflowed and operands did not. + + 2007-01-05 Ian Lance Taylor + + * typeck.c (build_binary_op): Warn about comparing a non-weak + address to NULL. + + 2007-01-05 Douglas Gregor + + * pt.c (tsubst): Propagate the need for structural equality checks + when reducing the level of template parameters. + + 2007-01-03 Kazu Hirata + + * pt.c: Fix a comment typo. + + 2007-01-02 Ian Lance Taylor + + * semantics.c (maybe_convert_cond): Optionally warn when using an + assignment as a condition. + * typeck.c (convert_for_assignment): Optionally warn about + assigning the result of an assignment to a bool. + + 2007-01-02 Douglas Gregor + + * pt.c (canonical_template_parms): Correct typo in comment. + + 2007-01-02 Douglas Gregor + + * typeck.c (structural_comptypes): Renamed from "comptypes". + (comptypes): Use canonical type information to perform fast type + comparison. When VERIFY_CANONICAL_TYPES, verify that the + canonical type comparison returns the same results as we would see + from the current, structural check. Support COMPARE_STRUCTURAL + when we need structural checks. + * decl.c (typename_compare): Fix comment. + (build_typename_type): TYPENAME_TYPE nodes require structural + equality checks, because they resolve different based on the + current class type. + (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes + require structural equality checks (for now). + (build_ptrmemfunc_type): Build the canonical pointer to member + function type. + (compute_array_index_type): Whenever we build a new index type + to represent the size of an array in a template, we need to mark + this index type as requiring structural equality. This goes for + arrays with value-dependent sizes with the current ABI, or all + arrays with ABI-1. + * tree.c (cplus_array_hash): New. + (struct cplus_array_info): New. + (cplus_array_compare): New. + (cplus_array_htab): New. + (build_cplus_array_type_1): Use a hash table to cache the array + types we build. Build the canonical array type for each array + type. + (cp_build_qualified_type_real): When building a cv-qualified array + type, use the hash table of array types and build canonical array + types as necessary. + (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes + use structural equality (for now). + * cp-tree.h (COMPARE_STRUCTURAL): New. + * pt.c (canonical_template_parms): New. + (canonical_type_parameter): New. + (process_template_parm): Find the canonical type parameter. + (lookup_template_class): When we have named the primary template + type, set the canonical type for our template class to the primary + template type. If any of the template arguments need structural + equality checks, the template class needs structural equality + checks. + (tsubst): When reducing the level of a template template + parameter, we require structural equality tests for the resulting + parameter because its template parameters have not had their types + canonicalized. When reducing a template type parameter, find the + canonical reduced type parameter. + (any_template_arguments_need_structural_equality_p): New. diff -Nrcpad gcc-4.3.3/gcc/cp/ChangeLog-2008 gcc-4.4.0/gcc/cp/ChangeLog-2008 *** gcc-4.3.3/gcc/cp/ChangeLog-2008 Thu Jan 1 00:00:00 1970 --- gcc-4.4.0/gcc/cp/ChangeLog-2008 Thu Feb 26 15:31:11 2009 *************** *** 0 **** --- 1,3256 ---- + 2008-12-31 Jakub Jelinek + + PR c++/38647 + * parser.c (cp_parser_primary_expression) : + Return error_mark_node if cp_parser_non_integral_constant_expression + returns true. + + PR c++/38640 + * semantics.c (finish_decltype_type): Handle TEMPLATE_PARM_INDEX. + + 2008-12-29 Jakub Jelinek + + PR c++/38635 + * parser.c (cp_parser_condition): Use cp_parser_require + instead of cp_lexer_consume_token to consume =. + + PR c++/38637 + * decl.c (start_enum): If enumtype is error_mark_node, exit early. + + 2008-12-28 Jakub Jelinek + + PR c++/38650 + * semantics.c (finish_omp_for): Don't add CLEANUP_POINT_EXPR + around volatile iteration var in condition and/or increment + expression. + + 2008-12-27 Jakub Jelinek + + PR c++/38639 + * pt.c (tsubst_omp_for_iterator): RECUR on whole init_expr instead of + just its type. + + 2008-12-21 Jason Merrill + + PR c++/38597 + * name-lookup.c (arg_assoc_type): Handle DECLTYPE_TYPE. + + 2008-12-20 Jakub Jelinek + Manuel López-Ibáñez + + PR c++/36921 + * c-common.c (warn_about_parentheses): Remove ARG_UNUSED from + arg_left. Don't warn about X<=Y<=Z if comparison's type isn't + integral. + + 2008-12-19 Jakub Jelinek + + PR c++/38577 + * call.c (build_new_method_call): Handle call being COMPOUND_EXPR + or NOP_EXPR. + + 2008-12-18 Jakub Jelinek + + PR c++/38427 + * init.c (perform_member_init): For value-initialized + references call permerror instead of warning and don't emit any + INIT_EXPR. + + 2008-12-18 Jason Merrill + + PR c++/38485 + * parser.c (cp_parser_token_starts_cast_expression): An EOF + can't start a cast-expression. + + 2008-12-17 Jason Merrill + + * semantics.c (describable_type): New function. + (finish_decltype_type): Use it for dependent exprs. + * cp-tree.h: Declare it. + * mangle.c (write_type) [DECLTYPE_TYPE]: Set skip_evaluation. + (write_expression): If skip_evaluation, use type stubs. + * tree.c (cp_tree_equal): Handle PARM_DECLs from different + declarations of a function. + * init.c (build_new): Do auto deduction if type is describable. + * decl.c (cp_finish_decl): Likewise. + * parser.c (cp_parser_omp_for_loop): Likewise. + + 2008-12-10 Jason Merrill + + PR c++/35319 + * mangle.c (write_builtin_type): Add mangling for decimal floating + point and fixed point types. + (write_type): Pass FIXED_POINT_TYPE along. + + 2008-12-09 Mark Mitchell + + PR c++/37971 + * class.c (resolve_address_of_overloaded_function): Check + accessibility of member functions unless FLAGS indicates + otherwise. + * call.c (standard_conversion): Adjust flags passed to + instantiate_type. + (convert_default_arg): Do not perform access checks. + * cp-tree.h (tsubst_flags_t): Add tf_no_access_control. + + 2008-12-08 Steve Ellcey + + * decl2.c (mark_used): Remove assemble_external call. + + 2008-12-08 Dodji Seketeli + + PR debug/38390 + * name-lookup.c (kept_level_p): Don't forget the case of levels + having using directives. + + 2008-12-08 Richard Henderson + + PR 38240 + * class.c (finish_struct_bits): Use SET_TYPE_MODE. + * decl.c (record_unknown_type): Likewise. + (start_enum, finish_enum): Likewise. + + 2008-12-05 Jakub Jelinek + + PR c++/35336 + * error.c (dump_expr): Handle BIT_FIELD_REF. + + 2008-12-05 Sebastian Pop + + PR bootstrap/38262 + * Make-lang.in (cc1plus-dummy, cc1plus): Add BACKENDLIBS, + remove GMPLIBS. + + 2008-12-04 Jason Merrill + + PR c++/37906 + * decl.c (grok_special_member_properties): Set TYPE_HAS_COMPLEX_DFLT + here. + * class.c (check_bases_and_members): Rather than assuming any + user-declared default constructor is complex here. + + 2008-12-04 Richard Guenther + + PR c++/38334 + * typeck.c (get_member_function_from_ptrfunc): Mark the vtbl + pointer access with TREE_NO_WARNING. + + 2008-12-03 Jason Merrill + + PR c++/38232 + * init.c (build_value_init): Do initial zero-initialization + of a class with an implicitly-defined constructor using + build_zero_init rather than in build_value_init. + (build_value_init_1): Fold into build_value_init. + + PR c++/38256 + * parser.c (cp_parser_conversion_type_id): Diagnose + 'operator auto' here. + * decl.c (grokdeclarator): Not here. + + PR c++/38380 + * decl.c (grokdeclarator): Only set DECL_NONCONVERTING_P + on explicit constructors. + * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Propagate + CONSTRUCTOR_IS_DIRECT_INIT. + + 2008-12-02 Jason Merrill + + PR c++/35782, c++/37860 + * call.c (build_user_type_conversion_1): Remember + list-initialization. + (convert_like_real): Likewise. + (build_over_call): Don't require the copy constructor + for copy-list-initialization. + * cp-tree.h (TARGET_EXPR_LIST_INIT_P): New macro. + + PR c++/37234 + * decl.c (cp_finish_decl): Handle =default and =delete for + templates, too. + + 2008-12-01 Jakub Jelinek + + PR c++/38257 + * parser.c (cp_parser_omp_for_loop): Handle auto. + * pt.c (tsubst_omp_for_iterator): Likewise. + + 2008-11-28 Jason Merrill + + PR c++/38233 + * init.c (perform_member_init): Fix value-initialization. + (build_value_init_1): Add assert to catch cases that will break + in the gimplifier. + (build_default_init): Remove. + * cp-tree.h: Remove its prototype. + * pt.c (tsubst_expr) [DECL_EXPR]: Use build_value_init for + value-initialization. + + PR c++/38278 + * parser.c (cp_parser_class_name): Only call + maybe_note_name_used_in_class if we actually found a class name. + + 2008-11-25 Jason Merrill + + PR c++/28743 + * decl2.c (check_classfn): Error rather than abort on parameter + list mismatch. + + 2008-11-20 Jason Merrill + + PR c++/28513 + * parser.c (cp_parser_class_name): Call maybe_note_name_used_in_class. + + PR c++/37540 + * call.c (build_over_call): Take the address of the function even + in a template. + (build_new_method_call): Remember the type of the called function + in a template. + + 2008-11-19 Dodji Seketeli + + PR c++/37142 + * pt.c (coerce_template_template_parm): Use the more robust + uses_template_parms instead of dependent_type_p. + + 2008-11-19 Dodji Seketeli + + PR c++/35405 + * pt.c (lookup_template_class): Check pointers before dereferencing + them. + * error.c (dump_template_decl): Likewise. + + 2008-11-19 Jason Merrill + + PR c++/36410 + * decl2.c (grokfield): Pass ATTR_FLAG_TYPE_IN_PLACE for a typedef + that names a class for linkage purposes. + + PR c++/37563 + * parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor + name is not a declaration. + + PR c++/37256 + * pt.c (instantiate_decl): Don't require a definition of + a template that is explicitly instantiated 'extern'. + + 2008-11-18 Jason Merrill + Jakub Jelinek + + PR c++/37962 + * parser.c (cp_parser_type_id): Complain about auto. + * decl.c (grokdeclarator): Complain about parameters and + conversion functions declared with auto. + + * call.c (standard_conversion): Use CLASS_TYPE_P instead of + MAYBE_CLASS_TYPE_P. + * cp-tree.h (TYPE_NON_AGGREGATE_CLASS): Likewise. + + 2008-11-17 Jakub Jelinek + + PR c++/36089 + * init.c (constant_value_1): Handle TREE_LIST init. + + 2008-11-15 Jakub Jelinek + + PR c++/37561 + * typeck.c (cp_build_unary_op): Don't call get_unwidened. Use + argtype instead of result_type. + + 2008-11-14 Jason Merrill + + PR c++/38030 + * semantics.c (finish_call_expr): Don't repeat arg-dep lookup + for a non-dependent call. + + PR c++/37740 + * call.c (build_aggr_conv): Increment i. + + 2008-11-13 Jason Merrill + + PR c++/37932 + * typeck2.c (process_init_constructor_record): Update bitfield + handling. + (check_narrowing): Update bitfield handling, print source type. + + 2008-11-12 Jakub Jelinek + + PR c++/36478 + Revert: + 2007-05-07 Mike Stump + * parser.c (check_empty_body): Add. + (cp_parser_iteration_statement): Add call to check_empty_body. + + 2008-11-12 Jason Merrill + + PR c++/38007 + * typeck.c (cp_build_modify_expr): Update bitfield handling. + + 2008-11-12 Jakub Jelinek + + PR c++/34269 + * parser.c (cp_parser_simple_declaration): Don't commit + to tentative parse if parse errors were seen. + + PR c++/35334 + * error.c (dump_expr): Handle COMPLEX_EXPR. + + 2008-11-10 Jakub Jelinek + + PR c++/38021 + * parser.c (cp_parser_enum_specifier): After parsing :, + parse definitely. Don't return early if type specifier + is erroneous. + + 2008-11-06 David Edelsohn + + PR target/26397 + * g++spec.c (LIBSTDCXX_STATIC): New. + (lang_spec_driver): Use LIBSTDCXX_STATIC when not + shared_libgcc. + + 2008-11-05 Fabien Chene + + PR c++/32519 + * cp-tree.h: Fix DECL_NONSTATIC_MEMBER_P to handle member template + functions. + + 2008-11-05 Richard Guenther + + PR middle-end/37742 + * decl.c (start_preparsed_function): Use the correct type for + building the RESULT_DECL. + + 2008-10-31 Jakub Jelinek + + PR c++/37967 + * decl.c (grokdeclarator): Diagnose auto function decl without + late return type and late return type function decl where type + is not auto. + + PR c++/37965 + * decl.c (cp_finish_decl): Diagnose type_uses_auto type with + no initializer. + + 2008-10-29 Manuel Lopez-Ibanez + + PR 11492 + * class.c (check_bitfield_decl): Rename min_precision to + tree_int_cst_min_precision. + * decl.c (finish_enum): Likewise. + + 2008-10-29 Manuel López-Ibáñez + + PR c++/26997 + * parser.c (cp_parser_token_starts_cast_expression): New. + (cp_parser_cast_expression): Peek the next token to decide whether + this could be a parenthesized constructor or is definitely an + actual cast. + + 2008-10-24 Manuel López-Ibáñez + + PR c/7543 + * typeck.c (build_x_binary_op): Update call to + warn_about_parentheses. + * parser.c (cp_parser_binary_expression): Add note about passing + the correct code for unary expressions. + + 2008-10-24 Jakub Jelinek + + * Make-lang.in (check-c++-subtargets): New alias for + check-g++-subtargets. + (lang_checks_parallelized): Add check-g++. + (check_g++_parallelize): New variable. + + 2008-10-21 Richard Guenther + + * semantics.c (simplify_aggr_init_exprs_r): Remove. + (expand_or_defer_fn): Do not walk the function body to + simplify aggr_init_exprs. + + 2008-10-20 Manuel López-Ibáñez + + PR c++/37004 + * typeck.c (cp_common_type): New. The same as + type_after_usual_arithmetic_conversions but without promotions. + (type_after_usual_arithmetic_conversions): Do the promotions and + call cp_common_type. + (common_type): Make it behave like the C version of this + function. Do not handle pointer types. + (common_pointer_type): Move handling of pointer types from + common_type to here. + (cp_build_binary_op): Use common_pointer_type instead of + common_type in call to pointer_diff. + Use cp_common_type instead of common_type. + * cp-tree.h (common_pointer_type): Declare. + + 2008-10-14 Jakub Jelinek + + PR c++/37819 + * cp-gimplify.c (cp_genericize_r): Only fold_convert COND_EXPR + arguments if they don't already have COND_EXPR's type. + + 2008-10-14 Paolo Carlini + + PR c++/37650 + * pt.c (push_template_decl_real): Check that current_template_parms + is not null. + (process_partial_specialization): Assert current_template_parms not + null. + + 2008-10-13 Doug Evans + + * cp-tree.h (DECL_MAIN_P): Fix parentheses around expression. + + 2008-10-10 Jakub Jelinek + + PR c++/37146 + * cp-gimplify.c (cp_genericize_r): Fix up bitfield operands of + COND_EXPR. + + 2008-10-09 Jakub Jelinek + + PR c++/37568 + * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of + setting it to error_mark_node. + + 2008-10-07 Steve Ellcey + + * decl.c (start_cleanup_fn): Declare as inline. + + 2008-10-06 Jason Merrill + + PR c++/37376, other mangling issues + * mangle.c (write_type): Update TYPE_PACK_EXPANSION mangling. + (write_member_name): Break out from... + (write_expression): ...here. Handle dependent COMPONENT_REF. + (write_template_arg): Wrap an argument pack in 'I'/'E'. + (write_builtin_type): Update char16/32_t mangling. + (write_nested_name, write_prefix): Don't forget template args + for typename types. + * operators.def: Add ARROW_EXPR, update COMPONENT_REF and + EXPR_PACK_EXPANSION. + + 2008-10-06 Aldy Hernandez + + * typeck.c (build_x_indirect_ref): Add location argument. + (cp_build_binary_op): Pass location to warn_for_div_by_zero. + (cp_build_unary_op): Add location argument. + (cp_build_modify_expr): Same. + * class.c (build_base_path): Pass location to build_indirect_ref. + * semantics.c (handle_omp_for_class_iterator): Pass elocus to + build_modify_expr. + + 2008-10-05 Dodji Seketeli + + PR c++/37410 + * cp-gimplify.c (cp_gimplify_expr): For each USING_STMT + make sure an IMPORTED_DECL node is added to the BLOCK_VARS list + of the innermost containing BLOCK. + + 2008-10-03 Paolo Carlini + + PR c++/37719 + * error.c (dump_function_decl): Save the exceptions in case of + error about incompatible specifications in a specialization. + + 2008-10-01 Andrew Pinski + + * tree.c (lvalue_p_1): COMPOUND_LITERAL_EXPR is also an lvalue. + + 2008-09-30 H.J. Lu + + PR c++/37683 + * parser.c (cp_parser_selection_statement): Fix uninitialized + variable. + + 2008-09-30 Simon Martin + + PR c++/37555 + PR c++/37556 + * decl.c (grokdeclarator): Set the type for typedefs to a + nested-name-specifier to error_mark_node. + + 2008-09-30 Paolo Bonzini + + * parser.c (cp_parser_selection_statement): Implement here the + -Wempty-body warning for `if' and `else' statements. + * semantics.c (finish_if_stmt): Do not call empty_body_warning. + + 2008-09-25 Paolo Carlini + + PR c++/37649 + * name-lookup.c (maybe_process_template_type_declaration): Check + return value of push_template_decl_real for error_mark_node. + + 2008-09-24 Aldy Hernandez + + * semantics.c (finish_fname): Pass location to fname_decl. + + 2008-09-23 Jakub Jelinek + + PR c++/37533 + * semantics.c (finish_omp_for): If processing_template_decl, just build + MODIFY_EXPR for init instead of calling cp_build_modify_expr. + + 2008-09-23 Aldy Hernandez + + * typeck.c (build_array_ref): Pass location to cp_build_binary_op. + (get_member_function_from_ptrfunc): Same. + (build_x_binary_op): Same. + (build_binary_op): Same. + (cp_build_binary_op): New location argument. + (pointer_diff): Pass location to cp_build_binary_op. + (cp_truthvalue_conversion): Pass location to build_binary_op. + (convert_ptrmem): Pass location to cp_build_binary_op. + (cp_build_modify_expr): Same. + (build_ptrmemfunc): Same. + * init.c (expand_cleanup_for_base): Pass location to + c_common_truthvalue_conversion. + (build_new_1): Pass location to cp_build_binary_op. + (build_vec_delete_1): Pass location to *build_binary_op, + c_common_truthvalue_conversion. + (build_vec_init): Same. + (build_delete): Same. + * decl.c (compute_array_index_type): Same. + * call.c (build_new_op): Same. + * rtti.c (build_dynamic_cast_1): Same. + * cp-tree.h: Add argument to cp_build_binary_op. + * semantics.c (handle_omp_for_class_iterator): Pass location to + *build_binary_op, c_common_truthvalue_conversion. + * decl2.c (get_guard_cond): Same. + + 2008-09-17 Richard Guenther + + PR c++/22374 + * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR + result to the correct type. + + 2008-09-17 H.J. Lu + + PR c++/37450 + * name-lookup.c (pushdecl_maybe_friend): Don't return the old + parameter for duplicate. + + 2008-09-17 Jason Merrill + + PR c++/37588 + * name-lookup.c (lookup_type_scope): Look through sk_function_parms. + + 2008-09-17 Jakub Jelinek + + PR c++/37552 + * typeck.c (build_array_ref): Use protected_set_expr_location instead + of SET_EXPR_LOCATION when ret might not be an expression. + + 2008-09-17 Jan Hubicka + + PR c++/18071 + * cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P. + + 2008-09-16 Jakub Jelinek + + PR c++/37531 + * semantics.c (finish_compound_literal): Return error_mark_node if + type is errorneous. + + PR c++/37532 + * lex.c (init_reswords): Don't populate ridpointers for D_CONLY + reserved words. + + 2008-09-15 Aldy Hernandez + + * decl.c (duplicate_decls): Call error_at. + (grokfndecl): New location argument. Use location if available. + (grokdeclarator): Pass declarator location to grokfndecl. + * cp-tree.h (struct cp_declarator): Update comment for id_loc. + * decl2.c (check_classfn): Use error_at. + * parser.c (cp_parser_init_declarator): Set function_start_locus + to brace location. + (cp_parser_member_declaration): Set id_loc for function declarators. + + 2008-09-09 Jan Hubicka + + PR middle-end/37500 + * pt.c (tsubst_decl): Do not copy DECL_STRUCT_FUNCTION pointer. + + 2008-09-09 Jakub Jelinek + + PR c++/37417 + * tree.c (array_type_nelts_top): Add size_one_node instead of + integer_one_node. + + 2008-09-09 Jason Merrill + + PR c++/37439 + * pt.c (tsubst_copy) [PARM_DECL]: Don't abort if the parm has + DECL_CONTEXT set. + + 2008-09-09 Jakub Jelinek + + PR c++/37389 + * decl.c (build_enumerator): Handle previous value's DECL_INITIAL + being error_operand_p. Don't clear value if it was error_mark_node. + + 2008-09-09 Paolo Bonzini + + * cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove. + * cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS. + * semantics.c (anon_aggr_type_p): Remove. + + 2008-09-06 Jason Merrill + + PR c++/37302 + * parser.c (cp_parser_parameter_declaration_list): Process the + PARM_DECLs as we go and push them. Return a TREE_LIST. + (cp_parser_parameter_declaration_clause): Return a TREE_LIST. + (cp_parser_direct_declarator): Create a binding level and + suppress deprecated warnings in the parameter list. + (make_call_declarator): PARMS is now a tree. + * cp-tree.h (struct cp_declarator): Function parms are now a tree. + * decl.h (enum deprecated_states, deprecated_state): Move here. + * decl.c: From here. + (type_is_deprecated): New fn. + (grokparms): PARMLIST is a tree now. Warn about parms that + use deprecated types. + * mangle.c (write_expression): Handle PARM_DECL, CALL_EXPR and + 0-operand cast. + * pt.c (tsubst) [DECLTYPE_TYPE]: Set skip_evaluation. + (tsubst_copy) [PARM_DECL]: Handle a PARM_DECL used outside of a + function. + * name-lookup.c (pushtag): Look through function parameter scopes. + (pushdecl_maybe_friend): Don't set DECL_CONTEXT on a PARM_DECL + when we're parsing a function declarator. + + 2008-09-05 Douglas Gregor + + PR c++/37342 + * tree.c (cp_build_qualified_type_real): Deal with sharing of + TYPE_LANG_SPECIFIC in the canonical types of pointer-to-method + types. + + 2008-09-04 Ian Lance Taylor + + * parser.c (check_no_duplicate_clause): Change code parameter to + enum omp_clause_code. + + 2008-09-03 Jakub Jelinek + + PR c++/37348 + * decl.c (cp_finish_decl): Only set + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL. + + PR c++/37189 + * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): New + extern decls. + * decl2.c (mark_used): If defer_mark_used_calls, push decl into + deferred_mark_used_calls vector and exit early. + * decl.c (defer_mark_used_calls, deferred_mark_used_calls): New + variables. + (finish_function): Set defer_mark_used_calls for the duration of the + function. Call mark_used on any queued decls. + + 2008-09-02 Jason Merrill + + PR c++/37208 + * call.c (build_over_call): Make =delete work with SFINAE. + * class.c (resolve_address_of_overloaded_function): Likewise. + + * cp-tree.h (struct lang_decl_flags): Rename threadprivate_p to + threadprivate_or_deleted_p. + (CP_DECL_THREADPRIVATE_P): Adjust. + (DECL_DELETED_FN): Likewise. + (SD_UNINITIALIZED, SD_INITIALIZED, SD_DEFAULTED): New macros. + (SD_DELETED): New macro. + * parser.c (cp_parser_init_declarator): Use them. + * decl.c (start_decl): Use them. + + * decl2.c (mark_used): Give =deleted error even in sizeof. + + * typeck2.c (check_narrowing): Downgrade narrowing error to + permerror. + + 2008-09-02 Aldy Hernandez + + * typeck.c (build_array_ref): Use new location argument. + * class.c (build_vtbl_ref_1): Pass location to build_array_ref. + * call.c (build_new_op): Same. + * decl2.c (grok_array_decl): Same. + * cp-tree.h (build_array_ref): Add location argument to prototype. + + 2008-09-01 Aldy Hernandez + + * typeck.c (build_x_indirect_ref): Add location argument. + * class.c (build_base_path): Pass location to build_indirect_ref. + * pt.c (tsubst_copy_and_build): Pass location to + finish_label_address_expr. + * parser.c (cp_parser_unary_expression): Same. + + 2008-08-31 Jason Merrill + + Implement late-specified return type using 'auto'. + * cp-tree.h (struct cp_declarator): Add late_return_type field to + function declarator. + * parser.c (cp_parser_late_return_type_opt): New fn. + (cp_parser_direct_declarator): Use it. + (make_call_declarator): Put it in the declarator. + * decl.c (grokdeclarator): Splice in late-specified return type. + * pt.c (splice_late_return_type): New fn. + + 2008-08-29 Michael Meissner + + * decl.c (builtin_function_1): Take a bool argument to decide + whether to use pushdecl or pushdecl_top_level. + (duplicate_decls): Copy function specific target and optimization + options on duplicate declarations. + (cxx_builtin_function): Update builtin_function_1 call. + (cxx_builtin_function_ext_scope): New function, guarantee that the + declaration is done at global scope. + + * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New + macro, define builtin function hook for delayed machine specific + builtins. + + * cp-tree.h (cxx_builtin_function_ext_scope): Add declaration. + + 2008-08-30 Jason Merrill + + PR c++/37288 + * pt.c (dependent_type_p): Don't abort on auto outside of a template. + + 2008-08-29 Jason Merrill + + Implement C++0x 'auto' semantics. + * decl.c (start_decl_1): Don't complain about auto being incomplete. + (cp_finish_decl): Deduce auto. + * init.c (build_new): Handle 'new auto'. + * typeck2.c (cxx_incomplete_type_diagnostic): Give a different + message for auto than for normal template type parms. + * pt.c (type_dependent_expression_p): Handle { }. + (make_auto): New function. + (listify_autos): New function. + (do_auto_deduction): New function. + (is_auto): New function. + (type_uses_auto): New function. + * cp-tree.h: Declare them. + * parser.c (cp_parser_decl_specifier_seq): In C++0x mode, don't + treat auto as a declspec. + (cp_parser_simple_type_specifier): It's a type-specifier. + + 2008-08-29 Mark Mitchell + + * mangle.c (write_type): Add target-specific manglings for + non-fundamental types to the substitution table. + gcc/testsuite/ + + 2008-08-29 Jakub Jelinek + + PR fortran/29635 + PR fortran/23057 + * name-lookup.c (do_using_directive, cp_emit_debug_info_for_using): + Adjust debug_hooks->imported_module_or_decl callers. + + 2008-08-29 Jan Hubicka + + * cp-gimplify.c (cp_gimplify_expr): Add PRED_CONTINUE heuristic. + + 2008-08-28 Paolo Carlini + + PR c++/37260 + * decl.c (reshape_init_r): Check init for error_mark_node. + + 2008-08-27 Manuel Lopez-Ibanez + + PR c++/17880 + * semantics.c (maybe_convert_cond): Call verify_sequence_points. + (finish_return_stmt): Likewise. + (finish_switch_condition): Likewise. + + 2008-08-27 Manuel Lopez-Ibanez + + * cp-tree.h: Fix #error directive. + + 2008-08-26 Douglas Gregor + + * typeck.c (type_after_usual_arithmetic_conversions): Don't do the + usual arithmetic conversions on scoped enumeration types. + (common_type): Ditto. + (default_conversion): Don't perform integral promotions on scoped + enumeration types. + (build_array_ref): Scoped enumeration types can't be used as + subscripts. + * decl.c (start_enum): If building a C++0x scoped enumeration, + enter its scope. If provided with an underlying type, check that + underlying type and set up the enumeration type accordingly. + (finish_enum): Only compute an underlying type if the underlying + type isn't already fixed, and only convert the enumerator values + now if we've just computed the underlying type. Finish the scope + of C++0x scoped enumerations. + (build_enumerator): For enumerations with a fixed underlying type, + check the enumerator values when the enumerator is defined. + (lookup_enumerator): New. + * call.c (standard_conversion): Don't allow assignment from + integers to scoped enumeration types, even with -fpermissive. + Don't convert from scoped enumerations to bool or any arithmetic + types. + (build_conditional_expr): Don't per the usual arithmetic + conversions for scoped enumeration types. + (convert_like_real): Check complain to see if we should + produce warnings. + * error.c (class_key_or_enum_as_string): Print scoped enums. + * cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not + TYPE_LANG_FLAG_5. + (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New. + (SCOPED_ENUM_P): New. + (UNSCOPED_ENUM_P): New. + (SET_SCOPED_ENUM_P): New. + (ENUM_UNDERLYING_TYPE): New. + * pt.c (lookup_template_class): Update the instantiation of enum + types to deal with C++0x scoped enumerations and underlying + types. + * name-lookup.c (begin_scope): Deal with scoped enumeration + scopes. + (lookup_qualified_name): Deal with lookup into enumeration types. + * name-lookup.h (enum scope_kind): Add sk_scoped_enum. + * parser.c (cp_parser_class_or_namespace_name): Rename to... + (cp_parser_qualifying_entity): ... this. Also, in C++0x mode, + parse a type-name that can be an enumeration type. + (cp_parser_nested_name_specifier_opt): Update with C++0x grammar. + (cp_parser_elaborated_type_specifier): Parse the + optional `struct' or `class' following enum (in C++0x). + (cp_parser_enum_specifier): Parse C++0x scoped enumerations and + enum-base clauses. + + 2008-08-21 Manuel Lopez-Ibanez + + * typeck.c: Update all calls to pedwarn. + * decl.c: Likewise. + * call.c: Likewise. + * error.c: Likewise. + * pt.c: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + + 2008-08-20 Manuel Lopez-Ibanez + + PR c++/35158 + * parser.c (cp_parser_omp_for_loop): Handle parenthesized + initializers. + + 2008-08-20 Manuel Lopez-Ibanez + + * parser.c: Update all calls to inform. + * typeck.c: Likewise. + * init.c: Likewise. + * class.c: Likewise. + * call.c: Likewise. + * method.c: Likewise. + * friend.c: Likewise. + * typeck2.c: Likewise. + * pt.c: Likewise. + * name-lookup.c: Likewise. + * lex.c: Likewise. + + 2008-08-19 Jakub Jelinek + + PR debug/37156 + * error.c (cp_print_error_function): Deal with recursive BLOCK trees. + + 2008-08-18 Tomas Bily + + * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P. + + 2008-08-18 Manuel Lopez-Ibanez + + * typeck.c: Update all callers of permerror. + * init.c: Likewise. + * class.c: Likewise. + * decl.c: Likewise. + * call.c: Likewise. + * except.c: Likewise. + * cvt.c: Likewise. + * typeck2.c: Likewise. + * pt.c: Likewise. + * semantics.c: Likewise. + * name-lookup.c: Likewise. + * lex.c: Likewise. + * decl2.c: Likewise. + * parser.c: Likewise. + + 2008-08-14 Paolo Carlini + + PR c++/34485 + * pt.c (check_template_shadow): Change to return a bool. + * name-lookup.c (push_class_level_binding): Early return if + check_template_shadow returns false. + * cp-tree.h (check_template_shadow): Adjust declaration. + + 2008-08-14 Paolo Carlini + + PR c++/34600 + * decl.c (grokdeclarator): In case of extern and initializer, return + error_mark_node after the error. + + 2008-08-13 Manuel Lopez-Ibanez + + PR 30551 + * decl.c (grokfndecl): Call check_main_parameters_type only if + -Wmain. + + 2008-08-12 Paolo Carlini + + PR c++/37087 + * parser.c (cp_parser_class_head): Early return error_mark_node in + case of global qualification of class name or qualified name that + does not name a class. + + 2008-08-09 Manuel Lopez-Ibanez + + PR c++/12242 + * cvt.c (ocp_convert): Warn for out-of-range conversions to enum. + + 2008-08-09 Manuel Lopez-Ibanez + + PR 36901 + * cp-tree.h (struct diagnostic_context, struct diagnostic_info): + Delete forward declarations. Check that toplev.h has not been + included before this file. Include toplev.h and diagnostic.h. + * error.c (cp_cpp_error): Use DK_PEDWARN. + (cxx_incomplete_type_diagnostic): Update declaration. + (cxx_incomplete_type_error): Use DK_ERROR. + * typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t + as argument. Use emit_diagnostic. + (cxx_incomplete_type_error): Use DK_ERROR. + (add_exception_specifier): Use diagnostic_t instead of custom + codes. + * typeck.c (complete_type_or_else): Update call to + cxx_incomplete_type_diagnostic. + * init.c (build_delete): Likewise. + * call.c (diagnostic_fn_t): Remove unused typedef. + (build_temp): Pass a pointer to diagnostic_t. + (convert_like_real): Use emit_diagnostic. + (joust): Check return value of warning before giving informative + note. + * friend.c (do_friend): Check return value of warning + before giving informative note. + * parser.c (cp_parser_template_id): Likewise. + + 2008-08-09 Manuel Lopez-Ibanez + + PR 7651 + * class.c (check_bases_and_members): Warn with -Wuninitialized + instead of -Wextra. + + 2008-08-08 Volker Reichelt + + PR c++/35985 + * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P, + and make sure it is not a union. + + 2008-08-07 H.J. Lu + + * semantics.c (finish_decltype_type): Initialize type. + + 2008-08-07 Douglas Gregor + + * semantics.c (finish_decltype_type): Handle calls to function + pointers and references to functions properly. + + 2008-08-06 Douglas Gregor + + PR c++/36460 + * parser.c (cp_parser_template_argument): Don't assume that '>>' + following a type-id is an error when in C++0x mode. + + 2008-08-06 Manuel Lopez-Ibanez + + PR 26785 + * decl.c (grokdeclarator): Use explicit location with permerror_at. + + 2008-08-06 Manuel Lopez-Ibanez + + PR 8715 + * typeck.c (cp_build_binary_op): Move code to c-common.c. + + 2008-08-05 Jason Merrill + + PR c++/37016 + * decl.c (build_ptrmemfunc_type): Don't require structural + comparison of PMF types. + * tree.c (cp_build_qualified_type_real): Don't clear + a valid TYPE_PTRMEMFUNC_TYPE. + * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in + templates. + + 2008-08-04 Jason Merrill + + PR c++/36963 + * typeck2.c (check_narrowing): Allow narrowing conversion + from an explicit floating-point constant. + + PR c++/37006 + * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted + instantiations. + + 2008-08-04 Simon Baldwin + + PR c++/36999 + * parser.c (cp_parser_elaborated_type_specifier): Warn only when + the declaration's id is followed by a semicolon. + + 2008-07-31 Jakub Jelinek + + PR c++/36405 + * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call + complete_type_or_else even for UNKNOWN_TYPE to get diagnostics. + + 2008-07-31 Jason Merrill + + PR c++/36633 + * init.c (build_new_1): Don't convert pointer to the data type + until we're actually going to treat it as that type. + + PR c++/11309 + * tree.c (build_aggr_init_expr): Split out... + (build_cplus_new): ...from here. + (stabilize_init): Don't mess with AGGR_INIT_EXPR either. + * init.c (build_new_1): new T() means value-initialization, + not default-initialization. + (build_vec_init): Likewise. + (build_value_init_1): Use build_aggr_init_expr. + + 2008-07-30 Dodji Seketeli + + PR c++/36767 + * decl2.c (fix_temporary_vars_context_r): New function. + (one_static_initialization_or_destruction): Make sure temporary + variables part of the initialiser have their DECL_CONTEXT() + properly set. + + 2008-07-30 Manuel Lopez-Ibanez + + PR 34389 + * typeck.c (build_binary_op): Encapsulate code into + shorten_binary_op. + + 2008-07-29 Jakub Jelinek + + PR c++/36852 + * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on + TYPE_UID instead of pointers. + + 2008-07-29 Jan Hubicka + + * optimize.c (maybe_clone_body): Remove DECL_INLINE. + * decl.c (duplicate_decls): Likewise. + (grokfndecl): Likewise. + (start_method): Likewise. + * method.c (make_thunk, make_alias_for, implicitly_declare_fn): + Likewise. + * pt.c (register_specialization, regenerate_decl_from_template): + Likewise. + * decl2.c (grokfield): Likewise. + + 2008-07-29 Manuel Lopez-Ibanez + + PR 34985 + * decl.c (duplicate_decls): Merge USED flags. + + 2008-07-27 Jason Merrill + + PR c++/36943 + * decl.c (reshape_init_r): Allow C++0x initializer lists. + + 2008-07-28 Richard Guenther + + Merge from gimple-tuples-branch. + + 2008-07-22 Aldy Hernandez + + * cp-gimplify.c (gimplify_if_stmt): Set location on newly created + COND_EXPR. + + 2008-07-18 Jakub Jelinek + + * decl.c (finish_function): Call gimple_body after cp_genericize. + + 2008-07-18 Aldy Hernandez + + * optimize.c: Include gimple.h instead of tree-gimple.h. + * Make-lang.in (cp-gimplify.o): Depend on tree-iterator.h. + * cp-gimplify.c: Rename tree-gimple.h to gimple.h. Include + tree-iterator.h. + + 2008-07-16 Jakub Jelinek + + * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE for the clone. + + 2008-07-14 Jakub Jelinek + + * cp-gimplify.c (cp_gimplify_expr): Update comment. + + 2008-07-14 Aldy Hernandez + + * cp-tree.h (union lang_tree_node): Rename GENERIC_NEXT to + TREE_CHAIN. + * cp-gimplify.c (cxx_omp_clause_apply_fn): Rename + GIMPLE_MODIFY_STMT to MODIFY_EXPR. + (cxx_omp_clause_copy_ctor): Same. + (cxx_omp_clause_assign_op): Same. + + 2008-05-28 Jakub Jelinek + + * cp-gimplify.c (cp_gimplify_omp_for): Add pre_p argument. Tuplify. + (cp_gimplify_expr): Adjust caller. + + 2008-05-11 Doug Kwan + + * init.c (build_vec_delete): Add type conversion for argument + 0 of POINTER_PLUS_EXPR. + + 2008-04-29 Doug Kwan + + * decl2 (File): Include "gimple.h" + (cp_write_global_declarations): Use gimple_body instead of + DECL_SAVED_TREE. + * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H) + + 2008-04-10 Diego Novillo + + http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00913.html + + * optimize.c (maybe_clone_body): Re-enable call to + clone_body. + * cp-gimplify.c (cp_gimplify_omp_for): Mark disabled + code with call to gimple_unreachable. + (cp_genericize): Fix handling of clone bodies. + + 2008-04-04 Diego Novillo + + http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00413.html + + * optimize.c (maybe_clone_body): Re-enable. + + 2008-02-19 Diego Novillo + Oleg Ryjkov + + http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html + + * cp-gimplify.c (gimplify_for_stmt): Change gimple_seq + argument to gimple_seq *. Update all users. + (gimplify_must_not_throw_expr): Likewise. + + 2008-02-04 Oleg Ryjkov + + * except.c: Include gimple.h + (cp_protect_cleanup_actions): Convert to tuples. + * Make-lang.in (cp/except.o): Add dependency on gimple.h + + 2007-11-10 Aldy Hernandez + + * cp-gimplify.c (gimplify_cp_loop): Call tree_annotate_all_with_locus + instead of annotating each block manually. + + 2007-10-30 Aldy Hernandez + + * cp-gimplify.c (gimplify_cp_loop): Tuplify. + (gimplify_for_stmt): Same. + (gimplify_switch_stmt): Same. + (cp_gimplify_expr): [FOR_STMT]: Do not call gimplify_for_stmt. Return + GS_OK. + [WHILE_STMT]: Return GS_OK. + [SWITCH_STMT]: Same. + [CONTINUE_STMT]: Same. + [BREAK_STMT]: Same. + (cp_genericize): Set gimple_body() of cloned functions when needed. + + 2007-10-29 Aldy Hernandez + + * cp-gimplify.c: Move build_gimple_eh_filter_tree here. + (cp_gimplify_init_expr): Convert to tuples. + (gimplify_must_not_throw_expr): Make function return a + gimplify_status and convert to tuples. + + 2007-10-18 Aldy Hernandez + + * cp-gimplify.c (genericize_try_block): Enable and do not call + gimplify_stmt. + (genericize_catch_block): Same. + (genericize_eh_spec_block): Same. + Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree. + (cp_gimplify_expr): Enable TRY_BLOCK, HANDLER, and EH_SPEC_BLOCK. + + 2007-10-16 Aldy Hernandez + + * optimize.c (maybe_clone_body): Comment out call to clone_body. + * decl.c (finish_function): Use gimple_body instead of + DECL_SAVED_TREE. + * cp-tree.h (cp_gimplify_expr): Last 2 arguments are sequences. + * cp-gimplify.c (genericize_try_block): Comment out. + (genericize_catch_block): Same. + (genericize_eh_spec_block): Same. + (gimplify_cp_loop): Comment out calls to gimplify_stmt. + (gimplify_for_stmt): Comment out. + (gimplify_switch_stmt): Comment out call to gimplify_stmt. + (cp_gimplify_omp_for): Same. + (gimplify_must_not_throw_expr): Argument pre_p is a sequence. + Comment out call to gimplify_stmt and append_to_statement_list. + Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree. + (cp_gimplify_init_expr): Arguments pre_p and post_p are sequences. + (cp_gimplify_expr): Same. + Comment out calls to genericize_*_block. Comment out call to + gimplify_for_stmt. + + 2008-07-27 H.J. Lu + + PR c++/36944 + * class.c (type_has_user_provided_default_constructor): Handle + default parameters. + + 2008-07-27 Paolo Carlini + + * decl.c (push_library_fn): Add a parameter for the exceptions that + the function may throw. + (push_void_library_fn, push_throw_library_fn, expand_static_init): + Adjust. + (build_library_fn): Change to static. + * cp-tree.h: Adjust declarations. + * except.c (declare_nothrow_library_fn): New. + (do_get_exception_ptr, do_begin_catch, do_free_exception, + do_allocate_exception): Use the latter, adjust the declarations + (ie, add empty exception-specification), consistently with the + actual implementation in libsupc++. + + 2008-07-25 Jan Hubicka + + * typeck.c (inline_conversion): Remove. + (cp_build_function_call): Do not use inline_conversion. + * decl.c (duplicate_decls): Do not insist on inline being declared + early. + (start_cleanup_fn): Do not assume that INLINE flags prevent function + from being output. We now remove static functions always. + (finish_function): Do return warning on all static functions. + * call.c (build_over_call): Do not use inline_conversion. + * cp-tree.h (possibly_inlined_p): Declare. + (inline_conversion): Remove. + * pt.c (instantiate_decl): Use possibly_inlined_p predicate. + * decl2.c (cp_write_global_declarations): Likewise. + (mark_used): Likewise. + (possibly_inlined_p): New functions. + + 2008-07-25 Jason Merrill + + * class.c (type_has_user_provided_default_constructor): Handle + templates. + + 2008-07-23 Jan Hubicka + + * decl.c (duplicate_decls): Update comment and unit-at-a-time. + (grogfndecl): Drop flag_inline_trees code. + * pt.c (instantiate_decl): Drop flag_iline_trees code. + * lex.c (cxx_init): Do not set unit-at-a-time. + + 2008-07-23 Jason Merrill + + * mangle.c (write_unqualified_name): Avoid infinite recursion when + trying to mangle a decl with no name. + + Implement defaulted/deleted functions as per N2346 + * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield. + (DECL_DELETED_FN): New macro. + (DECL_DEFAULTED_FN): New macro. + * class.c (user_provided_p): New fn. + (defaultable_fn_p): New fn. + (type_has_user_provided_constructor): New fn. + (type_has_user_provided_default_constructor): New fn. + (check_methods): A defaulted fn is still trivial. + (check_bases_and_members): Likewise. + * decl.c (grok_special_member_properties): Likewise. + (duplicate_decls): Complain about redeclaring a function as deleted. + (start_decl): initialized==2 means deleted. + (cp_finish_decl): Handle deleted/defaulted semantics. + * decl2.c (grokfield): Likewise. + (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL. + Complain about using a deleted fn. + * init.c (build_value_init_1): Use type_has_user_provided_constructor. + (perform_member_init): Check for a user-provided default constructor + even if TYPE_NEEDS_CONSTRUCTING. + (build_new_1): Likewise. + * call.c (build_over_call): Don't call mark_used twice. + * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN. + * search.c (check_final_overrider): Check for deleted mismatch. + * parser.c (cp_parser_init_declarator): Tell start_decl about =delete. + (cp_parser_pure_specifier): Handle =default and =delete. + + * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well. + + 2008-07-23 Manuel Lopez-Ibanez + + PR 35058 + * typeck.c: All calls to pedwarn changed. + * decl.c: All calls to pedwarn changed. + * call.c: All calls to pedwarn changed. + * error.c: All calls to pedwarn changed. + * typeck2.c: All calls to pedwarn changed. + * pt.c: All calls to pedwarn changed. + * name-lookup.c: All calls to pedwarn changed. + * parser.c: All calls to pedwarn changed. + + 2008-07-21 Ralf Wildenhues + + * call.c: Fix comment typos. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cxx-pretty-print.c: Likewise. + * decl.c: Likewise. + * init.c: Likewise. + * name-lookup.c: Likewise. + * operators.def: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + + 2008-07-21 Paolo Carlini + + PR c++/36871 + PR c++/36872 + * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check + copy constructors and copy assignment operators proper. + + 2008-07-21 Rafael Ãvila de Espíndola + + * parser.c (cp_token): Remove in_system_header. + (eof_token): Remove in_system_header. + (cp_lexer_get_preprocessor_token): Don't set in_system_header. + (cp_lexer_set_source_position_from_token): Don't set in_system_header. + (cp_parser_member_declaration): Use in_system_header_at. + * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER. + (pop_tinst_level): Don't set in_system_header. + (instantiate_class_template): Don't set in_system_header. + (instantiate_decl): Don't set in_system_header. + (instantiate_pending_templates): Don't set in_system_header. + + 2008-07-21 Paolo Carlini + + PR c++/36870 + * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use + TYPE_NOTHROW_P, not TREE_NOTHROW. + (trait_expr_value): Likewise. + + 2008-07-18 Dodji Seketeli + + PR c++/36407 + * call.c (convert_like_real): Don't take the error code path + when a rvalue or base conversion has the bad_p field set. + + 2008-07-18 Kris Van Hees + + * rtti.c (emit_support_tinfos): Add char16_type_node and + char32_type_node. + * typeck2.c (digest_init): Support char16_t and char32_t. + + 2008-07-18 Kavih R. Ghazi + + * cvt.c (convert_to_void): Avoid C++ keywords. + * decl.c (walk_namespaces_r, wrapup_globals_for_namespace): + Likewise. + * friend.c (is_friend): Likewise. + * init.c (perform_member_init): Likewise. + * mangle.c (write_template_prefix, write_template_template_param): + Likewise. + * name-lookup.c (do_namespace_alias, do_using_directive, + parse_using_directive, ambiguous_decl, arg_assoc): Likewise. + * parser.c (cp_parser_template_id, cp_parser_namespace_definition, + cp_parser_objc_typename, cp_parser_objc_method_keyword_params): + Likewise. + * pt.c (is_specialization_of_friend, lookup_template_class, + push_tinst_level, instantiate_class_template, + tsubst_copy_and_build): Likewise. + * tree.c (add_stmt_to_compound): Likewise. + * typeck.c (finish_class_member_access_expr): Likewise. + + 2008-07-17 Julian Brown + Mark Mitchell + + * decl2.c (determine_visibility): Allow target to override + visibility of class data. + + 2008-07-17 Paolo Carlini + + PR c++/36855 + * semantics.c (trait_expr_value): Update __has_trivial_destructor + semantics to the current WP (N2691). + + 2008-07-16 Dodji Seketeli + + PR c++/13699 + * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function. + (pushdecl_maybe_friend): Check if a redeclaration of extern C function + complies with exception specification constraints. + + 2008-07-14 Jason Merrill + + * lex.c (init_reswords): Always set D_OBJC. + + 2008-07-11 Tom Tromey + Ian Lance Taylor + + * lex.c (struct resword, reswords): Don't define. + (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define. + (init_reswords): Clarify mask code. Use c_common_reswords rather + than reswords. + + 2008-07-11 Dodji Seketeli + + PR c++/13101 + * decl.c (grokdeclarator): Warn about initializing variables + of storage class 'extern' only after the type of the declarator + has been properly computed. + + 2008-07-11 Dodji Seketeli + + PR c++/31754 + * cp-tree.h (struct cp_decl_specifier_seq): Add a location field. It + carries the location of the primary type. + * parser.c (cp_parser_check_type_definition): Update documentation. + (cp_parser_check_for_definition_in_return_type, + cp_parser_check_for_invalid_template_id, + cp_parser_set_decl_spec_type, + cp_parser_check_for_definition_in_return_type, + cp_parser_diagnose_invalid_type_name, + cp_parser_new_expression, cp_parser_explicit_instantiation, + cp_parser_type_specifier, cp_parser_simple_type_specifier, + cp_parser_omp_for_loop, cp_parser_pragma): Use location in error + messages. + + 2008-07-11 Dodji Seketeli + + PR c++/31754 + * pt.c, semantic.c: + * semantic.c (qualified_name_lookup_error, finish_id_expression): + Add a location_t parameter so that + error message can have a more accurate location. + * cp-tree.h: Updated prototype + * pt.c (tsubst_qualified_id): Use location in error messages. + * parser.c (cp_parser_postfix_expression, + cp_parser_objc_statement, cp_parser_trait_expr, + cp_parser_token_is_class_key, + cp_parser_uncommitted_to_tentative_parse_p, + cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal, + cp_parser_error, cp_parser_name_lookup_error, + cp_parser_simulate_error, cp_parser_check_decl_spec, + cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression, + cp_parser_diagnose_invalid_type_name, + cp_parser_parse_and_diagnose_invalid_type_name, + cp_parser_require_pragma_eol, cp_parser_make_typename_type, + cp_parser_string_literal, cp_parser_primary_expression, + cp_parser_primary_expression, cp_parser_unqualified_id, + cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression, + cp_parser_postfix_dot_deref_expression, cp_parser_new_expression, + cp_parser_direct_new_declarator, cp_parser_builtin_offsetof, + cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt, + cp_parser_jump_statement, cp_parser_block_declaration, + cp_parser_simple_declaration, cp_parser_decl_specifier_seq, + cp_parser_function_specifier_opt, cp_parser_decltype, + cp_parser_mem_initializer_list, cp_parser_mem_initializer, + cp_parser_mem_initializer_id, cp_parser_template_parameter, + cp_parser_type_parameter, cp_parser_template_id, + cp_parser_template_name, cp_parser_template_argument): Likewise. + + 2008-07-09 Paolo Carlini + + PR c++/36760 + * pt.c (tsubst_function_type): Remove warning for type qualifiers + on function return type. + + 2008-07-09 Paolo Carlini + + PR c++/36760 + * pt.c (tsubst_function_type): Don't warn for type qualifiers + on function return type in case of system header. + + 2008-07-09 Raksit Ashok + + * parser.c (cp_parser_postfix_expression): New warning based on flag + warn_disallowed_functions. + + 2008-07-08 Simon Martin + + PR c++/34963 + * decl.c (grokdeclarator): Reset storage_class and staticp for friend + functions declared with a storage class qualifier. + + 2008-07-03 Richard Guenther + + PR c++/36128 + * typeck.c (cp_build_function_call): Move code to verify + builtin function arguments ... + * call.c (build_cxx_call): ... here. + + 2008-07-02 Jason Merrill + + * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency. + + Implement WG21 N2672, Initializer List proposed wording + * cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE. + (struct lang_type_class): Add has_list_ctor bitfield. + (TYPE_HAS_LIST_CTOR): New macro. + (BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node. + (CONSTRUCTOR_IS_DIRECT_INIT): New macro. + (LOOKUP_NO_NARROWING): New macro. + (LOOKUP_NO_COPY_CTOR_CONVERSION): New macro. + * parser.c (cp_parse_braced_list): Split out from... + (cp_parser_initializer_clause): ...here. + (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound + literal here. + (cp_lexer_next_token_is_not_keyword): New fn. + (cp_parser_parenthesized_expression_list): Handle { }. + (cp_parser_new_expression, cp_parser_new_initializer): Likewise. + (cp_parser_assignment_expression, cp_parser_condition): Likewise. + (cp_parser_jump_statement, cp_parser_simple_declaration): Likewise. + (cp_parser_mem_initializer, cp_parser_init_declarator): Likewise. + (cp_parser_initializer, cp_parser_functional_cast): Likewise. + (cp_parser_omp_for_loop, cp_parser_cache_group): Likewise. + (cp_parser_save_member_function_body): Likewise. + * call.c (conversion_kind): Add ck_list, ck_aggr. + (struct conversion): Add check_narrowing bitfield, conversion list. + (build_list_conv): New fn. + (build_aggr_conv): New fn. + (implicit_conversion): Call them. + (standard_conversion): Set check_narrowing if appropriate. + (add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION. + (build_user_type_conversion_1): When converting from an init list, + we allow additional conversions except when calling a copy ctor. + (convert_like_real): Calling an explicit ctor for an init list is + ill-formed. Handle ck_list and ck_addr. Check narrowing. + (build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and + class doesn't have a list ctor, break the {} into a TREE_LIST. + (compare_ics): ck_list is better than other UDCs. + (set_up_extended_ref_temp): Split out from initialize_reference. + (is_std_init_list): New fn. + (is_list_ctor): New fn. + * decl.c (cxx_init_decl_processing): Create init_list_type_node. + (reshape_init_array_1): Pass it to build_constructor. + (reshape_init_class): Ditto. + (initialize_artificial_var): Pass the appropriate type. + (build_aggr_init_full_exprs): Split out from... + (check_initializer): ...here. Handle new semantics. + (build_init_list_var_init): New subroutine of check_initializer. + (grokdeclarator): Converting constructors can have more than one parm. + (grok_special_member_properties): Set TYPE_HAS_LIST_CTOR. + * init.c (expand_default_init): Only do digest_init for aggregates. + * rtti.c (tinfo_base_init): Pass init_list_type_node to + build_constructor_from_list. + (generic_initializer, ptr_initializer): Ditto. + (ptm_initializer, class_initializer): Ditto. + (get_pseudo_ti_init): Ditto. + * error.c (dump_type): Handle init_list_type_node. + (maybe_warn_cpp0x): New fn. + (maybe_varn_variadic_templates): Call it. + * cvt.c (ocp_convert): Handle conversion from { }. + * tree.c (build_array_of_n_type): New fn. + * typeck2.c (store_init_value): Use init_list_type_node. + (digest_init): Likewise. + (check_narrowing): New fn. + * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead + of vector of constructor elts. Handle non-aggregate types. Make + constant literals static. + * pt.c: (tsubst_copy_and_build): Adjust. + (unify): Handle { }. + * name-lookup.c (arg_assoc_type): Handle init_list_type_node. + + 2008-07-01 Daniel Jacobowitz + + * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p. + (comp_ptr_ttypes_const): Likewise. + + 2008-07-01 Andrew Haley + + * decl.c (finish_constructor_body): Don't set the return value of + the constructor if the constructor is that of a Java type. + + 2008-06-30 Jakub Jelinek + + PR c++/36662 + * decl2.c (is_late_template_attribute): If the first attribute + argument is IDENTIFIER_NODE, don't consider it when checking + if arguments are value or type dependent. + + 2008-06-29 Paolo Carlini + + PR c++/36655 + * pt.c (do_type_instantiation): In c++0x mode do not warn for + extern template. + + 2008-06-29 Kaveh R. Ghazi + + * Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN). + + 2008-06-28 Jakub Jelinek + + PR c++/36364 + * repo.c (repo_emit_p): Put const static data members initialized + by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN + for it is 0. + + 2008-06-27 Paolo Carlini + + PR c++/36655 + * pt.c (do_decl_instantiation): In c++0x mode do not warn for + extern template. + + 2008-06-24 Jonathan Wakely + + PR c++/23194 + * typeck.c (cp_build_function_call): Show example syntax in + diagnostic. + + 2008-06-21 Jonathan Wakely + + * typeck.c (composite_pointer_type_r, cxx_sizeof_expr, + cxx_alignof_expr, check_template_keyword, cp_build_binary_op, + pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list, + build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change + pedwarn to permerror. + * init.c (perform_member_init, build_new_1, build_new): Likewise. + * decl.c (warn_extern_redeclared_static, duplicate_decls, + * identify_goto, check_previous_goto_1, check_goto, define_label, + check_tag_decl, start_decl, check_class_member_definition_namespace, + grokfndecl, grokdeclarator): Likewise. + * except.c (check_handlers): Likewise. + * typeck2.c (digest_init): Likewise. + * pt.c (check_specialization_namespace, + check_explicit_instantiation_namespace, + maybe_process_partial_specialization, check_explicit_specialization, + convert_template_argument, do_decl_instantiation, + do_type_instantiation, instantiate_decl): Likewise. + * semantics.c (finish_template_type_parm): Likewise. + * name-lookup.c (pushdecl_maybe_friend, + check_for_out_of_scope_variable): Likewise. + * decl2.c (finish_static_data_member_decl, build_anon_union_vars, + coerce_new_type): Likewise. + * parser.c (cp_parser_nested_name_specifier_opt, + cp_parser_mem_initializer, cp_parser_elaborated_type_specifier, + cp_parser_class_head, cp_parser_check_class_key): Likewise. + (cp_parser_parameter_declaration): Check flag_permissive instead of + flag_pedantic_errors. + * call.c (joust): Change pedwarn to warning. + * friend.c (make_friend_class): Likewise. + + 2008-06-16 Jan Hubicka + + * method.c: Include cgraph.h. + (use_thunk): Use cgraph_add_new_function instead of calling backend + directly. + + 2008-06-15 Ralf Wildenhues + + * parser.c: Fix comment typo. + + 2008-06-14 Simon Martin + + PR c++/35320 + * decl2.c (grokbitfield): Receive the list of attributes, pass it to + grokdeclarator and apply it to the created declaration. + * cp-tree.h (grokbitfield): Update prototype. + * parser.c (cp_parser_member_declaration): Don't apply the attributes + since they are now applied in grokbitfield. Adjusted the call to + grokbitfield. + (cp_parser_objc_class_ivars): Likewise. + + 2008-06-14 Simon Martin + + PR c++/35317 + * class.c (type_requires_array_cookie): Do not consider delete[] + operators with an ellipsis as second argument. + + 2008-06-09 Jakub Jelinek + + PR c++/36408 + * semantics.c (stmt_expr_value_expr): Don't crash on empty + STATEMENT_LIST. + + 2008-06-08 Paolo Carlini + + PR c++/35242 + * pt.c (maybe_process_partial_specialization): Check the tree + returned by push_template_decl for error_mark_node. + * parser.c (cp_parser_class_head): Likewise, check the tree + returned by the latter. + + 2008-06-07 Paolo Carlini + + PR c++/35327 + * decl.c (grokdeclarator): In case of wrong return type return + immediately error_mark_node. + + 2008-06-06 Jakub Jelinek + + * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info, + dependent_omp_for_p, begin_omp_task, finish_omp_task, + finish_omp_taskwait): New prototypes. + (cxx_omp_clause_default_ctor): Add outer argument. + (finish_omp_for): Add new clauses argument. + * cp-gimplify.c (cxx_omp_finish_clause): New function. + (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten. + (cxx_omp_clause_default_ctor): Add outer argument. + (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT. + * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define. + * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops. + Add par_clauses argument. If decl is present in parallel's + lastprivate clause, change that clause to shared and add + a lastprivate clause for decl to OMP_FOR_CLAUSES. + Fix wording of error messages. Adjust finish_omp_for caller. + Add clauses argument. Parse loops with random access iterators. + (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New + functions. + (cp_parser_omp_for, cp_parser_omp_parallel): Adjust + cp_parser_omp_for_loop callers. + (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper + functions. + (cp_parser_omp_clause_name): Handle collapse and untied + clauses. + (cp_parser_omp_clause_schedule): Handle auto schedule. + (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE + and PRAGMA_OMP_CLAUSE_UNTIED. + (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE. + (OMP_TASK_CLAUSE_MASK): Define. + (cp_parser_omp_task, cp_parser_omp_taskwait): New functions. + (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK. + (cp_parser_pragma): Handle PRAGMA_OMP_TASK and + PRAGMA_OMP_TASKWAIT. + * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and + OMP_CLAUSE_UNTIED. Handle OMP_CLAUSE_LASTPRIVATE_STMT. + (tsubst_omp_for_iterator): New function. + (dependent_omp_for_p): New function. + (tsubst_expr) : Use it. Handle collapsed OMP_FOR + loops. Adjust finish_omp_for caller. Handle loops with random + access iterators. Adjust for OMP_FOR_{INIT,COND,INCR} changes. + (tsubst_expr): Handle OMP_TASK. + * semantics.c (cxx_omp_create_clause_info): New function. + (finish_omp_clauses): Call it. Handle OMP_CLAUSE_UNTIED and + OMP_CLAUSE_COLLAPSE. + (cxx_omp_predetermined_sharing): Removed. + * semantics.c (finish_omp_for): Allow pointer iterators. Use + handle_omp_for_class_iterator and dependent_omp_for_p. Handle + collapsed for loops. Adjust c_finish_omp_for caller. Add new + clauses argument. Fix check for type dependent cond or incr. + Set OMP_FOR_CLAUSES to clauses. Use cp_convert instead of + fold_convert to convert incr amount to difference_type. Only + fold if not in template. If decl is mentioned in lastprivate + clause, set OMP_CLAUSE_LASTPRIVATE_STMT. Handle loops with random + access iterators. Adjust for OMP_FOR_{INIT,COND,INCR} + changes. + (finish_omp_threadprivate): Allow static class members of the + current class. + (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task, + finish_omp_taskwait): New functions. + + * parser.c (cp_parser_binary_expression): Add prec argument. + (cp_parser_assignment_expression): Adjust caller. + * cp-tree.h (outer_curly_brace_block): New prototype. + * decl.c (outer_curly_brace_block): No longer static. + + 2008-06-02 Paolo Carlini + + PR c++/36404 + * pt.c (push_template_decl_real): Consistently return error_mark_node + on error. + + 2008-06-02 Tomas Bily + + * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT. + (cp_build_unary_op): Likewise. + (cp_build_indirect_ref): Use CONVERT_EXPR_P. + (maybe_warn_about_returning_address_of_local): Likewise. + + 2008-05-29 Paolo Carlini + + PR c++/35243 + * pt.c (tsubst_initializer_list): Consistently check the tree + returned by tsubst_pack_expansion for error_mark_node. + + 2008-05-27 Michael Matz + + PR c++/27975 + * call.c (build_new_op): Make warning conditional on + OPT_Wenum_compare. + + 2008-05-27 Alexandre Oliva + + PR c++/35909 + * call.c (convert_like_real): Convert bitfield to desired type + before creating temporary. + + 2008-05-26 Daniel Franke + + * Makefile.in: Adjusted dependencies on c-incpath.o. + + 2008-05-23 Jakub Jelinek + + PR c++/36237 + * cp-gimplify.c (cxx_omp_clause_apply_fn): Call + fold_build_cleanup_point_expr on build_call_a results. + + PR c++/36308 + * semantics.c (omp_clause_info_fndecl): New function. + (finish_omp_clauses): Use it. + + 2008-05-21 Jakub Jelinek + + PR c++/36023 + * cp-tree.h (check_array_initializer): New prototype. + * decl.c (check_array_initializer): New function. + (check_initializer): Call it. + * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs. + + 2008-05-21 Tom Tromey + + * mangle.c (save_partially_mangled_name): Remove. + (restore_partially_mangled_name): Likewise. + (write_encoding): Update. + (write_unqualified_name): Likewise. + (start_mangling): Always use name_obstack. Remove 'ident_p' + argument. + (get_identifier_nocopy): Remove. + (finish_mangling_internal): Rename from finish_mangling. + (finish_mangling): New function. + (finish_mangling_get_identifier): Likewise. + (partially_mangled_name, partially_mangled_name_len): Remove. + (mangle_decl_string): Change return type. Update. + (mangle_decl, mangle_type_string, mangle_special_for_type, + mangle_ctor_vtbl_for_type, mangle_thunk, mangle_guard_variable, + mangle_ref_init_variable): Update. + + 2008-05-12 Paolo Carlini + + PR c++/35331 + * semantics.c (begin_class_definition): Extend checks on the first + argument. + + 2008-05-12 Tomas Bily + + * typeck2.c (digest_init): Use CONVERT_EXPR_P. + * call.c (build_over_call): Likewise. + * error.c (dump_expr): Use CASE_CONVERT. + * class.c (fixed_type_or_null): Likewise. + + 2008-05-11 Volker Reichelt + + * parser.c (cp_parser_omp_clause_reduction): Add missing "expected" + in error message. + (cp_parser_omp_clause_schedule): Remove superfluous "expected" + in error message. + + 2008-05-07 Kenneth Zadeck + + * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY, + DECL_LOOPING_CONST_OR_PURE_P attributes. + * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to + DECL_PURE_P. + + 2008-05-02 Simon Baldwin + + PR bootstrap/36108 + * typeck.c (build_array_ref): Remove warn_array_subscript_range. + + 2008-05-01 Simon Baldwin + + * typeck.c (build_array_ref): Call warn_array_subscript_range. + + 2008-04-30 Jakub Jelinek + + PR c++/35986 + * pt.c (more_specialized_fn): Stop the loop even if there are no + arguments before ellipsis. + + 2008-04-29 Jakub Jelinek + + PR c++/35650 + * parser.c (cp_parser_lookup_name): Look through single function + OVERLOAD. + + PR c++/35987 + * typeck.c (cp_build_modify_expr) : Don't build + COMPOUND_EXPR if the second argument would be error_mark_node. + + 2008-04-28 Jason Merrill + Liu Guanwei + + PR c++/57 + * parser.c (cp_parser_parameter_declaration): Handle < ambiguity + in default arguments. + + 2008-04-25 Jan Hubicka + + * typeck.c (check_return_expr): Update. + * decl.c (start_preparsed_function): Update. + * method.c (use_thunk): Update. + + 2008-04-24 Jakub Jelinek + + PR c++/35758 + * cp-tree.h (cp_reconstruct_complex_type): New prototype. + * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define. + * decl2.c (is_late_template_attribute): Only make vector_size + late tmpl attribute if argument is type or value dependent. + (cp_reconstruct_complex_type): New function. + + 2008-04-24 Richard Guenther + + * typeck.c (cp_build_function_call): Call + check_builtin_function_arguments. + + 2008-04-23 Paolo Bonzini + + * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT. + (build_ptrmemfunc1): Don't set TREE_INVARIANT. + * init.c (build_zero_init): Don't set TREE_INVARIANT. + * class.c (build_base_path): Don't set TREE_INVARIANT. + (build_vtbl_ref_1): Don't set TREE_INVARIANT. + (build_vtbl_initializer): Don't set TREE_INVARIANT. + * decl.c (build_enumerator): Don't set TREE_INVARIANT. + * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT. + (generic_initializer): Don't set TREE_INVARIANT. + (ptr_initializer): Don't set TREE_INVARIANT. + (ptm_initializer): Don't set TREE_INVARIANT. + (class_initializer): Don't set TREE_INVARIANT. + * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT. + * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT. + (build_template_parm_index): Don't set TREE_INVARIANT. + (reduce_template_parm_level): Don't set TREE_INVARIANT. + (process_template_parm): Don't set TREE_INVARIANT. + + 2008-04-22 Jason Merrill + + PR c++/35316 + * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE + to see if DECL_BIT_FIELD_TYPE should be used, not some other flag. + * typeck.c (is_bitfield_expr_with_lowered_type): Likewise. + + 2008-04-22 Jakub Jelinek + + PR c++/35747 + * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt + expression is errorneous. + + 2008-04-21 Jason Merrill + + PR c++/35325 + * tree.c (cp_tree_equal): Handle FIXED_CST. + + PR c++/35678 + * pt.c (template_template_parm_bindings_ok_p): Set + processing_template_decl while in this function. + + 2008-04-18 Kris Van Hees + + * cvt.c (type_promotes_to): Support char16_t and char32_t. + * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on + char16_t and char32_t. + * lex.c (reswords): Add char16_t and char32_t (for c++0x). + * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor + extended builtin type "u8char{16,32}_t". + * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support + RID_CHAR{16,32}. + (cp_lexer_print_token): Support CPP_STRING{16,32}. + (cp_parser_is_string_literal): Idem. + (cp_parser_string_literal): Idem. + (cp_parser_primary_expression): Support CPP_CHAR{16,32} and + CPP_STRING{16,32}. + (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}. + * tree.c (char_type_p): Support char16_t and char32_t as char types. + * typeck.c (string_conv_p): Support char16_t and char32_t. + + 2008-04-17 Jason Merrill + + PR c++/35773 + * call.c (build_user_type_conversion_1): Represent second step of + copy-init with an rvalue conversion. + (convert_like_real) [ck_user]: Don't implicitly add it here. + + 2008-04-15 Jakub Jelinek + + PR c/35751 + * decl.c (layout_var_decl): If extern or static var has variable + size, set TREE_TYPE (decl) to error_mark_node. + + 2008-04-16 Danny Smith + + PR target/35921 + * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag + to clone. + + 2008-04-09 Jason Merrill + + PR c++/35708 + * semantics.c (finish_compound_literal): Return a TARGET_EXPR, + not a pushed variable. + + 2008-04-09 Volker Reichelt + + * call.c (build_op_delete_call): Fix quotation in warning message. + * decl.c (grokdeclarator): Quote keyword in error message. + * pt.c (check_for_bare_parameter_packs): Fix quotation in error + message. + + * parser.c (cp_parser_check_type_definition): Print error string + directly rather than using "%s". + (cp_parser_postfix_expression): Fix quotation. + (cp_parser_decltype): Likewise. + (cp_parser_sizeof_operand): Fix quotation. Simplify. + + * parser.c (cp_parser_non_integral_constant_expression): Build error + message with CONCAT rather than using "%s". + (cp_parser_primary_expression): Fix quotation. + (cp_parser_postfix_expression): Likewise. + (cp_parser_postfix_dot_deref_expression): Likewise. + (cp_parser_unary_expression): Likewise. + (cp_parser_new_expression): Likewise. + (cp_parser_delete_expression): Likewise. + + * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN + as `)', not as `('. Fix quotation. + (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation. + (cp_parser_primary_expression): Likewise. + (cp_parser_nested_name_specifier_opt): Likewise. + (cp_parser_postfix_expression): Likewise. + (cp_parser_postfix_open_square_expression): Likewise. + (cp_parser_parenthesized_expression_list): Likewise. + (cp_parser_pseudo_destructor_name): Likewise. + (cp_parser_new_expression): Likewise. + (cp_parser_direct_new_declarator): Likewise. + (cp_parser_delete_expression): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_question_colon_clause): Likewise. + (cp_parser_builtin_offsetof): Likewise. + (cp_parser_trait_expr): Likewise. + (cp_parser_label_for_labeled_statement): Likewise. + (cp_parser_compound_statement): Likewise. + (cp_parser_selection_statement): Likewise. + (cp_parser_condition): Likewise. + (cp_parser_iteration_statement): Likewise. + (cp_parser_already_scoped_statement): Likewise. + (cp_parser_simple_declaration): Likewise. + (cp_parser_linkage_specification): Likewise. + (cp_parser_static_assert): Likewise. + (cp_parser_decltype): Likewise. + (cp_parser_conversion_function_id): Likewise. + (cp_parser_operator_function_id): Likewise. + (cp_parser_operator): Likewise. + (cp_parser_type_parameter): Likewise. + (cp_parser_template_id): Likewise. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_explicit_specialization): Likewise. + (cp_parser_enum_specifier): Likewise. + (cp_parser_namespace_definition): Likewise. + (cp_parser_namespace_alias_definition): Likewise. + (cp_parser_using_declaration): Likewise. + (cp_parser_using_directive): Likewise. + (cp_parser_asm_definition): Likewise. + (cp_parser_direct_declarator): Likewise. + (cp_parser_ptr_operator): Likewise. + (cp_parser_parameter_declaration_clause): Likewise. + (cp_parser_initializer_clause): Likewise. + (cp_parser_class_specifier): Likewise. + (cp_parser_member_specification_opt): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_pure_specifier): Likewise. + (cp_parser_constant_initializer): Likewise. + (cp_parser_base_clause): Likewise. + (cp_parser_exception_specification_opt): Likewise. + (cp_parser_try_block): Likewise. + (cp_parser_function_try_block): Likewise. + (cp_parser_handler): Likewise. + (cp_parser_throw_expression): Likewise. + (cp_parser_asm_operand_list): Likewise. + (cp_parser_attributes_opt): Likewise. + (cp_parser_label_declaration): Likewise. + (cp_parser_constructor_declarator_p): Likewise. + (cp_parser_template_declaration_after_export): Likewise. + (cp_parser_single_declaration): Likewise. + (cp_parser_objc_message_expression): Likewise. + (cp_parser_objc_message_args): Likewise. + (cp_parser_objc_encode_expression): Likewise. + (cp_parser_objc_defs_expression): Likewise. + (cp_parser_objc_protocol_expression): Likewise. + (cp_parser_objc_selector_expression): Likewise. + (cp_parser_objc_protocol_refs_opt): Likewise. + (cp_parser_objc_typename): Likewise. + (cp_parser_objc_method_keyword_params): Likewise. + (cp_parser_objc_superclass_or_category): Likewise. + (cp_parser_objc_try_catch_finally_statement): Likewise. + (cp_parser_objc_synchronized_statement): Likewise. + (cp_parser_objc_throw_statement): Likewise. + (cp_parser_omp_var_list_no_open): Likewise. + (cp_parser_omp_clause_default): Likewise. + (cp_parser_omp_clause_if): Likewise. + (cp_parser_omp_clause_num_threads): Likewise. + (cp_parser_omp_clause_reduction): Likewise. + (cp_parser_omp_clause_schedule): Likewise. + (cp_parser_omp_critical): Likewise. + (cp_parser_omp_for_loop): Likewise. + (cp_parser_omp_sections_scope): Likewise. + + * parser.c (cp_parser_template_parameter_list): Simplify. + + 2008-04-07 James E. Wilson + + * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len. + + 2008-04-07 Jason Merrill + + PR c++/35734 + * class.c (type_has_user_nondefault_constructor): A template + counts as a nondefault constructor. + + 2008-04-04 Paolo Bonzini + + * decl.c (cxx_push_function_context): Delete. + (cxx_pop_function_context): Delete. + (start_preparsed_function): Merge cxx_push_function_context (!f->decl + code only). + * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT, + LANG_HOOKS_FUNCTION_FINAL): Delete. + (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to + LANG_HOOKS_MISSING_NORETURN_OK_P. + * cp-tree.h (cxx_push_function_context, cxx_pop_function_context): + Delete prototype. + * semantics.c (current_stmt_tree): Fix comment. + + 2008-04-03 Jakub Jelinek + + PR c++/35741 + * semantics.c (finish_offsetof): Undo effect of convert_from_reference + before calling fold_offsetof. + + 2008-04-03 Tom Tromey + + * Make-lang.in (c++_OBJS): New variable. + + 2008-04-03 Paolo Bonzini + + * optimize.c (clone_body): New, from tree-inline.c. + + 2008-04-03 Paolo Bonzini + + * method.c (synthesize_method): Use {push,pop}_function_context. + * name-lookup.c (push_to_top_level): Likewise. + * parser.c (cp_parser_late_parsing_for_member): Likewise. + + 2008-03-30 Volker Reichelt + + PR c++/35578 + * parser.c (cp_parser_decl_specifier_seq): Add location to error + message. + + 2008-03-27 Tom Tromey + + * Make-lang.in: Revert automatic dependency patch. + + 2008-03-27 Douglas Gregor + + PR obj-c++/35704 + * typeck.c (build_x_compound_expr): Use cp_build_compound_expr. + (build_compound_expr): New, for compatibility with C + build_compound_expr. + (cp_build_compound_expr): Renamed from build_compound_expr. + (build_c_cast): New, for compatibility with C build_c_cast. + (cp_build_c_cast): Renamed from build_c_cast. + * init.c (build_vec_delete_1): Fix calls to build_compound_expr. + * decl.c (cxx_maybe_build_cleanup): Ditto. + * cp-tree.h (build_compound_expr): Add C-compatibile prototype. + (cp_build_compound_expr): Renamed from build_compound_expr. + (build_c_cast): Add C-compatible prototype. + (cp_build_c_cast): Renamed from build_c_cast. + * typeck2.c (build_functional_cast): Use cp_build_c_cast. + * parser.c (cp_parser_cast_expression): Fix call to build_c_cast. + + 2008-03-27 Douglas Gregor + + * pt.c (tsubst_copy) : Cope with + tsubst_pack_expansion returning a pack expansion, or a TREE_VEC + ending in a pack expansion, both of which can occur when + substituting into a nested template. + (tsubst_copy_and_build) : When we're + instantiating the sizeof...(X) form, make tsubst_copy do the work. + * parser.c (cp_parser_template_parameter): Deal with unnamed + non-type template parameter packs identified by pack expansions in + the parameter type. + + 2008-03-26 Jakub Jelinek + + PR c++/35546 + * pt.c (apply_late_template_attributes): Don't call tsubst on + first attribute argument if it is IDENTIFIER_NODE. + + PR c++/35332 + * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR + and LTGT_EXPR to pp_expression. + + 2008-03-26 Douglas Gregor + + * pt.c (coerce_template_template_parm): Moved the body of the loop + of coerce_template_template_parms here, to make iteration over a + template argument pack simpler. + Also, allow matching of a template parameter pack in the template + template parameter to a template parameter in the template + template argument. + (coerce_template_template_parms): Deal with variadic template + template parameters. Use coerce_template_template_parm. + (unify): Make sure we coerce the template template argument's + template arguments to the template template parameter's template + parameters, not the other way around. + + 2008-03-25 Tom Tromey + + * Make-lang.in: Remove .o targets. + (cp/g++spec.o): Moved to cp/. Reduce to variable setting. + (GXX_OBJS): Update. + (c++_OBJS): New variable. + (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove. + + 2008-03-25 Douglas Gregor + + * typeck.c (composite_pointer_type_r): Add SFINAE support. + (composite_pointer_type): Ditto. + (common_type): Fix call to composite_pointer_type. + (cxx_sizeof_nowarn): New; used to be a macro. + (cxx_sizeof_expr): Add SFINAE support. + (cxx_alignof_expr): Ditto. + (decay_conversion): Fix calls for SFINAE support. + (rationalize_conditional_expr): Add SFINAE support. + (build_class_member_access_expr): Ditto. + (finish_class_member_access_expr): Ditto. + (build_x_indirect_ref): Ditto. + (build_indirect_ref): Original version renamed to + cp_build_indirect_ref; new version provides a bridge from + c-common. + (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE + support. + (get_member_function_from_ptrfunc): Fix calls for SFINAE support. + (build_function_call): Original version renamed to + cp_build_function_call; new version provides a bridge from + c-common. + (cp_build_function_call): Was build_function_call; added SFINAE + support. + (convert_arguments): Add SFINAE support. + (build_x_binary_op): Ditto. + (build_binary_op): Original version renamed to cp_build_binary_op; + new version provides a bridge from c-common. + (cp_build_binary_op): Was build_binary_op; added SFINAE support. + (pointer_diff): Fix calls for SFINAE. + (build_x_unary_op): Add SFINAE support. + (condition_conversion): Fix calls for SFINAE. + (build_unary_op): Original version renamed to cp_build_unary_op; + new version provides a bridge from c-common. + (cp_build_unary_op): Was build_unary_op; added SFINAE support. + (unary_complex_lvalue): Fix calls for SFINAE. + (build_x_conditional_expr): Add SFINAE support. + (build_x_compound_expr_from_list): Fix calls for SFINAE. + (build_x_compound_expr): Add SFINAE support. + (convert_ptrmem): Fix calls for SFINAE. + (build_static_cast_1): Add SFINAE support. + (build_static_cast): Ditto. + (build_reinterpret_cast_1): Ditto. + (build_reinterpret_cast): Ditto. + (build_const_cast_1): Ditto. + (build_const_cast): Ditto. + (build_c_cast): Ditto. + (build_modify_expr): Original version renamed to + cp_build_modify_expr; new version provides a bridge from c-common. + (cp_build_modify_expr): Was build_modify_expr; added SFINAE + support. + (build_x_modify_expr): Add SFINAE support. + (build_ptrmemfunc): Fix calls for SFINAE. + (convert_for_assignment): Add SFINAE support. + (convert_for_initialization): Ditto. + (check_return_expr): Fix calls for SFINAE. + (lvalue_or_else): Add SFINAE support. + * init.c (perform_member_init): Fix calls for SFINAE. + (emit_mem_initializers): Ditto. + (expand_virtual_init): Ditto. + (expand_cleanup_for_base): Ditto. + (build_aggr_init): Add SFINAE support. + (expand_default_init): Ditto. + (expand_aggr_init_1): Fix calls for SFINAE. + (build_offset_ref): Ditto. + (build_new_1): Add SFINAE support. + (build_new): Ditto. + (build_vec_delete_1): Fix calls for SFINAE. + (get_temp_regvar): Ditto. + (build_vec_init): Add SFINAE support. + (build_dtor_call): Fix calls for SFINAE. + (build_delete): Ditto. + (push_base_cleanups): Ditto. + (build_vec_delete_1): Ditto. + * class.c (build_base_path): Fix calls for SFINAE. + (build_simple_base_path): Ditto. + (convert_to_base_statically): Ditto. + (build_vfn_ref): Ditto. + (resolve_address_of_overloaded_function): Ditto. + * decl.c (check_initializer): Fix calls for SFINAE. + (register_dtor_fn): Ditto. + (compute_array_index_type): Ditto. + (finish_enum): Ditto. + (start_preparsed_function): Ditto. + (cxx_maybe_build_cleanup): Ditto. + * call.c (convert_like): Add COMPLAIN argument. + (convert_like_with_context): Ditto. + (build_this): Fix calls for SFINAE. + (build_user_type_conversion): Ditto. + (resolve_args): Ditto. + (build_new_function_call): Add SFINAE support. + (build_operator_new_call): Fix calls for SFINAE. + (build_object_call): Add SFINAE support. + (build_conditional_expr): Ditto. + (build_new_op): Ditto. + (build_op_delete_call): Fix calls for SFINAE. + (build_temp): Ditto. + (convert_like_real): Add SFINAE support. + (build_x_va_arg): Fix calls for SFINAE. + (convert_default_arg): Ditto. + (build_over_call): Add SFINAE support. + (build_java_interface_fn_ref): Fix calls for SFINAE. + (build_special_member_call): Add SFINAE support. + (build_new_method_call): Ditto. + (perform_implicit_conversion): Ditto. + (perform_direct_initialization_if_possible): Ditto. + (initialize_reference): Fix calls for SFINAE. + * method.c (do_build_assign_ref): Fix calls for SFINAE. + * rtti.c (build_headof): Fix calls for SFINAE. + (get_tinfo_decl_dynamic): Ditto. + (get_typeid): Ditto. + (build_dynamic_cast_1): Add SFINAE support. + (build_dynamic_cast): Ditto. + (tinfo_base_init): Fix calls for SFINAE. + * except.c (do_get_exception_ptr): Fix calls for SFINAE. + (do_end_catch): Ditto. + (initialize_handler_parm): Ditto. + (expand_start_catch_block): Ditto. + (do_allocate_exception): Ditto. + (do_free_exception): Ditto. + (build_throw): Ditto. + * cvt.c (build_up_reference): Fix calls for SFINAE. + (convert_to_reference): Ditto. + (ocp_convert): Ditto. + (convert_to_void): Add SFINAE support. + * tree.c (build_dummy_object): Fix calls for SFINAE. + (stabilize_expr): Ditto. + * cp-tree.h (build_conditional_expr): Add tsubst_flags_t + parameter. + (build_new_method_call): Ditto. + (build_special_member_call): Ditto. + (build_new_op): Ditto. + (perform_implicit_conversion): Ditto. + (perform_direct_initialization_if_possible): Ditto. + (convert_to_void): Ditto. + (build_aggr_init): Ditto. + (build_new): Ditto. + (build_vec_init): Ditto. + (build_dynamic_cast): Ditto. + (finish_call_expr): Ditto + (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter. + (cxx_sizeof_nowarn): Remove macro; add function declaration. + (build_class_member_access_expr): Add tsubst_flags_t parameter. + (finish_class_member_access_expr): Ditto. + (build_x_indirect_ref): Ditto. + (cp_build_indirect_ref): New. + (cp_build_function_call): Add tsubst_flags_t parameter. + (build_x_unary_op): Ditto. + (cp_build_unary_op): New. + (build_x_conditional_expr): Add tsubst_flags_t parameter. + (build_x_compound_expr): Ditto. + (build_compound_expr): Ditto. + (build_static_cast): Ditto. + (build_reinterpret_cast): Ditto. + (build_const_cast): Ditto. + (build_c_cast): Ditto. + (build_x_modify_expr): Ditto. + (cp_build_modify_expr): New. + (convert_for_initialization): Add tsubst_flags_t parameter. + (cp_build_binary_op): Remove macro; add function declaration. + (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter. + (lvalue_or_else): Ditto. + (build_functional_cast): Ditto. + * typeck2.c (digest_init): Fix calls for SFINAE. + (process_init_constructor_array): Ditto. + (process_init_constructor_record): Ditto. + (build_x_arrow): Ditto. + (build_m_component_ref): Ditto. + (build_functional_cast): Add SFINAE support. + * pt.c (tsubst_copy_and_build): Add (more) SFINAE support. + * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE. + (finish_expr_stmt): Ditto. + (finish_for_expr): Ditto. + (finish_asm_stmt): Ditto. + (finish_non_static_data_member): Ditto. + (finish_qualified_id_expr): Ditto. + (finish_call_expr): Add SFINAE support. + (finish_increment_expr): Fix calls for SFINAE. + (finish_unary_op_expr): Ditto. + (simplify_aggr_init_expr): Ditto. + (finish_omp_clauses): Ditto. + (finish_omp_for): Ditto. + (finish_omp_barrier): Ditto. + (finish_omo_flush): Ditto. + * decl2.c (grok_array_decl): Fix calls or SFINAE. + (build_anon_union_vars): Ditto. + (get_guard_cond): Ditto. + (set_guard): Ditto. + (one_static_initialization_or_destruction): Ditto. + (do_static_initialization_or_destruction): Ditto. + (generate_ctor_or_dtor_function): Ditto. + (build_offset_ref_call_from_tree): Ditto. + * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE. + (cp_parser_postfix_dot_deref_expression): Ditto. + (cp_parser_unary_expression): Ditto. + (cp_parser_new_expression): Ditto. + (cp_parser_cast_expression): Ditto. + (cp_parser_binary_expression): Ditto. + (cp_parser_question_colon_clause): Ditto. + (cp_parser_assignment_expression): Ditto. + (cp_parser_expression): Ditto. + (cp_parser_builtin_offsetof): Ditto. + (cp_parser_template_argument): Ditto. + (cp_parser_functional_cast): Ditto. + + 2008-03-24 Tom Tromey + + * lex.c (handle_pragma_interface): Don't copy the filename. + (handle_pragma_implementation): Copy filename using xstrdup. + + 2008-03-21 Paolo Carlini + + * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P. + (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P. + (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P. + (PROMOTES_TO_AGGR_TYPE): Remove. + (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust. + * typeck.c (unary_complex_lvalue, build_modify_expr, + convert_for_initialization): Adjust. + * init.c (is_aggr_type): Remove. + (is_class_type): Add. + (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init, + build_delete): Adjust. + * lex.c (make_aggr_type): Remove. + (make_class_type): Add. + (cxx_make_type): Adjust. + * class.c (finish_struct_1, fixed_type_or_null, is_empty_class): + Adjust. + * decl.c (build_typename_type, make_typename_type, + make_unbound_class_template, cxx_init_decl_processing, + check_tag_decl, groktypename, start_decl_1, layout_var_decl, + check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms, + grok_op_properties, xref_tag, check_function_type): Adjust. + * call.c (check_dtor_name, standard_conversion, implicit_conversion, + add_builtin_candidate, add_builtin_candidates, + build_user_type_conversion_1, convert_like_real, build_cxx_call, + is_subseq, compare_ics): Adjust. + * method.c (use_thunk): Adjust. + * rtti.c (build_dynamic_cast_1, create_pseudo_type_info, + create_tinfo_types): Adjust. + * cvt.c (cp_convert_to_pointer, convert_to_pointer_force, + build_up_reference, convert_to_reference, convert_from_reference, + ocp_convert, build_expr_type_conversion): Adjust. + * tree.c (bind_template_template_parm, error_type): Adjust. + * dump.c (cp_dump_tree): Adjust. + * search.c (lookup_member): Adjust. + * friend.c (make_friend_class, do_friend): Adjust. + * typeck2.c (store_init_value, process_init_constructor_array, + process_init_constructor_record, build_x_arrow, build_m_component_ref, + build_functional_cast): Adjust. + * pt.c (finish_member_template_decl, process_template_parm, + lookup_template_class, tsubst_function_type, tsubst, + tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc): + Adjust. + * semantics.c (begin_class_definition, finish_base_specifier, + finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type): + Adjust. + * name-lookup.c (constructor_name_p, push_overloaded_decl, + do_class_using_decl, lookup_qualified_name, + maybe_process_template_type_declaration): Adjust. + * decl2.c (grok_array_decl, check_member_template, + constrain_class_visibility): Adjust. + * parser.c (cp_parser_class_name): Adjust. + + 2008-03-18 Paolo Bonzini + + * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete. + + 2008-03-17 Jason Merrill + + PR c++/35548 + * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding + a temp directly to a reference as per DR391. + + 2008-03-12 Richard Guenther + + PR c++/35469 + Revert: + 2008-02-04 Richard Guenther + + PR java/35035 + * decl.c (record_builtin_java_type): Make jboolean a + integer type again where its mode doesn't match that of bool. + + 2008-01-25 Richard Guenther + + PR c++/33887 + * decl.c (record_builtin_java_type): Make __java_boolean + a variant of bool. + * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check + after TYPE_MAIN_VARIANT check. + + 2008-03-10 Jakub Jelinek + + PR c++/35328 + * semantics.c (finish_omp_clauses): Look through NOP_EXPR even + if errorcount. + + PR c++/35337 + * semantics.c (finish_omp_clauses): Use %qD instead of %qE for + DECL_P in not a variable and appears more than once error messages. + + 2008-03-07 Paolo Bonzini + + Revert: + + 2008-02-06 Douglas Gregor + + PR c++/35049 + PR c++/35096 + * typeck.c (structural_comptypes): Call cp_comptypes. + (comptypes): New; called from the C/C++ common bits to perform + strict checks. + (cp_comptypes): Renamed from comptypes, which is already used, + with a different signature, by the C++ front end. + (build_reinterpret_cast_1): Call cp_comptypes. + (ptr_reasonably_similar): Ditto. + * decl.c (decls_match): Ditto. + * cvt.c (convert_to_reference): Ditto. + * cp-tree.h (same_type_p): Ditto. + (same_or_base_type_p): Ditto. + (comptypes): Rename to cp_comptypes. + * pt.c (canonical_type_parameter): Call cp_comptypes. + + 2008-03-07 Paolo Bonzini + + * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete + test for equivalence between pointer and references. + + 2008-03-02 Manuel Lopez-Ibanez + + PR 24924 + * class.c (finish_struct_anon): Use permerror instead of pedwarn. + (check_field_decls): Likewise. + (note_name_declared_in_class): Likewise. + * call.c (build_new_op): Likewise. + (convert_like_real): Likewise. + (build_over_call): Likewise. + * lex.c (unqualified_fn_lookup_error): Likewise. + * parser.c (cp_parser_template_id): Likewise. + * cvt.c (warn_ref_binding): Likewise. + (convert_to_reference): Likewise. + (ocp_convert): Likewise. + (convert_to_void): Use error instead of pedwarn. + * error.c (cp_cpp_error): Use pedantic_warning_kind. + * decl.c (compute_array_index_type): Use constant_expression_error. + + 2008-03-01 Douglas Gregor + + * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note + that auto is either a storage class or a simple type specifier, + depending on the dialect. + (cp_parser_decl_specifier_seq): Complain about `auto' as a storage + specifier in C++98 mode, error in C++0x mode (since we don't + support auto as a type specifier, yet). + (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a + storage specifier in C++0x mode. + (cp_parser_simple_type_specifier): Parse `auto' as a + simple-type-specifier, but error because we don't support it yet. + + 2008-02-29 Manuel Lopez-Ibanez + + * parser.c (cp_parser_nonclass_name): New. + (cp_parser_pseudo_destructor_name): Use it instead of + cp_parser_type_name. + (cp_parser_type_name): Move code to cp_parser_nonclass_name. + + 2008-02-29 Tom Tromey + + * parser.c (struct cp_token) : Remove. + (cp_lexer_get_preprocessor_token): Update. + (cp_lexer_set_source_position_from_token): Don't call + restore_input_file_stack. + * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc. + + 2008-02-28 Richard Guenther + + Revert: + 2008-02-26 Richard Guenther + + * decl.c (duplicate_decls): Remove decl from global mapping + before ggc_freeing it. + + 2008-02-27 Jakub Jelinek + + PR c++/35368 + * rtti.c: Include c-pragma.h. + (push_abi_namespace, pop_abi_namespace): New functions. + (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index, + create_tinfo_types, emit_support_tinfos): Use them. + * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H). + + 2008-02-26 Jason Merrill + + PR c++/35315 + * decl.c (grokdeclarator): Allow a typedef of an unnamed struct + to name the struct for linkage purposes even if it has attributes. + (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE. + + 2008-02-26 Tom Tromey + + * parser.c (eof_token): Remove old location code. + (check_empty_body): Remove test of USE_MAPPED_LOCATION. + * decl2.c (generate_ctor_or_dtor_function): Remove old location + code. + (cp_write_global_declarations): Likewise. + * lex.c (cxx_init): Remove old location code. + (handle_pragma_implementation): Remove test of + USE_MAPPED_LOCATION. + * pt.c (tsubst): Remove old location code. + * error.c (cp_print_error_function): Remove test of + USE_MAPPED_LOCATION. + * decl.c (pop_label): Remove old location code. + (finish_function): Likewise. + + 2008-02-26 Manuel Lopez-Ibanez + + PR 26264 + * call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START. + + 2008-02-26 Richard Guenther + + * decl.c (duplicate_decls): Remove decl from global mapping + before ggc_freeing it. + + 2008-02-26 Paolo Carlini + + PR c++/35323 + * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE. + + 2008-02-26 Manuel Lopez-Ibanez + + * typeck.c (build_class_member_access_expr): Add appropriate + OPT_W* parameter to warning. + (build_reinterpret_cast_1): Likewise. + * name-lookup.c (push_overloaded_decl): Likewise. + + 2008-02-25 Paolo Carlini + + PR c++/35333 + * error.c (dump_expr): Handle CONJ_EXPR. + + 2008-02-25 Paolo Carlini + + PR c++/35338 + * error.c (dump_type): Handle FIXED_POINT_TYPE. + (dump_expr): Handle FIXED_CST. + + 2008-02-24 Jason Merrill + + * parser.c (cp_parser_declaration): Handle "inline namespace". + (cp_parser_namespace_definition): Likewise. + + PR c++/33486 + * name-lookup.c (arg_assoc_namespace): Look down into inline + namespaces, too. + + 2008-02-23 Manuel Lopez-Ibanez + + * typeck.c (check_for_casting_away_constness): Use 1 single + argument, the type of cast, to decide what diagnostics generate. + (build_static_cast_1): Remove unused code. Update call to + check_for_casting_away_constness. + (build_reinterpret_cast_1): Update call to + check_for_casting_away_constness. + (build_const_cast_1): Likewise. + + 2008-02-24 Paolo Carlini + + * error.c (dump_expr): Don't deal directly with NEW_EXPR (and + VEC_NEW_EXPR), forward to pp_expression. + * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME. + + 2008-02-24 Danny Smith + + PR c++/34749 + * friend.c (do_friend): Call cplus_decl_attributes earlier. + + 2008-02-22 Andrew Pinski + + PR C++/34715 + * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for + template decls' function decl. + + 2008-02-22 Paolo Carlini + + PR c++/35282 + Revert: + 2008-02-14 Paolo Carlini + + PR c++/28743 + * pt.c (determine_specialization): In case of function templates, + when the type of DECL does not match FN there is no match. + + 2008-02-22 Ralf Wildenhues + + PR c/19999 + * typeck.c (build_binary_op): Warn about floating point + comparisons if FLOAT_TYPE_P, not only for REAL_TYPE. + + 2008-02-19 Jason Merrill + + PR c++/34950 + * pt.c (resolve_overloaded_unification): Set processing_template_decl + while we look for possible bindings. + + 2008-02-19 Jakub Jelinek + + PR c++/35028 + * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors. + + PR c++/34964 + PR c++/35244 + * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p + vars. Afterwards ensure v is VAR_DECL. + + PR c++/35078 + * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't + call cp_finish_decl. + * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type + early. + + 2008-02-15 Douglas Gregor + + PR c++/35023 + PR c++/35024 + PR c++/35026 + * pt.c (finish_member_template_decl): If the type in a TYPE_DECL + is error_mark_node, return an error early. + (find_parameter_packs_r): Pass the pointer set along to recursive + calls of cp_walk_subtrees; don't try to manage the pointer set + ourselves. + (uses_parameter_packs): Pass the pointer set to cp_walk_tree. + (make_pack_expansion): Ditto. + (check_for_bare_parameter_packs): Ditto. Also, don't bother taking + a second pass through the tree with find_parameter_packs_r; that + second pass no longer does anything. + (push_template_decl_real): If we have an erroneous declaration, + set its type to error_mark_node before returning an error. + + 2008-02-14 Douglas Gregor + + PR c++/34050 + * pt.c (tsubst_initializer_list): Deal with the use of + VOID_TYPE_NODE to indicate value-initialization of the bases. + + 2008-02-14 Manuel Lopez-Ibanez + Jason Merrill + + PR c++/5645 + PR c++/11159 + * class.c (type_has_user_nondefault_constructor): New fn. + * cp-tree.h: Declare it. + * init.c (emit_mem_initializers): Use it for -W warning about + missing base initializer. + + 2008-02-14 Paolo Carlini + + PR c++/28743 + * pt.c (determine_specialization): In case of function templates, + when the type of DECL does not match FN there is no match. + + 2008-02-13 Jakub Jelinek + Manuel Lopez-Ibanez + + PR c++/35138 + * parser.c (cp_parser_pseudo_destructor_name): If next tokens + are not identifier :: ~, return before calling cp_parser_type_name. + + 2008-02-13 Jason Merrill + + PR c++/34962, c++/34937, c++/34939 + * decl2.c (is_late_template_attribute): Always defer attributes + vector_size and weak. + + PR c++/34774 + * pt.c (value_dependent_expression_p): Look into DECL_INITIAL + of enumerators, too. + + 2008-02-12 Jason Merrill + + PR c++/34824 + * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp + if we're doing conversions to call a user-defined conversion function. + + 2008-02-12 Steven Bosscher + + PR c++/29048 + * semantics.c (finish_qualified_id_expr): Avoid duplicate access + check here, too. + + 2008-02-12 Jakub Jelinek + + PR c++/34862 + * init.c (build_new_1): Don't create placement_expr before + constructing alloc_call. Verify that the pointer is passed by + value to operator new. + + 2008-02-11 Jason Merrill + + PR c++/35097 + * pt.c (tsubst): Don't look up a template typedef in an explicit + specialization. + + 2008-02-11 Douglas Gregor + + PR c++/35113 + * tree.c (cp_build_qualified_type_real): When building a + cv-qualified array type, build it as a unique type with + build_cplus_array_type_1 and then adopt the unqualified type's + main variant. + + 2008-02-11 Paolo Carlini + + PR c++/35077 + * decl.c (groktypename): Check grokdeclarator return. + + 2008-02-10 Jason Merrill + + PR c++/34094 + * decl2.c (cp_write_global_declarations): Don't write out static + data members with DECL_IN_AGGR_P set. + + 2008-02-08 Jason Merrill + + PR c++/35116 + * tree.c (build_target_expr_with_type): Handle void initializer. + (bot_manip): Remap slot before recursing. + + 2008-02-06 Kaveh R. Ghazi + + PR other/35107 + * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS). + + 2008-02-06 Alexandre Oliva + + PR c++/35056 + * tree.c: Include tree-flow.h. + (build_target_expr): Check type compatibility. + * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H). + * call.c (convert_like_real): Convert bitfield to expected type. + + 2008-02-06 Douglas Gregor + + PR c++/35049 + PR c++/35096 + * typeck.c (structural_comptypes): Call cp_comptypes. + (comptypes): New; called from the C/C++ common bits to perform + strict checks. + (cp_comptypes): Renamed from comptypes, which is already used, + with a different signature, by the C++ front end. + (build_reinterpret_cast_1): Call cp_comptypes. + (ptr_reasonably_similar): Ditto. + * decl.c (decls_match): Ditto. + * cvt.c (convert_to_reference): Ditto. + * cp-tree.h (same_type_p): Ditto. + (same_or_base_type_p): Ditto. + (comptypes): Rename to cp_comptypes. + * pt.c (canonical_type_parameter): Call cp_comptypes. + + 2008-02-05 Jakub Jelinek + + PR c++/33553 + * pt.c (tsubst) : Don't issue error if max is + value dependent expression. + + 2008-02-05 Douglas Gregor + + PR c++/35074 + * decl2.c (save_template_attributes): When we're modifying the + TYPE_MAIN_VARIANT to add new attributes, be sure to also modify + all of the other variants to add those same attributes. Otherwise, + the main variant will be inconsistent with those other variants. + + 2008-02-04 Richard Guenther + + PR java/35035 + * decl.c (record_builtin_java_type): Make jboolean a + integer type again where its mode doesn't match that of bool. + + 2008-02-02 Jason Merrill + Mark Mitchell + + PR c++/33916 + * init.c (build_value_init_1): New function. + (build_value_init): New function. + * typeck2.c (build_functional_cast): Call it. + * cp-gimplify.c (cp_gimplify_init_expr): Handle its output. + + * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from + TYPE_HAS_CONSTRUCTOR. + * class.c (finish_struct_bits, maybe_warn_about_overly_private_class, + add_implicitly_declared_members): Adjust. + (check_field_decls): Adjust. Remove warnings about reference/const + in class without constructor. + (check_bases_and_members): Adjust. Give those warnings here instead. + * decl.c (fixup_anonymous_aggr): Adjust. + (check_initializer): Adjust, clarify logic slightly. + (grok_special_member_properties): Adjust, only set if user-provided. + * rtti.c (create_tinfo_types): Don't set. + * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al. + Use same_type_ignoring_top_level_qualifiers_p. + * pt.c (check_explicit_specialization): Adjust. + (instantiate_class_template): Adjust. + + 2008-01-31 Douglas Gregor + Jakub Jelinek + + PR c++/34935 + PR c++/34936 + * typeck.c (structural_comptypes): Handle comparisons of + VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and + REAL_TYPE nodes. + * mangle.c (write_builtin_type): Map down to the canonical type, + which will be one of the predefined type nodes. + + 2008-01-29 Michael Meissner + + PR 35004 + * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16 + bits to allow for expansion of the number of middle end tree + codes. + + 2008-01-29 Douglas Gregor + + PR c++/34055 + PR c++/34103 + PR c++/34219 + PR c++/34606 + PR c++/34753 + PR c++/34754 + PR c++/34755 + PR c++/34919 + PR c++/34961 + * typeck.c (check_return_expr): Tweak call to + check_for_bare_parameter_packs. + * class.c (add_method): Be careful with error_mark_nodes. + * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from + signature. + * pt.c (struct find_parameter_pack_data): Remove + SET_PACKS_TO_ERROR. + (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR. + (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR. + (make_pack_expansion): Ditto. + (check_for_bare_parameter_packs): Parameter is now a tree, not a + tree*. + (process_template_parm): Tweak call to + check_for_bare_parameter_packs. + (push_template_decl_real): Tweak calls to + check_for_bare_parameter_packs. If bare parameter packs are found + in the list of exceptions, clear out that list after giving an + error. + * semantics.c (finish_cond): Tweak call to + check_for_bare_parameter_packs. + (finish_expr_stmt): Ditto. + (finish_for_expr): Ditto. + (finish_switch_cond): Ditto. + (finish_mem_initializers): Ditto. + (finish_member_declaration): Ditto. + (finish_static_assert): Check for bare parameter packs in the + condition. + * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the + attributes of a declaration. + * parser.c (cp_parser_using_declaration): Tweak call to + check_for_bare_parameter_packs. + (cp_parser_base_clause): Ditto. + + 2008-01-28 Jason Merrill + + PR c++/35007 + * class.c (build_base_path): Fix !want_pointer case. + + 2008-01-27 Jason Merrill + + PR c++/27177 + * class.c (build_base_path): Fix previous change. + + 2008-01-26 Jakub Jelinek + + PR c++/34965 + * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR + and TRUTH_XOR_EXPR. + + 2008-01-26 Richard Guenther + + PR c++/34235 + * typeck.c (build_binary_op): Remove code to shorten compares. + + 2008-01-25 Richard Guenther + + PR c++/33887 + * decl.c (record_builtin_java_type): Make __java_boolean + a variant of bool. + * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check + after TYPE_MAIN_VARIANT check. + + 2008-01-25 Jason Merrill + + PR c++/27177 + * class.c (build_base_path): Don't mess with virtual access if + skip_evaluation. + * call.c (standard_conversion): Don't check whether source type + is complete. + + * decl2.c (is_late_template_attribute): Don't defer attribute + visibility just because the type is dependent. + + 2008-01-25 Jason Merrill + Mark Mitchell + + PR c++/31780 + * call.c (standard_conversion): Allow conversion from integer/real + to complex. + (compare_ics): Such a conversion is worse than a normal arithmetic + conversion. + + 2008-01-25 Richard Guenther + + PR c++/33887 + * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define + to true. + + 2008-01-24 Paolo Carlini + + PR c++/34603 + * pt.c (push_template_decl_real): Return error_mark_node in case + of template definition of non-template. + + 2008-01-24 Jason Merrill + + PR c++/34913 + * decl2.c (is_late_template_attribute): Defer any attribute with + dependent args. Also defer type attributes if the type is dependent. + + 2008-01-22 Jakub Jelinek + Alexandre Oliva + + PR c++/33984 + * call.c (reference_binding): For bitfields use the declared bitfield + type. + (add_builtin_candidates): Likewise. + * class.c (layout_class_type): For bitfields copy over the + original type quals. + + 2008-01-22 Jason Merrill + + PR c++/28560 + * decl.c (groktypename): Also ignore attributes on dependent + possibly-class types. + + PR c++/34912 + * friend.c (do_friend): Check for prior declaration of a friend + function of a local class. + * name-lookup.c (lookup_name_innermost_nonclass_level): + No longer static. + * name-lookup.h: Declare it. + + 2008-01-22 Tom Tromey + + PR c++/34829: + * init.c (build_new_1): Only disallow Java aggregates. + + 2008-01-22 Jakub Jelinek + + PR c++/34607 + * semantics.c (finish_omp_for): Don't call c_finish_omp_for + if decl or init is error_mark_node. + + PR c++/34918 + * error.c (dump_expr): Handle VECTOR_CST. + + 2008-01-21 Jason Merrill + + PR c++/33959 + * pt.c (tsubst_aggr_type): Make sure our context is complete. + + PR c++/34573 + * pt.c (retrieve_local_specialization): Robustify. + (tsubst_pack_expansion, tsubst_decl): Remove redundant checks. + + PR c++/34846 + * pt.c (tsubst): Only call retrieve_local_specialization if the + original typedef was in a function template. + + PR c++/34196 + * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP. + + 2008-01-21 Richard Guenther + + PR c++/34850 + * error.c (cp_print_error_function): Deal with recursive + BLOCK trees. + + 2008-01-20 Paolo Carlini + + PR c++/34891 + * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR. + + 2008-01-20 Paolo Carlini + + PR c++/34776 + PR c++/34486 + * name-lookup.c (do_class_using_decl): Do not call constructor_name_p + on non-IS_AGGR_TYPE scope. + (constructor_name_p): Assert IS_AGGR_TYPE. + + 2008-01-18 Ian Lance Taylor + + PR c++/33407 + * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag. + (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set + DECL_IS_OPERATOR_NEW flag. + + 2008-01-16 Richard Guenther + + PR c++/33819 + * typeck.c (is_bitfield_expr_with_lowered_type): Recurse + for conversions to type variants. + + 2008-01-15 Andreas Tobler + + * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing + declaration and code. Update copyright year. + + 2008-01-15 Douglas Gregor + + PR c++/34399 + * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we + know we have a class type. + + 2008-01-15 Douglas Gregor + + PR c++/34751 + * pt.c (coerce_template_parameter_pack): When substituting into + the type of a non-type template parameter pack. use the + deduced/substituted arguments. + * parser.c (declarator_can_be_parameter_pack): A pointer-to-member + can be a parameter pack with the ellipsis following it. When we + have an erroneous declaration, allow it to be a parameter pack. + (cp_parser_template_parameter): Complain about default + arguments on non-type template parameter packs, and parse them + using the new cp_parser_default_argument. + (cp_parser_parameter_declaration): Complain about parameter packs + with default arguments. Move parsing of default arguments into a + new function, cp_parser_default_argument. + (cp_parser_default_argument): New; extracted from + cp_parser_parameter_declaration. + + 2008-01-15 Douglas Gregor + + PR c++/34051 + PR c++/34055 + PR c++/34102 + PR c++/34103 + * typeck.c (check_return_expr): If there are bare parameter packs + in the return value, set it to error_mark_node. + * tree.c (cp_walk_subtrees): Walk USING_DECL nodes. + * pt.c (find_parameter_packs_r): Look at the type of + IDENTIFIER_NODEs (e.g., for user-defined conversions). + (check_for_bare_parameter_packs): Flip the result: now returns + TRUE when there were bare parameter packs, FALSE otherwise. + (push_template_decl_real): Deal with flipped result of + check_for_bare_parameter_packs. + * semantics.c (finish_cond): If there are bare parameter packs in + the conditional, set it to error_mark_node. + (finish_expr_stmt): If there are bare parameter packs in the + expression, set it to error_mark_node. + (finish_for_expr): Ditto. + (finish_switch_cond): If there are bare parameter packs in + the conditional, set it to error_mark_node. + (finish_mem_initializers): If there are bare parameter packs in + the member initializer, set it to error_mark_node. + (finish_member_declaration): Check the attributes of the + declaration for bare parameter packs, and remove the attributes if + any have bare parameter packs. + * parser.c (cp_parser_using_declaration): Check the using + declaration for bare parameter packs. + (cp_parser_base_clause): If there are bare parameter packs in a + base specifier, don't add it to the chain. + + 2008-01-15 Douglas Gregor + + PR c++/34314 + * error.c (dump_simple_decl): Display ellipsis for template + non-type parameter packs. + (dump_decl): Display ellipsis for template type parameter packs. + (dump_template_decl): Display ellipsis for template template + parameter packs. + * pt.c (redeclare_class_template): When redeclaring a class + template, check for collisions between template parameters and + template parameter packs. + + 2008-01-15 Douglas Gregor + + PR c++/33964 + * pt.c (process_partial_specialization): Don't mark template + parameters that occur in non-deduced contexts. + (struct pair_fn_data): Add include_nondeduced_p. + (for_each_template_parm_r): Only visit non-deduced contexts if + include_nondeduced_p is set. + (for_each_template_parm): Added parameter include_nondeduced_p, + which states whether template parameters found in non-deduced + contexts should be visited. + (uses_template_parms): Visit all template parameters, even those + in non-deduced contexts. + + 2008-01-15 Douglas Gregor + + PR c++/34052 + * pt.c (check_default_tmpl_args): Check for parameter packs that + aren't at the end of a primary template. + (push_template_decl_real): Remove check for parameter packs that + aren't at the end of a primary template; that now happens in + check_default_tmpl_args. + * semantics.c (finish_template_template_parm): Use + check_default_tmpl_args to check for errors in the template + parameter list. + + 2008-01-12 Doug Kwan + + * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers + instead of OPT_Wreturn_type in warning due to ignored return type + qualifiers. + * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers + instead of OPT_Wreturn_type in warning due to ignored return type + qualifiers. + + 2008-01-08 Jakub Jelinek + + PR c++/33890 + * semantics.c (finish_omp_for): Don't call + fold_build_cleanup_point_expr if processing_template_decl. + + 2008-01-04 Paolo Carlini + Jakub Jelinek + + PR c++/34611 + * error.c (dump_template_argument): Deal with TREE_LIST. + + 2008-01-01 Douglas Gregor + + * parser.c (cp_parser_check_decl_spec): Don't warn about "long + long" in C++0x mode; change the warning to note that "long long" + is only unsupported in C++98 mode. diff -Nrcpad gcc-4.3.3/gcc/cp/Make-lang.in gcc-4.4.0/gcc/cp/Make-lang.in *** gcc-4.3.3/gcc/cp/Make-lang.in Thu Dec 4 23:00:19 2008 --- gcc-4.4.0/gcc/cp/Make-lang.in Fri Dec 5 08:01:58 2008 *************** g++-cross$(exeext): g++$(exeext) *** 72,78 **** # Shared with C front end: CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \ c-dump.o $(CXX_TARGET_OBJS) c-pretty-print.o c-opts.o c-pch.o \ ! c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \ c-gimplify.o c-omp.o tree-inline.o # Language-specific object files for C++ and Objective C++. --- 72,78 ---- # Shared with C front end: CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \ c-dump.o $(CXX_TARGET_OBJS) c-pretty-print.o c-opts.o c-pch.o \ ! incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \ c-gimplify.o c-omp.o tree-inline.o # Language-specific object files for C++ and Objective C++. *************** CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl. *** 86,97 **** # Language-specific object files for C++. CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS) # Use strict warnings for this front end. ! cp-warn = $(STRICT_WARN) $(CXX_COMPAT_WARN) cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ ! $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) $(GMPLIBS) cc1plus-checksum.c : cc1plus-dummy$(exeext) build/genchecksum$(build_exeext) build/genchecksum$(build_exeext) cc1plus-dummy$(exeext) > $@ --- 86,99 ---- # Language-specific object files for C++. CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS) + c++_OBJS = $(CXX_OBJS) dummy-checksum.o cc1plus-checksum.o cp/g++spec.o + # Use strict warnings for this front end. ! cp-warn = $(STRICT_WARN) cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ ! $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS) cc1plus-checksum.c : cc1plus-dummy$(exeext) build/genchecksum$(build_exeext) build/genchecksum$(build_exeext) cc1plus-dummy$(exeext) > $@ *************** cc1plus-checksum.o : cc1plus-checksum.c *** 100,106 **** cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ ! $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(GMPLIBS) # Special build rules. $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf --- 102,108 ---- cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ ! $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS) # Special build rules. $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf *************** c++.stagefeedback: stagefeedback-start *** 224,230 **** # # .o: .h dependencies. CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \ ! cp/cp-tree.def c-common.def $(FUNCTION_H) $(VARRAY_H) \ $(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) $(GGC_H) \ $(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h --- 226,232 ---- # # .o: .h dependencies. CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \ ! c-common.def $(FUNCTION_H) $(VARRAY_H) \ $(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) $(GGC_H) \ $(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h *************** cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_ *** 241,253 **** debug.h gt-cp-decl.h $(TIMEVAR_H) $(TREE_FLOW_H) $(TARGET_H) cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h $(EXPR_H) \ output.h except.h toplev.h $(RTL_H) $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \ ! $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H) cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) toplev.h \ langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \ $(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h output.h \ ! $(TM_P_H) $(DIAGNOSTIC_H) gt-cp-typeck2.h cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \ toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H) cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ --- 243,255 ---- debug.h gt-cp-decl.h $(TIMEVAR_H) $(TREE_FLOW_H) $(TARGET_H) cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h $(EXPR_H) \ output.h except.h toplev.h $(RTL_H) $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \ ! $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H) $(GIMPLE_H) cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) toplev.h \ langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \ $(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h output.h \ ! $(TM_P_H) $(DIAGNOSTIC_H) gt-cp-typeck2.h $(REAL_H) cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \ toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H) cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ *************** cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_ *** 282,298 **** gt-cp-repo.h cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) except.h toplev.h \ $(FLAGS_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \ ! $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H) cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H) cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h $(INTEGRATE_H) \ ! insn-config.h input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(TREE_GIMPLE_H) \ $(TARGET_H) cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h $(REAL_H) \ gt-cp-mangle.h $(TARGET_H) $(TM_P_H) cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) gt-cp-parser.h \ output.h $(TARGET_H) cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h $(C_COMMON_H) \ ! $(TM_H) coretypes.h pointer-set.h cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h toplev.h \ --- 284,300 ---- gt-cp-repo.h cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) except.h toplev.h \ $(FLAGS_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \ ! $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H) $(GIMPLE_H) cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H) cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h $(INTEGRATE_H) \ ! insn-config.h input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(GIMPLE_H) \ $(TARGET_H) cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h $(REAL_H) \ gt-cp-mangle.h $(TARGET_H) $(TM_P_H) cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) gt-cp-parser.h \ output.h $(TARGET_H) cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h $(C_COMMON_H) \ ! $(TM_H) coretypes.h pointer-set.h tree-iterator.h cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h toplev.h \ diff -Nrcpad gcc-4.3.3/gcc/cp/call.c gcc-4.4.0/gcc/cp/call.c *** gcc-4.3.3/gcc/cp/call.c Fri Jul 18 20:15:22 2008 --- gcc-4.4.0/gcc/cp/call.c Mon Apr 13 20:56:45 2009 *************** *** 1,6 **** /* Functions related to invoking methods and overloaded functions. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and modified by Brendan Kehoe (brendan@cygnus.com). --- 1,6 ---- /* Functions related to invoking methods and overloaded functions. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and modified by Brendan Kehoe (brendan@cygnus.com). *************** typedef enum conversion_kind { *** 54,59 **** --- 54,61 ---- ck_ref_bind, ck_user, ck_ambig, + ck_list, + ck_aggr, ck_rvalue } conversion_kind; *************** struct conversion { *** 96,101 **** --- 98,104 ---- being bound to an lvalue expression or an rvalue reference is being bound to an rvalue expression. */ BOOL_BITFIELD rvaluedness_matches_p: 1; + BOOL_BITFIELD check_narrowing: 1; /* The type of the expression resulting from the conversion. */ tree type; union { *************** struct conversion { *** 107,112 **** --- 110,117 ---- /* The expression at the beginning of the conversion chain. This variant is used only if KIND is ck_identity or ck_ambig. */ tree expr; + /* The array of conversions for an initializer_list. */ + conversion **list; } u; /* The function candidate corresponding to this conversion sequence. This field is only used if KIND is ck_user. */ *************** static struct z_candidate * tourney (str *** 126,146 **** static int equal_functions (tree, tree); static int joust (struct z_candidate *, struct z_candidate *, bool); static int compare_ics (conversion *, conversion *); ! static tree build_over_call (struct z_candidate *, int); static tree build_java_interface_fn_ref (tree, tree); ! #define convert_like(CONV, EXPR) \ convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0, \ /*issue_conversion_warnings=*/true, \ ! /*c_cast_p=*/false) ! #define convert_like_with_context(CONV, EXPR, FN, ARGNO) \ ! convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \ ! /*issue_conversion_warnings=*/true, \ ! /*c_cast_p=*/false) static tree convert_like_real (conversion *, tree, tree, int, int, bool, ! bool); static void op_error (enum tree_code, enum tree_code, tree, tree, tree, const char *); ! static tree build_object_call (tree, tree); static tree resolve_args (tree); static struct z_candidate *build_user_type_conversion_1 (tree, tree, int); static void print_z_candidate (const char *, struct z_candidate *); --- 131,151 ---- static int equal_functions (tree, tree); static int joust (struct z_candidate *, struct z_candidate *, bool); static int compare_ics (conversion *, conversion *); ! static tree build_over_call (struct z_candidate *, int, tsubst_flags_t); static tree build_java_interface_fn_ref (tree, tree); ! #define convert_like(CONV, EXPR, COMPLAIN) \ convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0, \ /*issue_conversion_warnings=*/true, \ ! /*c_cast_p=*/false, (COMPLAIN)) ! #define convert_like_with_context(CONV, EXPR, FN, ARGNO, COMPLAIN ) \ ! convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \ ! /*issue_conversion_warnings=*/true, \ ! /*c_cast_p=*/false, (COMPLAIN)) static tree convert_like_real (conversion *, tree, tree, int, int, bool, ! bool, tsubst_flags_t); static void op_error (enum tree_code, enum tree_code, tree, tree, tree, const char *); ! static tree build_object_call (tree, tree, tsubst_flags_t); static tree resolve_args (tree); static struct z_candidate *build_user_type_conversion_1 (tree, tree, int); static void print_z_candidate (const char *, struct z_candidate *); *************** static conversion *implicit_conversion ( *** 174,179 **** --- 179,185 ---- static conversion *standard_conversion (tree, tree, tree, bool, int); static conversion *reference_binding (tree, tree, tree, bool, int); static conversion *build_conv (conversion_kind, tree, conversion *); + static conversion *build_list_conv (tree, tree, int); static bool is_subseq (conversion *, conversion *); static conversion *maybe_handle_ref_bind (conversion **); static void maybe_handle_implicit_object (conversion **); *************** static void add_candidates (tree, tree, *** 195,202 **** int, struct z_candidate **); static conversion *merge_conversion_sequences (conversion *, conversion *); static bool magic_varargs_p (tree); ! typedef void (*diagnostic_fn_t) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2); ! static tree build_temp (tree, tree, int, diagnostic_fn_t *); /* Returns nonzero iff the destructor name specified in NAME matches BASETYPE. NAME can take many forms... */ --- 201,207 ---- int, struct z_candidate **); static conversion *merge_conversion_sequences (conversion *, conversion *); static bool magic_varargs_p (tree); ! static tree build_temp (tree, tree, int, diagnostic_t *); /* Returns nonzero iff the destructor name specified in NAME matches BASETYPE. NAME can take many forms... */ *************** check_dtor_name (tree basetype, tree nam *** 214,220 **** /* OK */; else if (TREE_CODE (name) == IDENTIFIER_NODE) { ! if ((IS_AGGR_TYPE (basetype) && name == constructor_name (basetype)) || (TREE_CODE (basetype) == ENUMERAL_TYPE && name == TYPE_IDENTIFIER (basetype))) return true; --- 219,226 ---- /* OK */; else if (TREE_CODE (name) == IDENTIFIER_NODE) { ! if ((MAYBE_CLASS_TYPE_P (basetype) ! && name == constructor_name (basetype)) || (TREE_CODE (basetype) == ENUMERAL_TYPE && name == TYPE_IDENTIFIER (basetype))) return true; *************** build_call_a (tree function, int n, tree *** 332,338 **** nothrow = ((decl && TREE_NOTHROW (decl)) || TYPE_NOTHROW_P (TREE_TYPE (TREE_TYPE (function)))); ! if (decl && TREE_THIS_VOLATILE (decl) && cfun) current_function_returns_abnormally = 1; if (decl && TREE_DEPRECATED (decl)) --- 338,344 ---- nothrow = ((decl && TREE_NOTHROW (decl)) || TYPE_NOTHROW_P (TREE_TYPE (TREE_TYPE (function)))); ! if (decl && TREE_THIS_VOLATILE (decl) && cfun && cp_function_chain) current_function_returns_abnormally = 1; if (decl && TREE_DEPRECATED (decl)) *************** build_conv (conversion_kind code, tree t *** 528,536 **** conversion *t; conversion_rank rank = CONVERSION_RANK (from); ! /* We can't use buildl1 here because CODE could be USER_CONV, which ! takes two arguments. In that case, the caller is responsible for ! filling in the second argument. */ t = alloc_conversion (code); t->type = type; t->u.next = from; --- 534,541 ---- conversion *t; conversion_rank rank = CONVERSION_RANK (from); ! /* Note that the caller is responsible for filling in t->cand for ! user-defined conversions. */ t = alloc_conversion (code); t->type = type; t->u.next = from; *************** build_conv (conversion_kind code, tree t *** 560,565 **** --- 565,647 ---- return t; } + /* Represent a conversion from CTOR, a braced-init-list, to TYPE, a + specialization of std::initializer_list, if such a conversion is + possible. */ + + static conversion * + build_list_conv (tree type, tree ctor, int flags) + { + tree elttype = TREE_VEC_ELT (CLASSTYPE_TI_ARGS (type), 0); + unsigned len = CONSTRUCTOR_NELTS (ctor); + conversion **subconvs = alloc_conversions (len); + conversion *t; + unsigned i; + tree val; + + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (ctor), i, val) + { + conversion *sub + = implicit_conversion (elttype, TREE_TYPE (val), val, + false, flags); + if (sub == NULL) + return NULL; + + subconvs[i] = sub; + } + + t = alloc_conversion (ck_list); + t->type = type; + t->u.list = subconvs; + t->rank = cr_exact; + + for (i = 0; i < len; ++i) + { + conversion *sub = subconvs[i]; + if (sub->rank > t->rank) + t->rank = sub->rank; + if (sub->user_conv_p) + t->user_conv_p = true; + if (sub->bad_p) + t->bad_p = true; + } + + return t; + } + + /* Represent a conversion from CTOR, a braced-init-list, to TYPE, an + aggregate class, if such a conversion is possible. */ + + static conversion * + build_aggr_conv (tree type, tree ctor, int flags) + { + unsigned HOST_WIDE_INT i = 0; + conversion *c; + tree field = TYPE_FIELDS (type); + + for (; field; field = TREE_CHAIN (field), ++i) + { + if (TREE_CODE (field) != FIELD_DECL) + continue; + if (i < CONSTRUCTOR_NELTS (ctor)) + { + constructor_elt *ce = CONSTRUCTOR_ELT (ctor, i); + if (!can_convert_arg (TREE_TYPE (field), TREE_TYPE (ce->value), + ce->value, flags)) + return NULL; + } + else if (build_value_init (TREE_TYPE (field)) == error_mark_node) + return NULL; + } + + c = alloc_conversion (ck_aggr); + c->type = type; + c->rank = cr_exact; + c->user_conv_p = true; + c->u.next = NULL; + return c; + } + /* Build a representation of the identity conversion from EXPR to itself. The TYPE should match the type of EXPR, if EXPR is non-NULL. */ *************** standard_conversion (tree to, tree from, *** 624,630 **** if ((TYPE_PTRFN_P (to) || TYPE_PTRMEMFUNC_P (to)) && expr && type_unknown_p (expr)) { ! expr = instantiate_type (to, expr, tf_conv); if (expr == error_mark_node) return NULL; from = TREE_TYPE (expr); --- 706,715 ---- if ((TYPE_PTRFN_P (to) || TYPE_PTRMEMFUNC_P (to)) && expr && type_unknown_p (expr)) { ! tsubst_flags_t tflags = tf_conv; ! if (!(flags & LOOKUP_PROTECT)) ! tflags |= tf_no_access_control; ! expr = instantiate_type (to, expr, tflags); if (expr == error_mark_node) return NULL; from = TREE_TYPE (expr); *************** standard_conversion (tree to, tree from, *** 689,695 **** conv = build_conv (ck_std, to, conv); conv->bad_p = true; } ! else if (tcode == ENUMERAL_TYPE && fcode == INTEGER_TYPE) { /* For backwards brain damage compatibility, allow interconversion of enums and integers with a pedwarn. */ --- 774,780 ---- conv = build_conv (ck_std, to, conv); conv->bad_p = true; } ! else if (UNSCOPED_ENUM_P (to) && fcode == INTEGER_TYPE) { /* For backwards brain damage compatibility, allow interconversion of enums and integers with a pedwarn. */ *************** standard_conversion (tree to, tree from, *** 732,739 **** else if (!same_type_p (fbase, tbase)) return NULL; } ! else if (IS_AGGR_TYPE (TREE_TYPE (from)) ! && IS_AGGR_TYPE (TREE_TYPE (to)) /* [conv.ptr] An rvalue of type "pointer to cv D," where D is a --- 817,824 ---- else if (!same_type_p (fbase, tbase)) return NULL; } ! else if (CLASS_TYPE_P (TREE_TYPE (from)) ! && CLASS_TYPE_P (TREE_TYPE (to)) /* [conv.ptr] An rvalue of type "pointer to cv D," where D is a *************** standard_conversion (tree to, tree from, *** 814,823 **** { /* [conv.bool] ! An rvalue of arithmetic, enumeration, pointer, or pointer to ! member type can be converted to an rvalue of type bool. */ if (ARITHMETIC_TYPE_P (from) ! || fcode == ENUMERAL_TYPE || fcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (from)) { --- 899,909 ---- { /* [conv.bool] ! An rvalue of arithmetic, unscoped enumeration, pointer, or ! pointer to member type can be converted to an rvalue of type ! bool. */ if (ARITHMETIC_TYPE_P (from) ! || UNSCOPED_ENUM_P (from) || fcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (from)) { *************** standard_conversion (tree to, tree from, *** 837,843 **** /* As an extension, allow conversion to complex type. */ else if (ARITHMETIC_TYPE_P (to)) { ! if (! (INTEGRAL_CODE_P (fcode) || fcode == REAL_TYPE)) return NULL; conv = build_conv (ck_std, to, conv); --- 923,930 ---- /* As an extension, allow conversion to complex type. */ else if (ARITHMETIC_TYPE_P (to)) { ! if (! (INTEGRAL_CODE_P (fcode) || fcode == REAL_TYPE) ! || SCOPED_ENUM_P (from)) return NULL; conv = build_conv (ck_std, to, conv); *************** standard_conversion (tree to, tree from, *** 849,855 **** else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE && vector_types_convertible_p (from, to, false)) return build_conv (ck_std, to, conv); ! else if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from) && is_properly_derived_from (from, to)) { if (conv->kind == ck_rvalue) --- 936,942 ---- else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE && vector_types_convertible_p (from, to, false)) return build_conv (ck_std, to, conv); ! else if (MAYBE_CLASS_TYPE_P (to) && MAYBE_CLASS_TYPE_P (from) && is_properly_derived_from (from, to)) { if (conv->kind == ck_rvalue) *************** standard_conversion (tree to, tree from, *** 864,869 **** --- 951,959 ---- else return NULL; + if (flags & LOOKUP_NO_NARROWING) + conv->check_narrowing = true; + return conv; } *************** reference_binding (tree rto, tree rfrom, *** 1273,1281 **** /* Returns the implicit conversion sequence (see [over.ics]) from type FROM to type TO. The optional expression EXPR may affect the ! conversion. FLAGS are the usual overloading flags. Only ! LOOKUP_NO_CONVERSION is significant. If C_CAST_P is true, this ! conversion is coming from a C-style cast. */ static conversion * implicit_conversion (tree to, tree from, tree expr, bool c_cast_p, --- 1363,1370 ---- /* Returns the implicit conversion sequence (see [over.ics]) from type FROM to type TO. The optional expression EXPR may affect the ! conversion. FLAGS are the usual overloading flags. If C_CAST_P is ! true, this conversion is coming from a C-style cast. */ static conversion * implicit_conversion (tree to, tree from, tree expr, bool c_cast_p, *************** implicit_conversion (tree to, tree from, *** 1295,1309 **** if (conv) return conv; if (expr != NULL_TREE ! && (IS_AGGR_TYPE (from) ! || IS_AGGR_TYPE (to)) && (flags & LOOKUP_NO_CONVERSION) == 0) { struct z_candidate *cand; int convflags = ((flags & LOOKUP_NO_TEMP_BIND) |LOOKUP_ONLYCONVERTING); cand = build_user_type_conversion_1 (to, expr, convflags); if (cand) conv = cand->second_conv; --- 1384,1407 ---- if (conv) return conv; + if (is_std_init_list (to) && expr + && BRACE_ENCLOSED_INITIALIZER_P (expr)) + return build_list_conv (to, expr, flags); + if (expr != NULL_TREE ! && (MAYBE_CLASS_TYPE_P (from) ! || MAYBE_CLASS_TYPE_P (to)) && (flags & LOOKUP_NO_CONVERSION) == 0) { struct z_candidate *cand; int convflags = ((flags & LOOKUP_NO_TEMP_BIND) |LOOKUP_ONLYCONVERTING); + if (CLASS_TYPE_P (to) + && !CLASSTYPE_NON_AGGREGATE (complete_type (to)) + && BRACE_ENCLOSED_INITIALIZER_P (expr)) + return build_aggr_conv (to, expr, flags); + cand = build_user_type_conversion_1 (to, expr, convflags); if (cand) conv = cand->second_conv; *************** add_function_candidate (struct z_candida *** 1430,1435 **** --- 1528,1534 ---- if (parmnode) { tree parmtype = TREE_VALUE (parmnode); + int lflags = flags; /* The type of the implicit object parameter ('this') for overload resolution is not always the same as for the *************** add_function_candidate (struct z_candida *** 1448,1455 **** parmtype = build_pointer_type (parmtype); } t = implicit_conversion (parmtype, argtype, arg, ! /*c_cast_p=*/false, flags); } else { --- 1547,1558 ---- parmtype = build_pointer_type (parmtype); } + if ((flags & LOOKUP_NO_COPY_CTOR_CONVERSION) + && ctype && i == 0 && DECL_COPY_CONSTRUCTOR_P (fn)) + lflags |= LOOKUP_NO_CONVERSION; + t = implicit_conversion (parmtype, argtype, arg, ! /*c_cast_p=*/false, lflags); } else { *************** add_builtin_candidate (struct z_candidat *** 1753,1759 **** tree c1 = TREE_TYPE (type1); tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2); ! if (IS_AGGR_TYPE (c1) && DERIVED_FROM_P (c2, c1) && (TYPE_PTRMEMFUNC_P (type2) || is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2)))) break; --- 1856,1862 ---- tree c1 = TREE_TYPE (type1); tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2); ! if (MAYBE_CLASS_TYPE_P (c1) && DERIVED_FROM_P (c2, c1) && (TYPE_PTRMEMFUNC_P (type2) || is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2)))) break; *************** add_builtin_candidate (struct z_candidat *** 2024,2030 **** || (TYPE_PTR_P (type1) && TYPE_PTR_P (type2)) || (TYPE_PTRMEM_P (type1) && TYPE_PTRMEM_P (type2)) || TYPE_PTRMEMFUNC_P (type1) ! || IS_AGGR_TYPE (type1) || TREE_CODE (type1) == ENUMERAL_TYPE)) { build_builtin_candidate --- 2127,2133 ---- || (TYPE_PTR_P (type1) && TYPE_PTR_P (type2)) || (TYPE_PTRMEM_P (type1) && TYPE_PTRMEM_P (type2)) || TYPE_PTRMEMFUNC_P (type1) ! || MAYBE_CLASS_TYPE_P (type1) || TREE_CODE (type1) == ENUMERAL_TYPE)) { build_builtin_candidate *************** add_builtin_candidates (struct z_candida *** 2141,2147 **** { if (! args[i]) ; ! else if (IS_AGGR_TYPE (argtypes[i])) { tree convs; --- 2244,2250 ---- { if (! args[i]) ; ! else if (MAYBE_CLASS_TYPE_P (argtypes[i])) { tree convs; *************** build_this (tree obj) *** 2417,2423 **** if (processing_template_decl) return build_address (obj); ! return build_unary_op (ADDR_EXPR, obj, 0); } /* Returns true iff functions are equivalent. Equivalent functions are --- 2520,2526 ---- if (processing_template_decl) return build_address (obj); ! return cp_build_unary_op (ADDR_EXPR, obj, 0, tf_warning_or_error); } /* Returns true iff functions are equivalent. Equivalent functions are *************** print_z_candidate (const char *msgstr, s *** 2446,2469 **** if (TREE_CODE (candidate->fn) == IDENTIFIER_NODE) { if (candidate->num_convs == 3) ! inform ("%s %D(%T, %T, %T) ", msgstr, candidate->fn, candidate->convs[0]->type, candidate->convs[1]->type, candidate->convs[2]->type); else if (candidate->num_convs == 2) ! inform ("%s %D(%T, %T) ", msgstr, candidate->fn, candidate->convs[0]->type, candidate->convs[1]->type); else ! inform ("%s %D(%T) ", msgstr, candidate->fn, candidate->convs[0]->type); } else if (TYPE_P (candidate->fn)) ! inform ("%s %T ", msgstr, candidate->fn); else if (candidate->viable == -1) ! inform ("%s %+#D ", msgstr, candidate->fn); else ! inform ("%s %+#D", msgstr, candidate->fn); } static void --- 2549,2572 ---- if (TREE_CODE (candidate->fn) == IDENTIFIER_NODE) { if (candidate->num_convs == 3) ! inform (input_location, "%s %D(%T, %T, %T) ", msgstr, candidate->fn, candidate->convs[0]->type, candidate->convs[1]->type, candidate->convs[2]->type); else if (candidate->num_convs == 2) ! inform (input_location, "%s %D(%T, %T) ", msgstr, candidate->fn, candidate->convs[0]->type, candidate->convs[1]->type); else ! inform (input_location, "%s %D(%T) ", msgstr, candidate->fn, candidate->convs[0]->type); } else if (TYPE_P (candidate->fn)) ! inform (input_location, "%s %T ", msgstr, candidate->fn); else if (candidate->viable == -1) ! inform (input_location, "%s %+#D ", msgstr, candidate->fn); else ! inform (input_location, "%s %+#D", msgstr, candidate->fn); } static void *************** build_user_type_conversion_1 (tree totyp *** 2568,2580 **** /* We represent conversion within a hierarchy using RVALUE_CONV and BASE_CONV, as specified by [over.best.ics]; these become plain constructor calls, as specified in [dcl.init]. */ ! gcc_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype) || !DERIVED_FROM_P (totype, fromtype)); ! if (IS_AGGR_TYPE (totype)) ctors = lookup_fnfields (totype, complete_ctor_identifier, 0); ! if (IS_AGGR_TYPE (fromtype)) { tree to_nonref = non_reference (totype); if (same_type_ignoring_top_level_qualifiers_p (to_nonref, fromtype) || --- 2671,2683 ---- /* We represent conversion within a hierarchy using RVALUE_CONV and BASE_CONV, as specified by [over.best.ics]; these become plain constructor calls, as specified in [dcl.init]. */ ! gcc_assert (!MAYBE_CLASS_TYPE_P (fromtype) || !MAYBE_CLASS_TYPE_P (totype) || !DERIVED_FROM_P (totype, fromtype)); ! if (MAYBE_CLASS_TYPE_P (totype)) ctors = lookup_fnfields (totype, complete_ctor_identifier, 0); ! if (MAYBE_CLASS_TYPE_P (fromtype)) { tree to_nonref = non_reference (totype); if (same_type_ignoring_top_level_qualifiers_p (to_nonref, fromtype) || *************** build_user_type_conversion_1 (tree totyp *** 2606,2612 **** ctors = BASELINK_FUNCTIONS (ctors); t = build_int_cst (build_pointer_type (totype), 0); ! args = build_tree_list (NULL_TREE, expr); /* We should never try to call the abstract or base constructor from here. */ gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors)) --- 2709,2726 ---- ctors = BASELINK_FUNCTIONS (ctors); t = build_int_cst (build_pointer_type (totype), 0); ! if (BRACE_ENCLOSED_INITIALIZER_P (expr) ! && !TYPE_HAS_LIST_CTOR (totype)) ! { ! args = ctor_to_list (expr); ! /* We still allow more conversions within an init-list. */ ! flags = ((flags & ~LOOKUP_NO_CONVERSION) ! /* But not for the copy ctor. */ ! |LOOKUP_NO_COPY_CTOR_CONVERSION ! |LOOKUP_NO_NARROWING); ! } ! else ! args = build_tree_list (NULL_TREE, expr); /* We should never try to call the abstract or base constructor from here. */ gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors)) *************** build_user_type_conversion_1 (tree totyp *** 2616,2622 **** for (; ctors; ctors = OVL_NEXT (ctors)) { tree ctor = OVL_CURRENT (ctors); ! if (DECL_NONCONVERTING_P (ctor)) continue; if (TREE_CODE (ctor) == TEMPLATE_DECL) --- 2730,2737 ---- for (; ctors; ctors = OVL_NEXT (ctors)) { tree ctor = OVL_CURRENT (ctors); ! if (DECL_NONCONVERTING_P (ctor) ! && !BRACE_ENCLOSED_INITIALIZER_P (expr)) continue; if (TREE_CODE (ctor) == TEMPLATE_DECL) *************** build_user_type_conversion_1 (tree totyp *** 2710,2716 **** don't add a second rvalue conversion if there's already one there. Which there really shouldn't be, but it's harmless since we'd add it here anyway. */ ! if (ics && IS_AGGR_TYPE (totype) && ics->kind != ck_rvalue && !(convflags & LOOKUP_NO_TEMP_BIND)) ics = build_conv (ck_rvalue, totype, ics); --- 2825,2831 ---- don't add a second rvalue conversion if there's already one there. Which there really shouldn't be, but it's harmless since we'd add it here anyway. */ ! if (ics && MAYBE_CLASS_TYPE_P (totype) && ics->kind != ck_rvalue && !(convflags & LOOKUP_NO_TEMP_BIND)) ics = build_conv (ck_rvalue, totype, ics); *************** build_user_type_conversion_1 (tree totyp *** 2758,2763 **** --- 2873,2882 ---- build_identity_conv (TREE_TYPE (expr), expr)); conv->cand = cand; + /* Remember that this was a list-initialization. */ + if (flags & LOOKUP_NO_NARROWING) + conv->check_narrowing = true; + /* Combine it with the second conversion sequence. */ cand->second_conv = merge_conversion_sequences (conv, cand->second_conv); *************** build_user_type_conversion (tree totype, *** 2778,2784 **** { if (cand->second_conv->kind == ck_ambig) return error_mark_node; ! expr = convert_like (cand->second_conv, expr); return convert_from_reference (expr); } return NULL_TREE; --- 2897,2903 ---- { if (cand->second_conv->kind == ck_ambig) return error_mark_node; ! expr = convert_like (cand->second_conv, expr, tf_warning_or_error); return convert_from_reference (expr); } return NULL_TREE; *************** resolve_args (tree args) *** 2801,2807 **** error ("invalid use of void expression"); return error_mark_node; } ! else if (invalid_nonstatic_memfn_p (arg)) return error_mark_node; } return args; --- 2920,2926 ---- error ("invalid use of void expression"); return error_mark_node; } ! else if (invalid_nonstatic_memfn_p (arg, tf_warning_or_error)) return error_mark_node; } return args; *************** perform_overload_resolution (tree fn, *** 2865,2871 **** or a static member function) with the ARGS. */ tree ! build_new_function_call (tree fn, tree args, bool koenig_p) { struct z_candidate *candidates, *cand; bool any_viable_p; --- 2984,2991 ---- or a static member function) with the ARGS. */ tree ! build_new_function_call (tree fn, tree args, bool koenig_p, ! tsubst_flags_t complain) { struct z_candidate *candidates, *cand; bool any_viable_p; *************** build_new_function_call (tree fn, tree a *** 2886,2893 **** fn = remove_hidden_names (fn); if (!fn) { ! error ("no matching function for call to %<%D(%A)%>", ! DECL_NAME (OVL_CURRENT (orig_fn)), args); return error_mark_node; } } --- 3006,3014 ---- fn = remove_hidden_names (fn); if (!fn) { ! if (complain & tf_error) ! error ("no matching function for call to %<%D(%A)%>", ! DECL_NAME (OVL_CURRENT (orig_fn)), args); return error_mark_node; } } *************** build_new_function_call (tree fn, tree a *** 2899,2920 **** if (!cand) { ! if (!any_viable_p && candidates && ! candidates->next) ! return build_function_call (candidates->fn, args); ! if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) ! fn = TREE_OPERAND (fn, 0); ! if (!any_viable_p) ! error ("no matching function for call to %<%D(%A)%>", ! DECL_NAME (OVL_CURRENT (fn)), args); ! else ! error ("call of overloaded %<%D(%A)%> is ambiguous", ! DECL_NAME (OVL_CURRENT (fn)), args); ! if (candidates) ! print_z_candidates (candidates); result = error_mark_node; } else ! result = build_over_call (cand, LOOKUP_NORMAL); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); --- 3020,3044 ---- if (!cand) { ! if (complain & tf_error) ! { ! if (!any_viable_p && candidates && ! candidates->next) ! return cp_build_function_call (candidates->fn, args, complain); ! if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) ! fn = TREE_OPERAND (fn, 0); ! if (!any_viable_p) ! error ("no matching function for call to %<%D(%A)%>", ! DECL_NAME (OVL_CURRENT (fn)), args); ! else ! error ("call of overloaded %<%D(%A)%> is ambiguous", ! DECL_NAME (OVL_CURRENT (fn)), args); ! if (candidates) ! print_z_candidates (candidates); ! } result = error_mark_node; } else ! result = build_over_call (cand, LOOKUP_NORMAL, complain); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); *************** build_operator_new_call (tree fnname, tr *** 3025,3035 **** *fn = cand->fn; /* Build the CALL_EXPR. */ ! return build_over_call (cand, LOOKUP_NORMAL); } static tree ! build_object_call (tree obj, tree args) { struct z_candidate *candidates = 0, *cand; tree fns, convs, mem_args = NULL_TREE; --- 3149,3159 ---- *fn = cand->fn; /* Build the CALL_EXPR. */ ! return build_over_call (cand, LOOKUP_NORMAL, tf_warning_or_error); } static tree ! build_object_call (tree obj, tree args, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree fns, convs, mem_args = NULL_TREE; *************** build_object_call (tree obj, tree args) *** 3040,3048 **** if (TYPE_PTRMEMFUNC_P (type)) { ! /* It's no good looking for an overloaded operator() on a ! pointer-to-member-function. */ ! error ("pointer-to-member function %E cannot be called without an object; consider using .* or ->*", obj); return error_mark_node; } --- 3164,3173 ---- if (TYPE_PTRMEMFUNC_P (type)) { ! if (complain & tf_error) ! /* It's no good looking for an overloaded operator() on a ! pointer-to-member-function. */ ! error ("pointer-to-member function %E cannot be called without an object; consider using .* or ->*", obj); return error_mark_node; } *************** build_object_call (tree obj, tree args) *** 3116,3123 **** candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { ! error ("no match for call to %<(%T) (%A)%>", TREE_TYPE (obj), args); ! print_z_candidates (candidates); result = error_mark_node; } else --- 3241,3251 ---- candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { ! if (complain & tf_error) ! { ! error ("no match for call to %<(%T) (%A)%>", TREE_TYPE (obj), args); ! print_z_candidates (candidates); ! } result = error_mark_node; } else *************** build_object_call (tree obj, tree args) *** 3125,3132 **** cand = tourney (candidates); if (cand == 0) { ! error ("call of %<(%T) (%A)%> is ambiguous", TREE_TYPE (obj), args); ! print_z_candidates (candidates); result = error_mark_node; } /* Since cand->fn will be a type, not a function, for a conversion --- 3253,3264 ---- cand = tourney (candidates); if (cand == 0) { ! if (complain & tf_error) ! { ! error ("call of %<(%T) (%A)%> is ambiguous", ! TREE_TYPE (obj), args); ! print_z_candidates (candidates); ! } result = error_mark_node; } /* Since cand->fn will be a type, not a function, for a conversion *************** build_object_call (tree obj, tree args) *** 3134,3145 **** DECL_NAME here. */ else if (TREE_CODE (cand->fn) == FUNCTION_DECL && DECL_OVERLOADED_OPERATOR_P (cand->fn) == CALL_EXPR) ! result = build_over_call (cand, LOOKUP_NORMAL); else { ! obj = convert_like_with_context (cand->convs[0], obj, cand->fn, -1); obj = convert_from_reference (obj); ! result = build_function_call (obj, args); } } --- 3266,3278 ---- DECL_NAME here. */ else if (TREE_CODE (cand->fn) == FUNCTION_DECL && DECL_OVERLOADED_OPERATOR_P (cand->fn) == CALL_EXPR) ! result = build_over_call (cand, LOOKUP_NORMAL, complain); else { ! obj = convert_like_with_context (cand->convs[0], obj, cand->fn, -1, ! complain); obj = convert_from_reference (obj); ! result = cp_build_function_call (obj, args, complain); } } *************** conditional_conversion (tree e1, tree e2 *** 3260,3266 **** arguments to the conditional expression. */ tree ! build_conditional_expr (tree arg1, tree arg2, tree arg3) { tree arg2_type; tree arg3_type; --- 3393,3400 ---- arguments to the conditional expression. */ tree ! build_conditional_expr (tree arg1, tree arg2, tree arg3, ! tsubst_flags_t complain) { tree arg2_type; tree arg3_type; *************** build_conditional_expr (tree arg1, tree *** 3277,3284 **** calculated only once. */ if (!arg2) { ! if (pedantic) ! pedwarn ("ISO C++ forbids omitting the middle term of a ?: expression"); /* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */ if (real_lvalue_p (arg1)) --- 3411,3419 ---- calculated only once. */ if (!arg2) { ! if (complain & tf_error) ! pedwarn (input_location, OPT_pedantic, ! "ISO C++ forbids omitting the middle term of a ?: expression"); /* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */ if (real_lvalue_p (arg1)) *************** build_conditional_expr (tree arg1, tree *** 3289,3297 **** /* [expr.cond] ! The first expr ession is implicitly converted to bool (clause _conv_). */ ! arg1 = perform_implicit_conversion (boolean_type_node, arg1); /* If something has already gone wrong, just pass that fact up the tree. */ --- 3424,3432 ---- /* [expr.cond] ! The first expression is implicitly converted to bool (clause _conv_). */ ! arg1 = perform_implicit_conversion (boolean_type_node, arg1, complain); /* If something has already gone wrong, just pass that fact up the tree. */ *************** build_conditional_expr (tree arg1, tree *** 3355,3370 **** result_type = void_type_node; else { ! if (VOID_TYPE_P (arg2_type)) ! error ("second operand to the conditional operator " ! "is of type %, " ! "but the third operand is neither a throw-expression " ! "nor of type %"); ! else ! error ("third operand to the conditional operator " ! "is of type %, " ! "but the second operand is neither a throw-expression " ! "nor of type %"); return error_mark_node; } --- 3490,3508 ---- result_type = void_type_node; else { ! if (complain & tf_error) ! { ! if (VOID_TYPE_P (arg2_type)) ! error ("second operand to the conditional operator " ! "is of type %, " ! "but the third operand is neither a throw-expression " ! "nor of type %"); ! else ! error ("third operand to the conditional operator " ! "is of type %, " ! "but the second operand is neither a throw-expression " ! "nor of type %"); ! } return error_mark_node; } *************** build_conditional_expr (tree arg1, tree *** 3408,3414 **** } else if (conv2 && (!conv2->bad_p || !conv3)) { ! arg2 = convert_like (conv2, arg2); arg2 = convert_from_reference (arg2); arg2_type = TREE_TYPE (arg2); /* Even if CONV2 is a valid conversion, the result of the --- 3546,3552 ---- } else if (conv2 && (!conv2->bad_p || !conv3)) { ! arg2 = convert_like (conv2, arg2, complain); arg2 = convert_from_reference (arg2); arg2_type = TREE_TYPE (arg2); /* Even if CONV2 is a valid conversion, the result of the *************** build_conditional_expr (tree arg1, tree *** 3421,3427 **** } else if (conv3 && (!conv3->bad_p || !conv2)) { ! arg3 = convert_like (conv3, arg3); arg3 = convert_from_reference (arg3); arg3_type = TREE_TYPE (arg3); if (error_operand_p (arg3)) --- 3559,3565 ---- } else if (conv3 && (!conv3->bad_p || !conv2)) { ! arg3 = convert_like (conv3, arg3, complain); arg3 = convert_from_reference (arg3); arg3_type = TREE_TYPE (arg3); if (error_operand_p (arg3)) *************** build_conditional_expr (tree arg1, tree *** 3505,3519 **** candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { ! op_error (COND_EXPR, NOP_EXPR, arg1, arg2, arg3, "no match"); ! print_z_candidates (candidates); return error_mark_node; } cand = tourney (candidates); if (!cand) { ! op_error (COND_EXPR, NOP_EXPR, arg1, arg2, arg3, "no match"); ! print_z_candidates (candidates); return error_mark_node; } --- 3643,3663 ---- candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { ! if (complain & tf_error) ! { ! op_error (COND_EXPR, NOP_EXPR, arg1, arg2, arg3, "no match"); ! print_z_candidates (candidates); ! } return error_mark_node; } cand = tourney (candidates); if (!cand) { ! if (complain & tf_error) ! { ! op_error (COND_EXPR, NOP_EXPR, arg1, arg2, arg3, "no match"); ! print_z_candidates (candidates); ! } return error_mark_node; } *************** build_conditional_expr (tree arg1, tree *** 3523,3533 **** the converted operands are used in place of the original operands for the remainder of this section. */ conv = cand->convs[0]; ! arg1 = convert_like (conv, arg1); conv = cand->convs[1]; ! arg2 = convert_like (conv, arg2); conv = cand->convs[2]; ! arg3 = convert_like (conv, arg3); } /* [expr.cond] --- 3667,3677 ---- the converted operands are used in place of the original operands for the remainder of this section. */ conv = cand->convs[0]; ! arg1 = convert_like (conv, arg1, complain); conv = cand->convs[1]; ! arg2 = convert_like (conv, arg2, complain); conv = cand->convs[2]; ! arg3 = convert_like (conv, arg3, complain); } /* [expr.cond] *************** build_conditional_expr (tree arg1, tree *** 3566,3574 **** type; the usual arithmetic conversions are performed to bring them to a common type, and the result is of that type. */ else if ((ARITHMETIC_TYPE_P (arg2_type) ! || TREE_CODE (arg2_type) == ENUMERAL_TYPE) && (ARITHMETIC_TYPE_P (arg3_type) ! || TREE_CODE (arg3_type) == ENUMERAL_TYPE)) { /* In this case, there is always a common type. */ result_type = type_after_usual_arithmetic_conversions (arg2_type, --- 3710,3718 ---- type; the usual arithmetic conversions are performed to bring them to a common type, and the result is of that type. */ else if ((ARITHMETIC_TYPE_P (arg2_type) ! || UNSCOPED_ENUM_P (arg2_type)) && (ARITHMETIC_TYPE_P (arg3_type) ! || UNSCOPED_ENUM_P (arg3_type))) { /* In this case, there is always a common type. */ result_type = type_after_usual_arithmetic_conversions (arg2_type, *************** build_conditional_expr (tree arg1, tree *** 3576,3592 **** if (TREE_CODE (arg2_type) == ENUMERAL_TYPE && TREE_CODE (arg3_type) == ENUMERAL_TYPE) ! warning (0, "enumeral mismatch in conditional expression: %qT vs %qT", ! arg2_type, arg3_type); else if (extra_warnings && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE && !same_type_p (arg3_type, type_promotes_to (arg2_type))) || (TREE_CODE (arg3_type) == ENUMERAL_TYPE && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) ! warning (0, "enumeral and non-enumeral type in conditional expression"); ! arg2 = perform_implicit_conversion (result_type, arg2); ! arg3 = perform_implicit_conversion (result_type, arg3); } /* [expr.cond] --- 3720,3744 ---- if (TREE_CODE (arg2_type) == ENUMERAL_TYPE && TREE_CODE (arg3_type) == ENUMERAL_TYPE) ! { ! if (complain & tf_warning) ! warning (0, ! "enumeral mismatch in conditional expression: %qT vs %qT", ! arg2_type, arg3_type); ! } else if (extra_warnings && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE && !same_type_p (arg3_type, type_promotes_to (arg2_type))) || (TREE_CODE (arg3_type) == ENUMERAL_TYPE && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) ! { ! if (complain & tf_warning) ! warning (0, ! "enumeral and non-enumeral type in conditional expression"); ! } ! arg2 = perform_implicit_conversion (result_type, arg2, complain); ! arg3 = perform_implicit_conversion (result_type, arg3, complain); } /* [expr.cond] *************** build_conditional_expr (tree arg1, tree *** 3613,3629 **** || (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type))) { result_type = composite_pointer_type (arg2_type, arg3_type, arg2, ! arg3, "conditional expression"); if (result_type == error_mark_node) return error_mark_node; ! arg2 = perform_implicit_conversion (result_type, arg2); ! arg3 = perform_implicit_conversion (result_type, arg3); } if (!result_type) { ! error ("operands to ?: have different types %qT and %qT", ! arg2_type, arg3_type); return error_mark_node; } --- 3765,3783 ---- || (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type))) { result_type = composite_pointer_type (arg2_type, arg3_type, arg2, ! arg3, "conditional expression", ! complain); if (result_type == error_mark_node) return error_mark_node; ! arg2 = perform_implicit_conversion (result_type, arg2, complain); ! arg3 = perform_implicit_conversion (result_type, arg3, complain); } if (!result_type) { ! if (complain & tf_error) ! error ("operands to ?: have different types %qT and %qT", ! arg2_type, arg3_type); return error_mark_node; } *************** add_candidates (tree fns, tree args, *** 3735,3741 **** tree build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, ! bool *overloaded_p) { struct z_candidate *candidates = 0, *cand; tree arglist, fnname; --- 3889,3895 ---- tree build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, ! bool *overloaded_p, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree arglist, fnname; *************** build_new_op (enum tree_code code, int f *** 3775,3781 **** gcc_unreachable (); case CALL_EXPR: ! return build_object_call (arg1, arg2); case TRUTH_ORIF_EXPR: case TRUTH_ANDIF_EXPR: --- 3929,3935 ---- gcc_unreachable (); case CALL_EXPR: ! return build_object_call (arg1, arg2, complain); case TRUTH_ORIF_EXPR: case TRUTH_ANDIF_EXPR: *************** build_new_op (enum tree_code code, int f *** 3884,3902 **** { case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: /* Look for an `operator++ (int)'. If they didn't have one, then we fall back to the old way of doing things. */ if (flags & LOOKUP_COMPLAIN) ! pedwarn ("no %<%D(int)%> declared for postfix %qs, " ! "trying prefix operator instead", ! fnname, ! operator_name_info[code].name); if (code == POSTINCREMENT_EXPR) code = PREINCREMENT_EXPR; else code = PREDECREMENT_EXPR; result = build_new_op (code, flags, arg1, NULL_TREE, NULL_TREE, ! overloaded_p); break; /* The caller will deal with these. */ --- 4038,4061 ---- { case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: + /* Don't try anything fancy if we're not allowed to produce + errors. */ + if (!(complain & tf_error)) + return error_mark_node; + /* Look for an `operator++ (int)'. If they didn't have one, then we fall back to the old way of doing things. */ if (flags & LOOKUP_COMPLAIN) ! permerror (input_location, "no %<%D(int)%> declared for postfix %qs, " ! "trying prefix operator instead", ! fnname, ! operator_name_info[code].name); if (code == POSTINCREMENT_EXPR) code = PREINCREMENT_EXPR; else code = PREDECREMENT_EXPR; result = build_new_op (code, flags, arg1, NULL_TREE, NULL_TREE, ! overloaded_p, complain); break; /* The caller will deal with these. */ *************** build_new_op (enum tree_code code, int f *** 3908,3914 **** break; default: ! if (flags & LOOKUP_COMPLAIN) { op_error (code, code2, arg1, arg2, arg3, "no match"); print_z_candidates (candidates); --- 4067,4073 ---- break; default: ! if ((flags & LOOKUP_COMPLAIN) && (complain & tf_error)) { op_error (code, code2, arg1, arg2, arg3, "no match"); print_z_candidates (candidates); *************** build_new_op (enum tree_code code, int f *** 3922,3928 **** cand = tourney (candidates); if (cand == 0) { ! if (flags & LOOKUP_COMPLAIN) { op_error (code, code2, arg1, arg2, arg3, "ambiguous overload"); print_z_candidates (candidates); --- 4081,4087 ---- cand = tourney (candidates); if (cand == 0) { ! if ((flags & LOOKUP_COMPLAIN) && (complain & tf_error)) { op_error (code, code2, arg1, arg2, arg3, "ambiguous overload"); print_z_candidates (candidates); *************** build_new_op (enum tree_code code, int f *** 3937,3948 **** if (resolve_args (arglist) == error_mark_node) result = error_mark_node; else ! result = build_over_call (cand, LOOKUP_NORMAL); } else { /* Give any warnings we noticed during overload resolution. */ ! if (cand->warnings) { struct candidate_warning *w; for (w = cand->warnings; w; w = w->next) --- 4096,4107 ---- if (resolve_args (arglist) == error_mark_node) result = error_mark_node; else ! result = build_over_call (cand, LOOKUP_NORMAL, complain); } else { /* Give any warnings we noticed during overload resolution. */ ! if (cand->warnings && (complain & tf_warning)) { struct candidate_warning *w; for (w = cand->warnings; w; w = w->next) *************** build_new_op (enum tree_code code, int f *** 3961,3969 **** if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE && TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE && (TYPE_MAIN_VARIANT (TREE_TYPE (arg1)) ! != TYPE_MAIN_VARIANT (TREE_TYPE (arg2)))) { ! warning (0, "comparison between %q#T and %q#T", TREE_TYPE (arg1), TREE_TYPE (arg2)); } break; --- 4120,4130 ---- if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE && TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE && (TYPE_MAIN_VARIANT (TREE_TYPE (arg1)) ! != TYPE_MAIN_VARIANT (TREE_TYPE (arg2))) ! && (complain & tf_warning)) { ! warning (OPT_Wenum_compare, ! "comparison between %q#T and %q#T", TREE_TYPE (arg1), TREE_TYPE (arg2)); } break; *************** build_new_op (enum tree_code code, int f *** 3978,4002 **** conv = cand->convs[0]; if (conv->kind == ck_ref_bind) conv = conv->u.next; ! arg1 = convert_like (conv, arg1); if (arg2) { conv = cand->convs[1]; if (conv->kind == ck_ref_bind) conv = conv->u.next; ! arg2 = convert_like (conv, arg2); } if (arg3) { conv = cand->convs[2]; if (conv->kind == ck_ref_bind) conv = conv->u.next; ! arg3 = convert_like (conv, arg3); } if (!expl_eq_arg1) { ! warn_logical_operator (code, arg1, arg2); expl_eq_arg1 = true; } } --- 4139,4164 ---- conv = cand->convs[0]; if (conv->kind == ck_ref_bind) conv = conv->u.next; ! arg1 = convert_like (conv, arg1, complain); if (arg2) { conv = cand->convs[1]; if (conv->kind == ck_ref_bind) conv = conv->u.next; ! arg2 = convert_like (conv, arg2, complain); } if (arg3) { conv = cand->convs[2]; if (conv->kind == ck_ref_bind) conv = conv->u.next; ! arg3 = convert_like (conv, arg3, complain); } if (!expl_eq_arg1) { ! if (complain & tf_warning) ! warn_logical_operator (code, arg1, arg2); expl_eq_arg1 = true; } } *************** build_new_op (enum tree_code code, int f *** 4014,4023 **** switch (code) { case MODIFY_EXPR: ! return build_modify_expr (arg1, code2, arg2); case INDIRECT_REF: ! return build_indirect_ref (arg1, "unary *"); case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: --- 4176,4185 ---- switch (code) { case MODIFY_EXPR: ! return cp_build_modify_expr (arg1, code2, arg2, complain); case INDIRECT_REF: ! return cp_build_indirect_ref (arg1, "unary *", complain); case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: *************** build_new_op (enum tree_code code, int f *** 4043,4049 **** case BIT_AND_EXPR: case BIT_IOR_EXPR: case BIT_XOR_EXPR: ! return cp_build_binary_op (code, arg1, arg2); case UNARY_PLUS_EXPR: case NEGATE_EXPR: --- 4205,4211 ---- case BIT_AND_EXPR: case BIT_IOR_EXPR: case BIT_XOR_EXPR: ! return cp_build_binary_op (input_location, code, arg1, arg2, complain); case UNARY_PLUS_EXPR: case NEGATE_EXPR: *************** build_new_op (enum tree_code code, int f *** 4055,4070 **** case POSTDECREMENT_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: ! return build_unary_op (code, arg1, candidates != 0); case ARRAY_REF: ! return build_array_ref (arg1, arg2); case COND_EXPR: ! return build_conditional_expr (arg1, arg2, arg3); case MEMBER_REF: ! return build_m_component_ref (build_indirect_ref (arg1, NULL), arg2); /* The caller will deal with these. */ case ADDR_EXPR: --- 4217,4234 ---- case POSTDECREMENT_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: ! return cp_build_unary_op (code, arg1, candidates != 0, complain); case ARRAY_REF: ! return build_array_ref (arg1, arg2, input_location); case COND_EXPR: ! return build_conditional_expr (arg1, arg2, arg3, complain); case MEMBER_REF: ! return build_m_component_ref (cp_build_indirect_ref (arg1, NULL, ! complain), ! arg2); /* The caller will deal with these. */ case ADDR_EXPR: *************** build_op_delete_call (enum tree_code cod *** 4233,4239 **** else args = tree_cons (NULL_TREE, addr, build_tree_list (NULL_TREE, size)); ! return build_function_call (fn, args); } } --- 4397,4403 ---- else args = tree_cons (NULL_TREE, addr, build_tree_list (NULL_TREE, size)); ! return cp_build_function_call (fn, args, tf_warning_or_error); } } *************** build_op_delete_call (enum tree_code cod *** 4245,4251 **** if (alloc_fn) { if (!placement) ! warning (0, "no corresponding deallocation function for `%D'", alloc_fn); return NULL_TREE; } --- 4409,4415 ---- if (alloc_fn) { if (!placement) ! warning (0, "no corresponding deallocation function for %qD", alloc_fn); return NULL_TREE; } *************** enforce_access (tree basetype_path, tree *** 4288,4294 **** static tree build_temp (tree expr, tree type, int flags, ! diagnostic_fn_t *diagnostic_fn) { int savew, savee; --- 4452,4458 ---- static tree build_temp (tree expr, tree type, int flags, ! diagnostic_t *diagnostic_kind) { int savew, savee; *************** build_temp (tree expr, tree type, int fl *** 4296,4308 **** expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), ! type, flags); if (warningcount > savew) ! *diagnostic_fn = warning0; else if (errorcount > savee) ! *diagnostic_fn = error; else ! *diagnostic_fn = NULL; return expr; } --- 4460,4472 ---- expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), ! type, flags, tf_warning_or_error); if (warningcount > savew) ! *diagnostic_kind = DK_WARNING; else if (errorcount > savee) ! *diagnostic_kind = DK_ERROR; else ! *diagnostic_kind = 0; return expr; } *************** conversion_null_warnings (tree totype, t *** 4345,4354 **** static tree convert_like_real (conversion *convs, tree expr, tree fn, int argnum, int inner, bool issue_conversion_warnings, ! bool c_cast_p) { tree totype = convs->type; ! diagnostic_fn_t diagnostic_fn; int flags; if (convs->bad_p --- 4509,4518 ---- static tree convert_like_real (conversion *convs, tree expr, tree fn, int argnum, int inner, bool issue_conversion_warnings, ! bool c_cast_p, tsubst_flags_t complain) { tree totype = convs->type; ! diagnostic_t diag_kind; int flags; if (convs->bad_p *************** convert_like_real (conversion *convs, tr *** 4365,4387 **** { expr = convert_like_real (t, expr, fn, argnum, 1, /*issue_conversion_warnings=*/false, ! /*c_cast_p=*/false); break; } else if (t->kind == ck_ambig) return convert_like_real (t, expr, fn, argnum, 1, /*issue_conversion_warnings=*/false, ! /*c_cast_p=*/false); else if (t->kind == ck_identity) break; } ! pedwarn ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype); ! if (fn) ! pedwarn (" initializing argument %P of %qD", argnum, fn); return cp_convert (totype, expr); } ! if (issue_conversion_warnings) conversion_null_warnings (totype, expr, fn, argnum); switch (convs->kind) --- 4529,4559 ---- { expr = convert_like_real (t, expr, fn, argnum, 1, /*issue_conversion_warnings=*/false, ! /*c_cast_p=*/false, ! complain); break; } else if (t->kind == ck_ambig) return convert_like_real (t, expr, fn, argnum, 1, /*issue_conversion_warnings=*/false, ! /*c_cast_p=*/false, ! complain); else if (t->kind == ck_identity) break; } ! if (complain & tf_error) ! { ! permerror (input_location, "invalid conversion from %qT to %qT", TREE_TYPE (expr), totype); ! if (fn) ! permerror (input_location, " initializing argument %P of %qD", argnum, fn); ! } ! else ! return error_mark_node; ! return cp_convert (totype, expr); } ! if (issue_conversion_warnings && (complain & tf_warning)) conversion_null_warnings (totype, expr, fn, argnum); switch (convs->kind) *************** convert_like_real (conversion *convs, tr *** 4392,4414 **** tree convfn = cand->fn; unsigned i; /* Set user_conv_p on the argument conversions, so rvalue/base handling knows not to allow any more UDCs. */ for (i = 0; i < cand->num_convs; ++i) cand->convs[i]->user_conv_p = true; ! expr = build_over_call (cand, LOOKUP_NORMAL); /* If this is a constructor or a function returning an aggr type, we need to build up a TARGET_EXPR. */ if (DECL_CONSTRUCTOR_P (convfn)) ! expr = build_cplus_new (totype, expr); return expr; } case ck_identity: if (type_unknown_p (expr)) ! expr = instantiate_type (totype, expr, tf_warning_or_error); /* Convert a constant to its underlying value, unless we are about to bind it to a reference, in which case we need to leave it as an lvalue. */ --- 4564,4603 ---- tree convfn = cand->fn; unsigned i; + /* When converting from an init list we consider explicit + constructors, but actually trying to call one is an error. */ + if (DECL_NONCONVERTING_P (convfn)) + { + if (complain & tf_error) + error ("converting to %qT from initializer list would use " + "explicit constructor %qD", totype, convfn); + else + return error_mark_node; + } + /* Set user_conv_p on the argument conversions, so rvalue/base handling knows not to allow any more UDCs. */ for (i = 0; i < cand->num_convs; ++i) cand->convs[i]->user_conv_p = true; ! expr = build_over_call (cand, LOOKUP_NORMAL, complain); /* If this is a constructor or a function returning an aggr type, we need to build up a TARGET_EXPR. */ if (DECL_CONSTRUCTOR_P (convfn)) ! { ! expr = build_cplus_new (totype, expr); ! ! /* Remember that this was list-initialization. */ ! if (convs->check_narrowing) ! TARGET_EXPR_LIST_INIT_P (expr) = true; ! } return expr; } case ck_identity: if (type_unknown_p (expr)) ! expr = instantiate_type (totype, expr, complain); /* Convert a constant to its underlying value, unless we are about to bind it to a reference, in which case we need to leave it as an lvalue. */ *************** convert_like_real (conversion *convs, tr *** 4427,4432 **** --- 4616,4659 ---- return build_user_type_conversion (totype, convs->u.expr, LOOKUP_NORMAL); + case ck_list: + { + /* Conversion to std::initializer_list. */ + tree elttype = TREE_VEC_ELT (CLASSTYPE_TI_ARGS (totype), 0); + tree new_ctor = build_constructor (init_list_type_node, NULL); + unsigned len = CONSTRUCTOR_NELTS (expr); + tree array, parms, val; + unsigned ix; + + /* Convert all the elements. */ + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (expr), ix, val) + { + tree sub = convert_like_real (convs->u.list[ix], val, fn, argnum, + 1, false, false, complain); + if (sub == error_mark_node) + return sub; + check_narrowing (TREE_TYPE (sub), val); + CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_ctor), NULL_TREE, sub); + } + /* Build up the array. */ + elttype = cp_build_qualified_type + (elttype, TYPE_QUALS (elttype) | TYPE_QUAL_CONST); + array = build_array_of_n_type (elttype, len); + array = finish_compound_literal (array, new_ctor); + + parms = build_tree_list (NULL_TREE, size_int (len)); + parms = tree_cons (NULL_TREE, decay_conversion (array), parms); + /* Call the private constructor. */ + push_deferring_access_checks (dk_no_check); + new_ctor = build_special_member_call + (NULL_TREE, complete_ctor_identifier, parms, totype, 0, complain); + pop_deferring_access_checks (); + return build_cplus_new (totype, new_ctor); + } + + case ck_aggr: + return get_target_expr (digest_init (totype, expr)); + default: break; }; *************** convert_like_real (conversion *convs, tr *** 4434,4440 **** expr = convert_like_real (convs->u.next, expr, fn, argnum, convs->kind == ck_ref_bind ? -1 : 1, convs->kind == ck_ref_bind ? issue_conversion_warnings : false, ! c_cast_p); if (expr == error_mark_node) return error_mark_node; --- 4661,4668 ---- expr = convert_like_real (convs->u.next, expr, fn, argnum, convs->kind == ck_ref_bind ? -1 : 1, convs->kind == ck_ref_bind ? issue_conversion_warnings : false, ! c_cast_p, ! complain); if (expr == error_mark_node) return error_mark_node; *************** convert_like_real (conversion *convs, tr *** 4442,4448 **** { case ck_rvalue: expr = convert_bitfield_to_declared_type (expr); ! if (! IS_AGGR_TYPE (totype)) return expr; /* Else fall through. */ case ck_base: --- 4670,4676 ---- { case ck_rvalue: expr = convert_bitfield_to_declared_type (expr); ! if (! MAYBE_CLASS_TYPE_P (totype)) return expr; /* Else fall through. */ case ck_base: *************** convert_like_real (conversion *convs, tr *** 4451,4460 **** /* We are going to bind a reference directly to a base-class subobject of EXPR. */ /* Build an expression for `*((base*) &expr)'. */ ! expr = build_unary_op (ADDR_EXPR, expr, 0); expr = convert_to_base (expr, build_pointer_type (totype), !c_cast_p, /*nonnull=*/true); ! expr = build_indirect_ref (expr, "implicit conversion"); return expr; } --- 4679,4688 ---- /* We are going to bind a reference directly to a base-class subobject of EXPR. */ /* Build an expression for `*((base*) &expr)'. */ ! expr = cp_build_unary_op (ADDR_EXPR, expr, 0, complain); expr = convert_to_base (expr, build_pointer_type (totype), !c_cast_p, /*nonnull=*/true); ! expr = cp_build_indirect_ref (expr, "implicit conversion", complain); return expr; } *************** convert_like_real (conversion *convs, tr *** 4467,4475 **** conversion (i.e. the second step of copy-initialization), so don't allow any more. */ flags |= LOOKUP_NO_CONVERSION; ! expr = build_temp (expr, totype, flags, &diagnostic_fn); ! if (diagnostic_fn && fn) ! diagnostic_fn (" initializing argument %P of %qD", argnum, fn); return build_cplus_new (totype, expr); case ck_ref_bind: --- 4695,4709 ---- conversion (i.e. the second step of copy-initialization), so don't allow any more. */ flags |= LOOKUP_NO_CONVERSION; ! expr = build_temp (expr, totype, flags, &diag_kind); ! if (diag_kind && fn) ! { ! if ((complain & tf_error)) ! emit_diagnostic (diag_kind, input_location, 0, ! " initializing argument %P of %qD", argnum, fn); ! else if (diag_kind == DK_ERROR) ! return error_mark_node; ! } return build_cplus_new (totype, expr); case ck_ref_bind: *************** convert_like_real (conversion *convs, tr *** 4481,4487 **** VA_ARG_EXPR and CONSTRUCTOR expressions are special cases that need temporaries, even when their types are reference compatible with the type of reference being bound, so the ! upcoming call to build_unary_op (ADDR_EXPR, expr, ...) doesn't fail. */ if (convs->need_temporary_p || TREE_CODE (expr) == CONSTRUCTOR --- 4715,4721 ---- VA_ARG_EXPR and CONSTRUCTOR expressions are special cases that need temporaries, even when their types are reference compatible with the type of reference being bound, so the ! upcoming call to cp_build_unary_op (ADDR_EXPR, expr, ...) doesn't fail. */ if (convs->need_temporary_p || TREE_CODE (expr) == CONSTRUCTOR *************** convert_like_real (conversion *convs, tr *** 4493,4508 **** if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)) && !TYPE_REF_IS_RVALUE (ref_type)) { ! /* If the reference is volatile or non-const, we ! cannot create a temporary. */ ! if (lvalue & clk_bitfield) ! error ("cannot bind bitfield %qE to %qT", ! expr, ref_type); ! else if (lvalue & clk_packed) ! error ("cannot bind packed field %qE to %qT", ! expr, ref_type); ! else ! error ("cannot bind rvalue %qE to %qT", expr, ref_type); return error_mark_node; } /* If the source is a packed field, and we must use a copy --- 4727,4745 ---- if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)) && !TYPE_REF_IS_RVALUE (ref_type)) { ! if (complain & tf_error) ! { ! /* If the reference is volatile or non-const, we ! cannot create a temporary. */ ! if (lvalue & clk_bitfield) ! error ("cannot bind bitfield %qE to %qT", ! expr, ref_type); ! else if (lvalue & clk_packed) ! error ("cannot bind packed field %qE to %qT", ! expr, ref_type); ! else ! error ("cannot bind rvalue %qE to %qT", expr, ref_type); ! } return error_mark_node; } /* If the source is a packed field, and we must use a copy *************** convert_like_real (conversion *convs, tr *** 4515,4522 **** && CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)) { ! error ("cannot bind packed field %qE to %qT", ! expr, ref_type); return error_mark_node; } if (lvalue & clk_bitfield) --- 4752,4760 ---- && CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)) { ! if (complain & tf_error) ! error ("cannot bind packed field %qE to %qT", ! expr, ref_type); return error_mark_node; } if (lvalue & clk_bitfield) *************** convert_like_real (conversion *convs, tr *** 4529,4535 **** /* Take the address of the thing to which we will bind the reference. */ ! expr = build_unary_op (ADDR_EXPR, expr, 1); if (expr == error_mark_node) return error_mark_node; --- 4767,4773 ---- /* Take the address of the thing to which we will bind the reference. */ ! expr = cp_build_unary_op (ADDR_EXPR, expr, 1, complain); if (expr == error_mark_node) return error_mark_node; *************** convert_like_real (conversion *convs, tr *** 4564,4570 **** break; } ! if (issue_conversion_warnings) expr = convert_and_check (totype, expr); else expr = convert (totype, expr); --- 4802,4811 ---- break; } ! if (convs->check_narrowing) ! check_narrowing (totype, expr); ! ! if (issue_conversion_warnings && (complain & tf_warning)) expr = convert_and_check (totype, expr); else expr = convert (totype, expr); *************** build_x_va_arg (tree expr, tree type) *** 4654,4660 **** expr = convert (build_pointer_type (type1), null_node); expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), call_builtin_trap (), expr); ! expr = build_indirect_ref (expr, NULL); return expr; } --- 4895,4901 ---- expr = convert (build_pointer_type (type1), null_node); expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), call_builtin_trap (), expr); ! expr = cp_build_indirect_ref (expr, NULL, tf_warning_or_error); return expr; } *************** convert_default_arg (tree type, tree arg *** 4715,4727 **** if (fn && DECL_TEMPLATE_INFO (fn)) arg = tsubst_default_argument (fn, type, arg); ! arg = break_out_target_exprs (arg); if (TREE_CODE (arg) == CONSTRUCTOR) { arg = digest_init (type, arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, ! "default argument", fn, parmnum); } else { --- 4956,4978 ---- if (fn && DECL_TEMPLATE_INFO (fn)) arg = tsubst_default_argument (fn, type, arg); ! /* Due to: + [dcl.fct.default] + + The names in the expression are bound, and the semantic + constraints are checked, at the point where the default + expressions appears. + + we must not perform access checks here. */ + push_deferring_access_checks (dk_no_check); + arg = break_out_target_exprs (arg); if (TREE_CODE (arg) == CONSTRUCTOR) { arg = digest_init (type, arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, ! "default argument", fn, parmnum, ! tf_warning_or_error); } else { *************** convert_default_arg (tree type, tree arg *** 4734,4742 **** if (!CONSTANT_CLASS_P (arg)) arg = unshare_expr (arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, ! "default argument", fn, parmnum); arg = convert_for_arg_passing (type, arg); } VEC_pop (tree, default_arg_context); --- 4985,4995 ---- if (!CONSTANT_CLASS_P (arg)) arg = unshare_expr (arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, ! "default argument", fn, parmnum, ! tf_warning_or_error); arg = convert_for_arg_passing (type, arg); } + pop_deferring_access_checks(); VEC_pop (tree, default_arg_context); *************** magic_varargs_p (tree fn) *** 4830,4836 **** case BUILT_IN_CLASSIFY_TYPE: case BUILT_IN_CONSTANT_P: case BUILT_IN_NEXT_ARG: - case BUILT_IN_STDARG_START: case BUILT_IN_VA_START: return true; --- 5083,5088 ---- *************** magic_varargs_p (tree fn) *** 4848,4854 **** bitmask of various LOOKUP_* flags which apply to the call itself. */ static tree ! build_over_call (struct z_candidate *cand, int flags) { tree fn = cand->fn; tree args = cand->args; --- 5100,5106 ---- bitmask of various LOOKUP_* flags which apply to the call itself. */ static tree ! build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) { tree fn = cand->fn; tree args = cand->args; *************** build_over_call (struct z_candidate *can *** 4862,4867 **** --- 5114,5120 ---- int is_method = 0; int nargs; tree *argarray; + bool already_used = false; /* In a template, there is no need to perform all of the work that is normally done. We are only interested in the type of the call *************** build_over_call (struct z_candidate *can *** 4872,4878 **** tree expr; tree return_type; return_type = TREE_TYPE (TREE_TYPE (fn)); ! expr = build_call_list (return_type, fn, args); if (TREE_THIS_VOLATILE (fn) && cfun) current_function_returns_abnormally = 1; if (!VOID_TYPE_P (return_type)) --- 5125,5131 ---- tree expr; tree return_type; return_type = TREE_TYPE (TREE_TYPE (fn)); ! expr = build_call_list (return_type, build_addr_func (fn), args); if (TREE_THIS_VOLATILE (fn) && cfun) current_function_returns_abnormally = 1; if (!VOID_TYPE_P (return_type)) *************** build_over_call (struct z_candidate *can *** 4888,4893 **** --- 5141,5150 ---- joust (cand, w->loser, 1); } + /* Make =delete work with SFINAE. */ + if (DECL_DELETED_FN (fn) && !(complain & tf_error)) + return error_mark_node; + if (DECL_FUNCTION_MEMBER_P (fn)) { /* If FN is a template function, two cases must be considered. *************** build_over_call (struct z_candidate *can *** 4960,4967 **** tree base_binfo; if (convs[i]->bad_p) ! pedwarn ("passing %qT as % argument of %q#D discards qualifiers", ! TREE_TYPE (argtype), fn); /* [class.mfct.nonstatic]: If a nonstatic member function of a class X is called for an object that is not of type X, or of a type --- 5217,5229 ---- tree base_binfo; if (convs[i]->bad_p) ! { ! if (complain & tf_error) ! permerror (input_location, "passing %qT as % argument of %q#D discards qualifiers", ! TREE_TYPE (argtype), fn); ! else ! return error_mark_node; ! } /* [class.mfct.nonstatic]: If a nonstatic member function of a class X is called for an object that is not of type X, or of a type *************** build_over_call (struct z_candidate *can *** 5011,5020 **** conv = conv->u.next; val = convert_like_with_context ! (conv, TREE_VALUE (arg), fn, i - is_method); val = convert_for_arg_passing (type, val); ! argarray[j++] = val; } /* Default arguments */ --- 5273,5285 ---- conv = conv->u.next; val = convert_like_with_context ! (conv, TREE_VALUE (arg), fn, i - is_method, complain); val = convert_for_arg_passing (type, val); ! if (val == error_mark_node) ! return error_mark_node; ! else ! argarray[j++] = val; } /* Default arguments */ *************** build_over_call (struct z_candidate *can *** 5053,5061 **** /* Pull out the real argument, disregarding const-correctness. */ targ = arg; ! while (TREE_CODE (targ) == NOP_EXPR ! || TREE_CODE (targ) == NON_LVALUE_EXPR ! || TREE_CODE (targ) == CONVERT_EXPR) targ = TREE_OPERAND (targ, 0); if (TREE_CODE (targ) == ADDR_EXPR) { --- 5318,5325 ---- /* Pull out the real argument, disregarding const-correctness. */ targ = arg; ! while (CONVERT_EXPR_P (targ) ! || TREE_CODE (targ) == NON_LVALUE_EXPR) targ = TREE_OPERAND (targ, 0); if (TREE_CODE (targ) == ADDR_EXPR) { *************** build_over_call (struct z_candidate *can *** 5070,5081 **** if (targ) arg = targ; else ! arg = build_indirect_ref (arg, 0); /* [class.copy]: the copy constructor is implicitly defined even if the implementation elided its use. */ ! if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn))) ! mark_used (fn); /* If we're creating a temp and we already have one, don't create a new one. If we're not creating a temp but we get one, use --- 5334,5354 ---- if (targ) arg = targ; else ! arg = cp_build_indirect_ref (arg, 0, complain); + if (TREE_CODE (arg) == TARGET_EXPR + && TARGET_EXPR_LIST_INIT_P (arg)) + { + /* Copy-list-initialization doesn't require the copy constructor + to be defined. */ + } /* [class.copy]: the copy constructor is implicitly defined even if the implementation elided its use. */ ! else if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn))) ! { ! mark_used (fn); ! already_used = true; ! } /* If we're creating a temp and we already have one, don't create a new one. If we're not creating a temp but we get one, use *************** build_over_call (struct z_candidate *can *** 5094,5100 **** && !move_fn_p (fn))) { tree to = stabilize_reference ! (build_indirect_ref (TREE_VALUE (args), 0)); val = build2 (INIT_EXPR, DECL_CONTEXT (fn), to, arg); return val; --- 5367,5373 ---- && !move_fn_p (fn))) { tree to = stabilize_reference ! (cp_build_indirect_ref (TREE_VALUE (args), 0, complain)); val = build2 (INIT_EXPR, DECL_CONTEXT (fn), to, arg); return val; *************** build_over_call (struct z_candidate *can *** 5105,5141 **** && TYPE_HAS_TRIVIAL_ASSIGN_REF (DECL_CONTEXT (fn))) { tree to = stabilize_reference ! (build_indirect_ref (argarray[0], 0)); tree type = TREE_TYPE (to); tree as_base = CLASSTYPE_AS_BASE (type); arg = argarray[1]; if (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (as_base))) { ! arg = build_indirect_ref (arg, 0); val = build2 (MODIFY_EXPR, TREE_TYPE (to), to, arg); } else { /* We must only copy the non-tail padding parts. ! Use __builtin_memcpy for the bitwise copy. */ tree arg0, arg1, arg2, t; arg2 = TYPE_SIZE_UNIT (as_base); arg1 = arg; ! arg0 = build_unary_op (ADDR_EXPR, to, 0); t = implicit_built_in_decls[BUILT_IN_MEMCPY]; t = build_call_n (t, 3, arg0, arg1, arg2); t = convert (TREE_TYPE (arg0), t); ! val = build_indirect_ref (t, 0); } return val; } ! mark_used (fn); if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0) { --- 5378,5431 ---- && TYPE_HAS_TRIVIAL_ASSIGN_REF (DECL_CONTEXT (fn))) { tree to = stabilize_reference ! (cp_build_indirect_ref (argarray[0], 0, complain)); tree type = TREE_TYPE (to); tree as_base = CLASSTYPE_AS_BASE (type); arg = argarray[1]; if (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (as_base))) { ! arg = cp_build_indirect_ref (arg, 0, complain); val = build2 (MODIFY_EXPR, TREE_TYPE (to), to, arg); } else { /* We must only copy the non-tail padding parts. ! Use __builtin_memcpy for the bitwise copy. ! FIXME fix 22488 so we can go back to using MODIFY_EXPR ! instead of an explicit call to memcpy. */ tree arg0, arg1, arg2, t; + tree test = NULL_TREE; arg2 = TYPE_SIZE_UNIT (as_base); arg1 = arg; ! arg0 = cp_build_unary_op (ADDR_EXPR, to, 0, complain); ! ! if (!(optimize && flag_tree_ter)) ! { ! /* When TER is off get_pointer_alignment returns 0, so a call ! to __builtin_memcpy is expanded as a call to memcpy, which ! is invalid with identical args. When TER is on it is ! expanded as a block move, which should be safe. */ ! arg0 = save_expr (arg0); ! arg1 = save_expr (arg1); ! test = build2 (EQ_EXPR, boolean_type_node, arg0, arg1); ! } t = implicit_built_in_decls[BUILT_IN_MEMCPY]; t = build_call_n (t, 3, arg0, arg1, arg2); t = convert (TREE_TYPE (arg0), t); ! if (test) ! t = build3 (COND_EXPR, TREE_TYPE (t), test, arg0, t); ! val = cp_build_indirect_ref (t, 0, complain); } return val; } ! if (!already_used) ! mark_used (fn); if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0) { *************** build_over_call (struct z_candidate *can *** 5160,5167 **** fn = build_vfn_ref (argarray[0], DECL_VINDEX (fn)); TREE_TYPE (fn) = t; } - else if (DECL_INLINE (fn)) - fn = inline_conversion (fn); else fn = build_addr_func (fn); --- 5450,5455 ---- *************** build_cxx_call (tree fn, int nargs, tree *** 5186,5191 **** --- 5474,5486 ---- && cfun) cp_function_chain->can_throw = 1; + /* Check that arguments to builtin functions match the expectations. */ + if (fndecl + && DECL_BUILT_IN (fndecl) + && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL + && !check_builtin_function_arguments (fndecl, nargs, argarray)) + return error_mark_node; + /* Some built-in function calls will be evaluated at compile-time in fold (). */ fn = fold_if_not_in_template (fn); *************** build_cxx_call (tree fn, int nargs, tree *** 5197,5203 **** if (fn == error_mark_node) return error_mark_node; ! if (IS_AGGR_TYPE (TREE_TYPE (fn))) fn = build_cplus_new (TREE_TYPE (fn), fn); return convert_from_reference (fn); } --- 5492,5498 ---- if (fn == error_mark_node) return error_mark_node; ! if (MAYBE_CLASS_TYPE_P (TREE_TYPE (fn))) fn = build_cplus_new (TREE_TYPE (fn), fn); return convert_from_reference (fn); } *************** build_java_interface_fn_ref (tree fn, tr *** 5230,5236 **** /* Look up the pointer to the runtime java.lang.Class object for `instance'. This is the first entry in the vtable. */ ! klass_ref = build_vtbl_ref (build_indirect_ref (instance, 0), integer_zero_node); /* Get the java.lang.Class pointer for the interface being called. */ --- 5525,5532 ---- /* Look up the pointer to the runtime java.lang.Class object for `instance'. This is the first entry in the vtable. */ ! klass_ref = build_vtbl_ref (cp_build_indirect_ref (instance, 0, ! tf_warning_or_error), integer_zero_node); /* Get the java.lang.Class pointer for the interface being called. */ *************** in_charge_arg_for_name (tree name) *** 5303,5309 **** tree build_special_member_call (tree instance, tree name, tree args, ! tree binfo, int flags) { tree fns; /* The type of the subobject to be constructed or destroyed. */ --- 5599,5605 ---- tree build_special_member_call (tree instance, tree name, tree args, ! tree binfo, int flags, tsubst_flags_t complain) { tree fns; /* The type of the subobject to be constructed or destroyed. */ *************** build_special_member_call (tree instance *** 5393,5399 **** return build_new_method_call (instance, fns, args, TYPE_BINFO (BINFO_TYPE (binfo)), ! flags, /*fn=*/NULL); } /* Return the NAME, as a C string. The NAME indicates a function that --- 5689,5696 ---- return build_new_method_call (instance, fns, args, TYPE_BINFO (BINFO_TYPE (binfo)), ! flags, /*fn=*/NULL, ! complain); } /* Return the NAME, as a C string. The NAME indicates a function that *************** name_as_c_string (tree name, tree type, *** 5447,5453 **** tree build_new_method_call (tree instance, tree fns, tree args, tree conversion_path, int flags, ! tree *fn_p) { struct z_candidate *candidates = 0, *cand; tree explicit_targs = NULL_TREE; --- 5744,5750 ---- tree build_new_method_call (tree instance, tree fns, tree args, tree conversion_path, int flags, ! tree *fn_p, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree explicit_targs = NULL_TREE; *************** build_new_method_call (tree instance, tr *** 5480,5486 **** if (!BASELINK_P (fns)) { ! error ("call to non-function %qD", fns); return error_mark_node; } --- 5777,5784 ---- if (!BASELINK_P (fns)) { ! if (complain & tf_error) ! error ("call to non-function %qD", fns); return error_mark_node; } *************** build_new_method_call (tree instance, tr *** 5554,5559 **** --- 5852,5869 ---- if (DECL_DESTRUCTOR_P (fn)) name = complete_dtor_identifier; + /* If CONSTRUCTOR_IS_DIRECT_INIT is set, this was a T{ } form + initializer, not T({ }). If the type doesn't have a list ctor, + break apart the list into separate ctor args. */ + if (DECL_CONSTRUCTOR_P (fn) && args + && BRACE_ENCLOSED_INITIALIZER_P (TREE_VALUE (args)) + && CONSTRUCTOR_IS_DIRECT_INIT (TREE_VALUE (args)) + && !TYPE_HAS_LIST_CTOR (basetype)) + { + gcc_assert (TREE_CHAIN (args) == NULL_TREE); + args = ctor_to_list (TREE_VALUE (args)); + } + class_type = (conversion_path ? BINFO_TYPE (conversion_path) : NULL_TREE); mem_args = tree_cons (NULL_TREE, instance_ptr, args); *************** build_new_method_call (tree instance, tr *** 5597,5617 **** candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { ! if (!COMPLETE_TYPE_P (basetype)) ! cxx_incomplete_type_error (instance_ptr, basetype); ! else { ! char *pretty_name; ! bool free_p; ! pretty_name = name_as_c_string (name, basetype, &free_p); ! error ("no matching function for call to %<%T::%s(%A)%#V%>", ! basetype, pretty_name, user_args, ! TREE_TYPE (TREE_TYPE (instance_ptr))); ! if (free_p) ! free (pretty_name); } - print_z_candidates (candidates); call = error_mark_node; } else --- 5907,5930 ---- candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { ! if (complain & tf_error) { ! if (!COMPLETE_TYPE_P (basetype)) ! cxx_incomplete_type_error (instance_ptr, basetype); ! else ! { ! char *pretty_name; ! bool free_p; ! pretty_name = name_as_c_string (name, basetype, &free_p); ! error ("no matching function for call to %<%T::%s(%A)%#V%>", ! basetype, pretty_name, user_args, ! TREE_TYPE (TREE_TYPE (instance_ptr))); ! if (free_p) ! free (pretty_name); ! } ! print_z_candidates (candidates); } call = error_mark_node; } else *************** build_new_method_call (tree instance, tr *** 5622,5633 **** char *pretty_name; bool free_p; ! pretty_name = name_as_c_string (name, basetype, &free_p); ! error ("call of overloaded %<%s(%A)%> is ambiguous", pretty_name, ! user_args); ! print_z_candidates (candidates); ! if (free_p) ! free (pretty_name); call = error_mark_node; } else --- 5935,5949 ---- char *pretty_name; bool free_p; ! if (complain & tf_error) ! { ! pretty_name = name_as_c_string (name, basetype, &free_p); ! error ("call of overloaded %<%s(%A)%> is ambiguous", pretty_name, ! user_args); ! print_z_candidates (candidates); ! if (free_p) ! free (pretty_name); ! } call = error_mark_node; } else *************** build_new_method_call (tree instance, tr *** 5638,5644 **** && DECL_PURE_VIRTUAL_P (fn) && instance == current_class_ref && (DECL_CONSTRUCTOR_P (current_function_decl) ! || DECL_DESTRUCTOR_P (current_function_decl))) /* This is not an error, it is runtime undefined behavior. */ warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ? --- 5954,5961 ---- && DECL_PURE_VIRTUAL_P (fn) && instance == current_class_ref && (DECL_CONSTRUCTOR_P (current_function_decl) ! || DECL_DESTRUCTOR_P (current_function_decl)) ! && (complain & tf_warning)) /* This is not an error, it is runtime undefined behavior. */ warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ? *************** build_new_method_call (tree instance, tr *** 5649,5656 **** if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE && is_dummy_object (instance_ptr)) { ! error ("cannot call member function %qD without object", ! fn); call = error_mark_node; } else --- 5966,5974 ---- if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE && is_dummy_object (instance_ptr)) { ! if (complain & tf_error) ! error ("cannot call member function %qD without object", ! fn); call = error_mark_node; } else *************** build_new_method_call (tree instance, tr *** 5662,5668 **** if (fn_p) *fn_p = fn; /* Build the actual CALL_EXPR. */ ! call = build_over_call (cand, flags); /* In an expression of the form `a->f()' where `f' turns out to be a static member function, `a' is none-the-less evaluated. */ --- 5980,5986 ---- if (fn_p) *fn_p = fn; /* Build the actual CALL_EXPR. */ ! call = build_over_call (cand, flags, complain); /* In an expression of the form `a->f()' where `f' turns out to be a static member function, `a' is none-the-less evaluated. */ *************** build_new_method_call (tree instance, tr *** 5690,5699 **** } if (processing_template_decl && call != error_mark_node) ! call = (build_min_non_dep_call_list ! (call, ! build_min_nt (COMPONENT_REF, orig_instance, orig_fns, NULL_TREE), ! orig_args)); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); --- 6008,6034 ---- } if (processing_template_decl && call != error_mark_node) ! { ! bool cast_to_void = false; ! ! if (TREE_CODE (call) == COMPOUND_EXPR) ! call = TREE_OPERAND (call, 1); ! else if (TREE_CODE (call) == NOP_EXPR) ! { ! cast_to_void = true; ! call = TREE_OPERAND (call, 0); ! } ! if (TREE_CODE (call) == INDIRECT_REF) ! call = TREE_OPERAND (call, 0); ! call = (build_min_non_dep_call_list ! (call, ! build_min (COMPONENT_REF, TREE_TYPE (CALL_EXPR_FN (call)), ! orig_instance, orig_fns, NULL_TREE), ! orig_args)); ! call = convert_from_reference (call); ! if (cast_to_void) ! call = build_nop (void_type_node, call); ! } /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); *************** is_subseq (conversion *ics1, conversion *** 5746,5753 **** bool is_properly_derived_from (tree derived, tree base) { ! if (!IS_AGGR_TYPE_CODE (TREE_CODE (derived)) ! || !IS_AGGR_TYPE_CODE (TREE_CODE (base))) return false; /* We only allow proper derivation here. The DERIVED_FROM_P macro --- 6081,6087 ---- bool is_properly_derived_from (tree derived, tree base) { ! if (!CLASS_TYPE_P (derived) || !CLASS_TYPE_P (base)) return false; /* We only allow proper derivation here. The DERIVED_FROM_P macro *************** compare_ics (conversion *ics1, conversio *** 5898,5910 **** conversion *t1; conversion *t2; ! for (t1 = ics1; t1->kind != ck_user; t1 = t1->u.next) ! if (t1->kind == ck_ambig) return 0; ! for (t2 = ics2; t2->kind != ck_user; t2 = t2->u.next) ! if (t2->kind == ck_ambig) return 0; if (t1->cand->fn != t2->cand->fn) return 0; --- 6232,6257 ---- conversion *t1; conversion *t2; ! for (t1 = ics1; t1->kind != ck_user && t1->kind != ck_list; t1 = t1->u.next) ! if (t1->kind == ck_ambig || t1->kind == ck_aggr) return 0; ! for (t2 = ics2; t2->kind != ck_user && t2->kind != ck_list; t2 = t2->u.next) ! if (t2->kind == ck_ambig || t2->kind == ck_aggr) return 0; + /* Conversion to std::initializer_list is better than other + user-defined conversions. */ + if (t1->kind == ck_list + || t2->kind == ck_list) + { + if (t2->kind != ck_list) + return 1; + else if (t1->kind != ck_list) + return -1; + else + return 0; + } + if (t1->cand->fn != t2->cand->fn) return 0; *************** compare_ics (conversion *ics1, conversio *** 6025,6032 **** } if (deref_from_type1 != NULL_TREE ! && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type1)) ! && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type2))) { /* This was one of the pointer or pointer-like conversions. --- 6372,6379 ---- } if (deref_from_type1 != NULL_TREE ! && RECORD_OR_UNION_CODE_P (TREE_CODE (deref_from_type1)) ! && RECORD_OR_UNION_CODE_P (TREE_CODE (deref_from_type2))) { /* This was one of the pointer or pointer-like conversions. *************** compare_ics (conversion *ics1, conversio *** 6063,6070 **** return -1; } } ! else if (IS_AGGR_TYPE_CODE (TREE_CODE (deref_to_type1)) ! && IS_AGGR_TYPE_CODE (TREE_CODE (deref_to_type2))) { /* [over.ics.rank] --- 6410,6417 ---- return -1; } } ! else if (RECORD_OR_UNION_CODE_P (TREE_CODE (deref_to_type1)) ! && RECORD_OR_UNION_CODE_P (TREE_CODE (deref_to_type2))) { /* [over.ics.rank] *************** joust (struct z_candidate *cand1, struct *** 6367,6376 **** tree source = source_type (w->convs[0]); if (! DECL_CONSTRUCTOR_P (w->fn)) source = TREE_TYPE (source); ! warning (OPT_Wconversion, "choosing %qD over %qD", w->fn, l->fn); ! warning (OPT_Wconversion, " for conversion from %qT to %qT", ! source, w->second_conv->type); ! inform (" because conversion sequence for the argument is better"); } else add_warning (w, l); --- 6714,6725 ---- tree source = source_type (w->convs[0]); if (! DECL_CONSTRUCTOR_P (w->fn)) source = TREE_TYPE (source); ! if (warning (OPT_Wconversion, "choosing %qD over %qD", w->fn, l->fn) ! && warning (OPT_Wconversion, " for conversion from %qT to %qT", ! source, w->second_conv->type)) ! { ! inform (input_location, " because conversion sequence for the argument is better"); ! } } else add_warning (w, l); *************** joust (struct z_candidate *cand1, struct *** 6454,6464 **** } } ! /* If the two functions are the same (this can happen with declarations ! in multiple scopes and arg-dependent lookup), arbitrarily choose one. */ if (DECL_P (cand1->fn) && DECL_P (cand2->fn) && equal_functions (cand1->fn, cand2->fn)) ! return 1; tweak: --- 6803,6858 ---- } } ! /* If the two function declarations represent the same function (this can ! happen with declarations in multiple scopes and arg-dependent lookup), ! arbitrarily choose one. But first make sure the default args we're ! using match. */ if (DECL_P (cand1->fn) && DECL_P (cand2->fn) && equal_functions (cand1->fn, cand2->fn)) ! { ! tree parms1 = TYPE_ARG_TYPES (TREE_TYPE (cand1->fn)); ! tree parms2 = TYPE_ARG_TYPES (TREE_TYPE (cand2->fn)); ! ! gcc_assert (!DECL_CONSTRUCTOR_P (cand1->fn)); ! ! for (i = 0; i < len; ++i) ! { ! /* Don't crash if the fn is variadic. */ ! if (!parms1) ! break; ! parms1 = TREE_CHAIN (parms1); ! parms2 = TREE_CHAIN (parms2); ! } ! ! if (off1) ! parms1 = TREE_CHAIN (parms1); ! else if (off2) ! parms2 = TREE_CHAIN (parms2); ! ! for (; parms1; ++i) ! { ! if (!cp_tree_equal (TREE_PURPOSE (parms1), ! TREE_PURPOSE (parms2))) ! { ! if (warn) ! { ! permerror (input_location, "default argument mismatch in " ! "overload resolution"); ! inform (input_location, ! " candidate 1: %q+#F", cand1->fn); ! inform (input_location, ! " candidate 2: %q+#F", cand2->fn); ! } ! else ! add_warning (cand1, cand2); ! break; ! } ! parms1 = TREE_CHAIN (parms1); ! parms2 = TREE_CHAIN (parms2); ! } ! ! return 1; ! } tweak: *************** tweak: *** 6484,6493 **** { if (warn) { ! pedwarn ("\ ! ISO C++ says that these are ambiguous, even \ ! though the worst conversion for the first is better than \ ! the worst conversion for the second:"); print_z_candidate (_("candidate 1:"), w); print_z_candidate (_("candidate 2:"), l); } --- 6878,6887 ---- { if (warn) { ! pedwarn (input_location, 0, ! "ISO C++ says that these are ambiguous, even " ! "though the worst conversion for the first is better than " ! "the worst conversion for the second:"); print_z_candidate (_("candidate 1:"), w); print_z_candidate (_("candidate 2:"), l); } *************** can_convert_arg_bad (tree to, tree from, *** 6612,6618 **** doing a bad conversion, convert_like will complain. */ tree ! perform_implicit_conversion (tree type, tree expr) { conversion *conv; void *p; --- 7006,7012 ---- doing a bad conversion, convert_like will complain. */ tree ! perform_implicit_conversion (tree type, tree expr, tsubst_flags_t complain) { conversion *conv; void *p; *************** perform_implicit_conversion (tree type, *** 6628,6634 **** LOOKUP_NORMAL); if (!conv) { ! error ("could not convert %qE to %qT", expr, type); expr = error_mark_node; } else if (processing_template_decl) --- 7022,7029 ---- LOOKUP_NORMAL); if (!conv) { ! if (complain & tf_error) ! error ("could not convert %qE to %qT", expr, type); expr = error_mark_node; } else if (processing_template_decl) *************** perform_implicit_conversion (tree type, *** 6640,6646 **** expr = build_nop (type, expr); } else ! expr = convert_like (conv, expr); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); --- 7035,7041 ---- expr = build_nop (type, expr); } else ! expr = convert_like (conv, expr, complain); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); *************** perform_implicit_conversion (tree type, *** 6659,6665 **** tree perform_direct_initialization_if_possible (tree type, tree expr, ! bool c_cast_p) { conversion *conv; void *p; --- 7054,7061 ---- tree perform_direct_initialization_if_possible (tree type, tree expr, ! bool c_cast_p, ! tsubst_flags_t complain) { conversion *conv; void *p; *************** perform_direct_initialization_if_possibl *** 6678,6684 **** { expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), ! type, LOOKUP_NORMAL); return build_cplus_new (type, expr); } --- 7074,7080 ---- { expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), ! type, LOOKUP_NORMAL, complain); return build_cplus_new (type, expr); } *************** perform_direct_initialization_if_possibl *** 6693,6699 **** else expr = convert_like_real (conv, expr, NULL_TREE, 0, 0, /*issue_conversion_warnings=*/false, ! c_cast_p); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); --- 7089,7096 ---- else expr = convert_like_real (conv, expr, NULL_TREE, 0, 0, /*issue_conversion_warnings=*/false, ! c_cast_p, ! tf_warning_or_error); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); *************** make_temporary_var_for_ref_to_temp (tree *** 6733,6738 **** --- 7130,7205 ---- return var; } + /* EXPR is the initializer for a variable DECL of reference or + std::initializer_list type. Create, push and return a new VAR_DECL + for the initializer so that it will live as long as DECL. Any + cleanup for the new variable is returned through CLEANUP, and the + code to initialize the new variable is returned through INITP. */ + + tree + set_up_extended_ref_temp (tree decl, tree expr, tree *cleanup, tree *initp) + { + tree init; + tree type; + tree var; + + /* Create the temporary variable. */ + type = TREE_TYPE (expr); + var = make_temporary_var_for_ref_to_temp (decl, type); + layout_decl (var, 0); + /* If the rvalue is the result of a function call it will be + a TARGET_EXPR. If it is some other construct (such as a + member access expression where the underlying object is + itself the result of a function call), turn it into a + TARGET_EXPR here. It is important that EXPR be a + TARGET_EXPR below since otherwise the INIT_EXPR will + attempt to make a bitwise copy of EXPR to initialize + VAR. */ + if (TREE_CODE (expr) != TARGET_EXPR) + expr = get_target_expr (expr); + /* Create the INIT_EXPR that will initialize the temporary + variable. */ + init = build2 (INIT_EXPR, type, var, expr); + if (at_function_scope_p ()) + { + add_decl_expr (var); + + if (TREE_STATIC (var)) + init = add_stmt_to_compound (init, register_dtor_fn (var)); + else + *cleanup = cxx_maybe_build_cleanup (var); + + /* We must be careful to destroy the temporary only + after its initialization has taken place. If the + initialization throws an exception, then the + destructor should not be run. We cannot simply + transform INIT into something like: + + (INIT, ({ CLEANUP_STMT; })) + + because emit_local_var always treats the + initializer as a full-expression. Thus, the + destructor would run too early; it would run at the + end of initializing the reference variable, rather + than at the end of the block enclosing the + reference variable. + + The solution is to pass back a cleanup expression + which the caller is responsible for attaching to + the statement tree. */ + } + else + { + rest_of_decl_compilation (var, /*toplev=*/1, at_eof); + if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) + static_aggregates = tree_cons (NULL_TREE, var, + static_aggregates); + } + + *initp = init; + return var; + } + /* Convert EXPR to the indicated reference TYPE, in a way suitable for initializing a variable of that TYPE. If DECL is non-NULL, it is the VAR_DECL being initialized with the EXPR. (In that case, the *************** initialize_reference (tree type, tree ex *** 6828,6834 **** /*fn=*/NULL_TREE, /*argnum=*/0, /*inner=*/-1, /*issue_conversion_warnings=*/true, ! /*c_cast_p=*/false); if (error_operand_p (expr)) expr = error_mark_node; else --- 7295,7302 ---- /*fn=*/NULL_TREE, /*argnum=*/0, /*inner=*/-1, /*issue_conversion_warnings=*/true, ! /*c_cast_p=*/false, ! tf_warning_or_error); if (error_operand_p (expr)) expr = error_mark_node; else *************** initialize_reference (tree type, tree ex *** 6836,6895 **** if (!real_lvalue_p (expr)) { tree init; ! tree type; ! ! /* Create the temporary variable. */ ! type = TREE_TYPE (expr); ! var = make_temporary_var_for_ref_to_temp (decl, type); ! layout_decl (var, 0); ! /* If the rvalue is the result of a function call it will be ! a TARGET_EXPR. If it is some other construct (such as a ! member access expression where the underlying object is ! itself the result of a function call), turn it into a ! TARGET_EXPR here. It is important that EXPR be a ! TARGET_EXPR below since otherwise the INIT_EXPR will ! attempt to make a bitwise copy of EXPR to initialize ! VAR. */ ! if (TREE_CODE (expr) != TARGET_EXPR) ! expr = get_target_expr (expr); ! /* Create the INIT_EXPR that will initialize the temporary ! variable. */ ! init = build2 (INIT_EXPR, type, var, expr); ! if (at_function_scope_p ()) ! { ! add_decl_expr (var); ! ! if (TREE_STATIC (var)) ! init = add_stmt_to_compound (init, register_dtor_fn (var)); ! else ! *cleanup = cxx_maybe_build_cleanup (var); ! ! /* We must be careful to destroy the temporary only ! after its initialization has taken place. If the ! initialization throws an exception, then the ! destructor should not be run. We cannot simply ! transform INIT into something like: ! ! (INIT, ({ CLEANUP_STMT; })) ! ! because emit_local_var always treats the ! initializer as a full-expression. Thus, the ! destructor would run too early; it would run at the ! end of initializing the reference variable, rather ! than at the end of the block enclosing the ! reference variable. ! ! The solution is to pass back a cleanup expression ! which the caller is responsible for attaching to ! the statement tree. */ ! } ! else ! { ! rest_of_decl_compilation (var, /*toplev=*/1, at_eof); ! if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) ! static_aggregates = tree_cons (NULL_TREE, var, ! static_aggregates); ! } /* Use its address to initialize the reference variable. */ expr = build_address (var); if (base_conv_type) --- 7304,7310 ---- if (!real_lvalue_p (expr)) { tree init; ! var = set_up_extended_ref_temp (decl, expr, cleanup, &init); /* Use its address to initialize the reference variable. */ expr = build_address (var); if (base_conv_type) *************** initialize_reference (tree type, tree ex *** 6901,6917 **** } else /* Take the address of EXPR. */ ! expr = build_unary_op (ADDR_EXPR, expr, 0); /* If a BASE_CONV was required, perform it now. */ if (base_conv_type) expr = (perform_implicit_conversion ! (build_pointer_type (base_conv_type), expr)); expr = build_nop (type, expr); } } else /* Perform the conversion. */ ! expr = convert_like (conv, expr); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); --- 7316,7333 ---- } else /* Take the address of EXPR. */ ! expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error); /* If a BASE_CONV was required, perform it now. */ if (base_conv_type) expr = (perform_implicit_conversion ! (build_pointer_type (base_conv_type), expr, ! tf_warning_or_error)); expr = build_nop (type, expr); } } else /* Perform the conversion. */ ! expr = convert_like (conv, expr, tf_warning_or_error); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); *************** initialize_reference (tree type, tree ex *** 6919,6922 **** --- 7335,7373 ---- return expr; } + /* Returns true iff TYPE is some variant of std::initializer_list. */ + + bool + is_std_init_list (tree type) + { + return (CLASS_TYPE_P (type) + && CP_TYPE_CONTEXT (type) == std_node + && strcmp (TYPE_NAME_STRING (type), "initializer_list") == 0); + } + + /* Returns true iff DECL is a list constructor: i.e. a constructor which + will accept an argument list of a single std::initializer_list. */ + + bool + is_list_ctor (tree decl) + { + tree args = FUNCTION_FIRST_USER_PARMTYPE (decl); + tree arg; + + if (!args || args == void_list_node) + return false; + + arg = non_reference (TREE_VALUE (args)); + if (!is_std_init_list (arg)) + return false; + + args = TREE_CHAIN (args); + + if (args && args != void_list_node && !TREE_PURPOSE (args)) + /* There are more non-defaulted parms. */ + return false; + + return true; + } + #include "gt-cp-call.h" diff -Nrcpad gcc-4.3.3/gcc/cp/cfns.h gcc-4.4.0/gcc/cp/cfns.h *** gcc-4.3.3/gcc/cp/cfns.h Tue Jun 6 11:44:09 2006 --- gcc-4.4.0/gcc/cp/cfns.h Wed Feb 18 21:01:03 2009 *************** *** 1,5 **** /* ANSI-C code produced by gperf version 3.0.1 */ ! /* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C ../../gcc/gcc/cp/cfns.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ --- 1,5 ---- /* ANSI-C code produced by gperf version 3.0.1 */ ! /* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C ../../gcc/cp/cfns.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ *************** *** 28,34 **** #error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif ! #line 1 "../../gcc/gcc/cp/cfns.gperf" #ifdef __GNUC__ __inline --- 28,34 ---- #error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif ! #line 1 "../../gcc/cp/cfns.gperf" #ifdef __GNUC__ __inline diff -Nrcpad gcc-4.3.3/gcc/cp/class.c gcc-4.4.0/gcc/cp/class.c *** gcc-4.3.3/gcc/cp/class.c Sun Jun 15 11:57:33 2008 --- gcc-4.4.0/gcc/cp/class.c Wed Apr 8 03:55:00 2009 *************** *** 1,6 **** /* Functions related to building classes and their related objects. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) --- 1,6 ---- /* Functions related to building classes and their related objects. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) *************** build_base_path (enum tree_code code, *** 284,290 **** if (!want_pointer) /* This must happen before the call to save_expr. */ ! expr = build_unary_op (ADDR_EXPR, expr, 0); offset = BINFO_OFFSET (binfo); fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull); --- 284,290 ---- if (!want_pointer) /* This must happen before the call to save_expr. */ ! expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error); offset = BINFO_OFFSET (binfo); fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull); *************** build_base_path (enum tree_code code, *** 299,305 **** { expr = build_nop (build_pointer_type (target_type), expr); if (!want_pointer) ! expr = build_indirect_ref (expr, NULL); return expr; } --- 299,305 ---- { expr = build_nop (build_pointer_type (target_type), expr); if (!want_pointer) ! expr = build_indirect_ref (EXPR_LOCATION (expr), expr, NULL); return expr; } *************** build_base_path (enum tree_code code, *** 345,351 **** interesting to the optimizers anyway. */ && !has_empty) { ! expr = build_indirect_ref (expr, NULL); expr = build_simple_base_path (expr, binfo); if (want_pointer) expr = build_address (expr); --- 345,351 ---- interesting to the optimizers anyway. */ && !has_empty) { ! expr = cp_build_indirect_ref (expr, NULL, tf_warning_or_error); expr = build_simple_base_path (expr, binfo); if (want_pointer) expr = build_address (expr); *************** build_base_path (enum tree_code code, *** 370,379 **** t = TREE_TYPE (TYPE_VFIELD (current_class_type)); t = build_pointer_type (t); v_offset = convert (t, current_vtt_parm); ! v_offset = build_indirect_ref (v_offset, NULL); } else ! v_offset = build_vfield_ref (build_indirect_ref (expr, NULL), TREE_TYPE (TREE_TYPE (expr))); v_offset = build2 (POINTER_PLUS_EXPR, TREE_TYPE (v_offset), --- 370,381 ---- t = TREE_TYPE (TYPE_VFIELD (current_class_type)); t = build_pointer_type (t); v_offset = convert (t, current_vtt_parm); ! v_offset = cp_build_indirect_ref (v_offset, NULL, ! tf_warning_or_error); } else ! v_offset = build_vfield_ref (cp_build_indirect_ref (expr, NULL, ! tf_warning_or_error), TREE_TYPE (TREE_TYPE (expr))); v_offset = build2 (POINTER_PLUS_EXPR, TREE_TYPE (v_offset), *************** build_base_path (enum tree_code code, *** 381,389 **** v_offset = build1 (NOP_EXPR, build_pointer_type (ptrdiff_type_node), v_offset); ! v_offset = build_indirect_ref (v_offset, NULL); TREE_CONSTANT (v_offset) = 1; - TREE_INVARIANT (v_offset) = 1; offset = convert_to_integer (ptrdiff_type_node, size_diffop (offset, --- 383,390 ---- v_offset = build1 (NOP_EXPR, build_pointer_type (ptrdiff_type_node), v_offset); ! v_offset = cp_build_indirect_ref (v_offset, NULL, tf_warning_or_error); TREE_CONSTANT (v_offset) = 1; offset = convert_to_integer (ptrdiff_type_node, size_diffop (offset, *************** build_base_path (enum tree_code code, *** 425,431 **** null_test = NULL; if (!want_pointer) ! expr = build_indirect_ref (expr, NULL); out: if (null_test) --- 426,432 ---- null_test = NULL; if (!want_pointer) ! expr = cp_build_indirect_ref (expr, NULL, tf_warning_or_error); out: if (null_test) *************** build_simple_base_path (tree expr, tree *** 459,465 **** in the back end. */ temp = unary_complex_lvalue (ADDR_EXPR, expr); if (temp) ! expr = build_indirect_ref (temp, NULL); return expr; } --- 460,466 ---- in the back end. */ temp = unary_complex_lvalue (ADDR_EXPR, expr); if (temp) ! expr = cp_build_indirect_ref (temp, NULL, tf_warning_or_error); return expr; } *************** convert_to_base_statically (tree expr, t *** 551,557 **** when processing a template because they do not handle C++-specific trees. */ gcc_assert (!processing_template_decl); ! expr = build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1); if (!integer_zerop (BINFO_OFFSET (base))) expr = fold_build2 (POINTER_PLUS_EXPR, pointer_type, expr, fold_convert (sizetype, BINFO_OFFSET (base))); --- 552,559 ---- when processing a template because they do not handle C++-specific trees. */ gcc_assert (!processing_template_decl); ! expr = cp_build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1, ! tf_warning_or_error); if (!integer_zerop (BINFO_OFFSET (base))) expr = fold_build2 (POINTER_PLUS_EXPR, pointer_type, expr, fold_convert (sizetype, BINFO_OFFSET (base))); *************** build_vtbl_ref_1 (tree instance, tree id *** 625,633 **** assemble_external (vtbl); ! aref = build_array_ref (vtbl, idx); TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx); - TREE_INVARIANT (aref) = TREE_CONSTANT (aref); return aref; } --- 627,634 ---- assemble_external (vtbl); ! aref = build_array_ref (vtbl, idx, input_location); TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx); return aref; } *************** build_vfn_ref (tree instance_ptr, tree i *** 648,660 **** { tree aref; ! aref = build_vtbl_ref_1 (build_indirect_ref (instance_ptr, 0), idx); /* When using function descriptors, the address of the vtable entry is treated as a function pointer. */ if (TARGET_VTABLE_USES_DESCRIPTORS) aref = build1 (NOP_EXPR, TREE_TYPE (aref), ! build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1)); /* Remember this as a method reference, for later devirtualization. */ aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx); --- 649,664 ---- { tree aref; ! aref = build_vtbl_ref_1 (cp_build_indirect_ref (instance_ptr, 0, ! tf_warning_or_error), ! idx); /* When using function descriptors, the address of the vtable entry is treated as a function pointer. */ if (TARGET_VTABLE_USES_DESCRIPTORS) aref = build1 (NOP_EXPR, TREE_TYPE (aref), ! cp_build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1, ! tf_warning_or_error)); /* Remember this as a method reference, for later devirtualization. */ aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx); *************** finish_struct_bits (tree t) *** 1490,1496 **** DECL_MODE (TYPE_MAIN_DECL (t)) = BLKmode; for (variants = t; variants; variants = TYPE_NEXT_VARIANT (variants)) { ! TYPE_MODE (variants) = BLKmode; TREE_ADDRESSABLE (variants) = 1; } } --- 1494,1500 ---- DECL_MODE (TYPE_MAIN_DECL (t)) = BLKmode; for (variants = t; variants; variants = TYPE_NEXT_VARIANT (variants)) { ! SET_TYPE_MODE (variants, BLKmode); TREE_ADDRESSABLE (variants) = 1; } } *************** finish_struct_anon (tree t) *** 2493,2519 **** if (TREE_CODE (elt) != FIELD_DECL) { if (is_union) ! pedwarn ("%q+#D invalid; an anonymous union can " ! "only have non-static data members", elt); else ! pedwarn ("%q+#D invalid; an anonymous struct can " ! "only have non-static data members", elt); continue; } if (TREE_PRIVATE (elt)) { if (is_union) ! pedwarn ("private member %q+#D in anonymous union", elt); else ! pedwarn ("private member %q+#D in anonymous struct", elt); } else if (TREE_PROTECTED (elt)) { if (is_union) ! pedwarn ("protected member %q+#D in anonymous union", elt); else ! pedwarn ("protected member %q+#D in anonymous struct", elt); } TREE_PRIVATE (elt) = TREE_PRIVATE (field); --- 2497,2523 ---- if (TREE_CODE (elt) != FIELD_DECL) { if (is_union) ! permerror (input_location, "%q+#D invalid; an anonymous union can " ! "only have non-static data members", elt); else ! permerror (input_location, "%q+#D invalid; an anonymous struct can " ! "only have non-static data members", elt); continue; } if (TREE_PRIVATE (elt)) { if (is_union) ! permerror (input_location, "private member %q+#D in anonymous union", elt); else ! permerror (input_location, "private member %q+#D in anonymous struct", elt); } else if (TREE_PROTECTED (elt)) { if (is_union) ! permerror (input_location, "protected member %q+#D in anonymous union", elt); else ! permerror (input_location, "protected member %q+#D in anonymous struct", elt); } TREE_PRIVATE (elt) = TREE_PRIVATE (field); *************** check_bitfield_decl (tree field) *** 2724,2733 **** warning (0, "width of %q+D exceeds its type", field); else if (TREE_CODE (type) == ENUMERAL_TYPE && (0 > compare_tree_int (w, ! min_precision (TYPE_MIN_VALUE (type), ! TYPE_UNSIGNED (type))) || 0 > compare_tree_int (w, ! min_precision (TYPE_MAX_VALUE (type), TYPE_UNSIGNED (type))))) warning (0, "%q+D is too small to hold all values of %q#T", field, type); --- 2728,2738 ---- warning (0, "width of %q+D exceeds its type", field); else if (TREE_CODE (type) == ENUMERAL_TYPE && (0 > compare_tree_int (w, ! tree_int_cst_min_precision ! (TYPE_MIN_VALUE (type), ! TYPE_UNSIGNED (type))) || 0 > compare_tree_int (w, ! tree_int_cst_min_precision (TYPE_MAX_VALUE (type), TYPE_UNSIGNED (type))))) warning (0, "%q+D is too small to hold all values of %q#T", field, type); *************** check_field_decls (tree t, tree *access_ *** 2969,2975 **** x); cant_pack = 1; } ! else if (TYPE_ALIGN (TREE_TYPE (x)) > BITS_PER_UNIT) DECL_PACKED (x) = 1; } --- 2974,2981 ---- x); cant_pack = 1; } ! else if (DECL_C_BIT_FIELD (x) ! || TYPE_ALIGN (TREE_TYPE (x)) > BITS_PER_UNIT) DECL_PACKED (x) = 1; } *************** check_field_decls (tree t, tree *access_ *** 3041,3050 **** /* Core issue 80: A nonstatic data member is required to have a different name from the class iff the class has a ! user-defined constructor. */ if (constructor_name_p (DECL_NAME (x), t) && TYPE_HAS_USER_CONSTRUCTOR (t)) ! pedwarn ("field %q+#D with same name as class", x); /* We set DECL_C_BIT_FIELD in grokbitfield. If the type and width are valid, we'll also set DECL_BIT_FIELD. */ --- 3047,3056 ---- /* Core issue 80: A nonstatic data member is required to have a different name from the class iff the class has a ! user-declared constructor. */ if (constructor_name_p (DECL_NAME (x), t) && TYPE_HAS_USER_CONSTRUCTOR (t)) ! permerror (input_location, "field %q+#D with same name as class", x); /* We set DECL_C_BIT_FIELD in grokbitfield. If the type and width are valid, we'll also set DECL_BIT_FIELD. */ *************** check_methods (tree t) *** 3763,3770 **** if (DECL_PURE_VIRTUAL_P (x)) VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x); } ! /* All user-declared destructors are non-trivial. */ ! if (DECL_DESTRUCTOR_P (x)) TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1; } } --- 3769,3776 ---- if (DECL_PURE_VIRTUAL_P (x)) VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x); } ! /* All user-provided destructors are non-trivial. */ ! if (DECL_DESTRUCTOR_P (x) && !DECL_DEFAULTED_FN (x)) TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1; } } *************** type_has_user_nondefault_constructor (tr *** 4063,4068 **** --- 4069,4164 ---- return false; } + /* Returns true iff FN is a user-provided function, i.e. user-declared + and not defaulted at its first declaration. */ + + static bool + user_provided_p (tree fn) + { + if (TREE_CODE (fn) == TEMPLATE_DECL) + return true; + else + return (!DECL_ARTIFICIAL (fn) + && !(DECL_DEFAULTED_FN (fn) + && DECL_INITIALIZED_IN_CLASS_P (fn))); + } + + /* Returns true iff class T has a user-provided constructor. */ + + bool + type_has_user_provided_constructor (tree t) + { + tree fns; + + if (!CLASS_TYPE_P (t)) + return false; + + if (!TYPE_HAS_USER_CONSTRUCTOR (t)) + return false; + + /* This can happen in error cases; avoid crashing. */ + if (!CLASSTYPE_METHOD_VEC (t)) + return false; + + for (fns = CLASSTYPE_CONSTRUCTORS (t); fns; fns = OVL_NEXT (fns)) + if (user_provided_p (OVL_CURRENT (fns))) + return true; + + return false; + } + + /* Returns true iff class T has a user-provided default constructor. */ + + bool + type_has_user_provided_default_constructor (tree t) + { + tree fns, args; + + if (!TYPE_HAS_USER_CONSTRUCTOR (t)) + return false; + + for (fns = CLASSTYPE_CONSTRUCTORS (t); fns; fns = OVL_NEXT (fns)) + { + tree fn = OVL_CURRENT (fns); + if (TREE_CODE (fn) == FUNCTION_DECL + && user_provided_p (fn)) + { + args = FUNCTION_FIRST_USER_PARMTYPE (fn); + while (args && TREE_PURPOSE (args)) + args = TREE_CHAIN (args); + if (!args || args == void_list_node) + return true; + } + } + + return false; + } + + /* Returns true if FN can be explicitly defaulted. */ + + bool + defaultable_fn_p (tree fn) + { + if (DECL_CONSTRUCTOR_P (fn)) + { + if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node) + return true; + else if (copy_fn_p (fn) > 0 + && (TREE_CHAIN (FUNCTION_FIRST_USER_PARMTYPE (fn)) + == void_list_node)) + return true; + else + return false; + } + else if (DECL_DESTRUCTOR_P (fn)) + return true; + else if (DECL_ASSIGNMENT_OPERATOR_P (fn) + && DECL_OVERLOADED_OPERATOR_P (fn) == NOP_EXPR) + return copy_fn_p (fn); + else + return false; + } + /* Remove all zero-width bit-fields from T. */ static void *************** check_bases_and_members (tree t) *** 4154,4159 **** --- 4250,4257 ---- should take a non-const reference argument. */ int no_const_asn_ref; tree access_decls; + bool saved_complex_asn_ref; + bool saved_nontrivial_dtor; /* By default, we use const reference arguments and generate default constructors. */ *************** check_bases_and_members (tree t) *** 4167,4172 **** --- 4265,4276 ---- /* Check all the method declarations. */ check_methods (t); + /* Save the initial values of these flags which only indicate whether + or not the class has user-provided functions. As we analyze the + bases and members we can set these flags for other reasons. */ + saved_complex_asn_ref = TYPE_HAS_COMPLEX_ASSIGN_REF (t); + saved_nontrivial_dtor = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t); + /* Check all the data member declarations. We cannot call check_field_decls until we have called check_bases check_methods, as check_field_decls depends on TYPE_HAS_NONTRIVIAL_DESTRUCTOR *************** check_bases_and_members (tree t) *** 4182,4218 **** /* Do some bookkeeping that will guide the generation of implicitly declared member functions. */ ! TYPE_HAS_COMPLEX_INIT_REF (t) ! |= (TYPE_HAS_INIT_REF (t) || TYPE_CONTAINS_VPTR_P (t)); /* We need to call a constructor for this class if it has a ! user-declared constructor, or if the default constructor is going to initialize the vptr. (This is not an if-and-only-if; TYPE_NEEDS_CONSTRUCTING is set elsewhere if bases or members themselves need constructing.) */ TYPE_NEEDS_CONSTRUCTING (t) ! |= (TYPE_HAS_USER_CONSTRUCTOR (t) || TYPE_CONTAINS_VPTR_P (t)); /* [dcl.init.aggr] ! An aggregate is an arry or a class with no user-declared constructors ... and no virtual functions. Again, other conditions for being an aggregate are checked elsewhere. */ CLASSTYPE_NON_AGGREGATE (t) ! |= (TYPE_HAS_USER_CONSTRUCTOR (t) || TYPE_POLYMORPHIC_P (t)); CLASSTYPE_NON_POD_P (t) |= (CLASSTYPE_NON_AGGREGATE (t) ! || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) ! || TYPE_HAS_ASSIGN_REF (t)); ! TYPE_HAS_COMPLEX_ASSIGN_REF (t) ! |= TYPE_HAS_ASSIGN_REF (t) || TYPE_CONTAINS_VPTR_P (t); ! TYPE_HAS_COMPLEX_DFLT (t) ! |= (TYPE_HAS_DEFAULT_CONSTRUCTOR (t) || TYPE_CONTAINS_VPTR_P (t)); /* If the class has no user-declared constructor, but does have non-static const or reference data members that can never be initialized, issue a warning. */ ! if (extra_warnings /* Classes with user-declared constructors are presumed to initialize these members. */ && !TYPE_HAS_USER_CONSTRUCTOR (t) --- 4286,4318 ---- /* Do some bookkeeping that will guide the generation of implicitly declared member functions. */ ! TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_CONTAINS_VPTR_P (t); /* We need to call a constructor for this class if it has a ! user-provided constructor, or if the default constructor is going to initialize the vptr. (This is not an if-and-only-if; TYPE_NEEDS_CONSTRUCTING is set elsewhere if bases or members themselves need constructing.) */ TYPE_NEEDS_CONSTRUCTING (t) ! |= (type_has_user_provided_constructor (t) || TYPE_CONTAINS_VPTR_P (t)); /* [dcl.init.aggr] ! An aggregate is an array or a class with no user-provided constructors ... and no virtual functions. Again, other conditions for being an aggregate are checked elsewhere. */ CLASSTYPE_NON_AGGREGATE (t) ! |= (type_has_user_provided_constructor (t) || TYPE_POLYMORPHIC_P (t)); CLASSTYPE_NON_POD_P (t) |= (CLASSTYPE_NON_AGGREGATE (t) ! || saved_nontrivial_dtor || saved_complex_asn_ref); ! TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_CONTAINS_VPTR_P (t); ! TYPE_HAS_COMPLEX_DFLT (t) |= TYPE_CONTAINS_VPTR_P (t); /* If the class has no user-declared constructor, but does have non-static const or reference data members that can never be initialized, issue a warning. */ ! if (warn_uninitialized /* Classes with user-declared constructors are presumed to initialize these members. */ && !TYPE_HAS_USER_CONSTRUCTOR (t) *************** check_bases_and_members (tree t) *** 4231,4243 **** type = TREE_TYPE (field); if (TREE_CODE (type) == REFERENCE_TYPE) ! warning (OPT_Wextra, "non-static reference %q+#D in class " ! "without a constructor", field); else if (CP_TYPE_CONST_P (type) && (!CLASS_TYPE_P (type) || !TYPE_HAS_DEFAULT_CONSTRUCTOR (type))) ! warning (OPT_Wextra, "non-static const member %q+#D in class " ! "without a constructor", field); } } --- 4331,4343 ---- type = TREE_TYPE (field); if (TREE_CODE (type) == REFERENCE_TYPE) ! warning (OPT_Wuninitialized, "non-static reference %q+#D " ! "in class without a constructor", field); else if (CP_TYPE_CONST_P (type) && (!CLASS_TYPE_P (type) || !TYPE_HAS_DEFAULT_CONSTRUCTOR (type))) ! warning (OPT_Wuninitialized, "non-static const member %q+#D " ! "in class without a constructor", field); } } *************** layout_class_type (tree t, tree *virtual *** 4932,4938 **** remove_zero_width_bit_fields (t); /* Create the version of T used for virtual bases. We do not use ! make_aggr_type for this version; this is an artificial type. For a POD type, we just reuse T. */ if (CLASSTYPE_NON_POD_P (t) || CLASSTYPE_EMPTY_P (t)) { --- 5032,5038 ---- remove_zero_width_bit_fields (t); /* Create the version of T used for virtual bases. We do not use ! make_class_type for this version; this is an artificial type. For a POD type, we just reuse T. */ if (CLASSTYPE_NON_POD_P (t) || CLASSTYPE_EMPTY_P (t)) { *************** finish_struct_1 (tree t) *** 5092,5098 **** if (COMPLETE_TYPE_P (t)) { ! gcc_assert (IS_AGGR_TYPE (t)); error ("redefinition of %q#T", t); popclass (); return; --- 5192,5198 ---- if (COMPLETE_TYPE_P (t)) { ! gcc_assert (MAYBE_CLASS_TYPE_P (t)); error ("redefinition of %q#T", t); popclass (); return; *************** fixed_type_or_null (tree instance, int * *** 5411,5418 **** return NULL_TREE; ! case NOP_EXPR: ! case CONVERT_EXPR: return RECUR (TREE_OPERAND (instance, 0)); case ADDR_EXPR: --- 5511,5517 ---- return NULL_TREE; ! CASE_CONVERT: return RECUR (TREE_OPERAND (instance, 0)); case ADDR_EXPR: *************** fixed_type_or_null (tree instance, int * *** 5438,5444 **** case VAR_DECL: case FIELD_DECL: if (TREE_CODE (TREE_TYPE (instance)) == ARRAY_TYPE ! && IS_AGGR_TYPE (TREE_TYPE (TREE_TYPE (instance)))) { if (nonnull) *nonnull = 1; --- 5537,5543 ---- case VAR_DECL: case FIELD_DECL: if (TREE_CODE (TREE_TYPE (instance)) == ARRAY_TYPE ! && MAYBE_CLASS_TYPE_P (TREE_TYPE (TREE_TYPE (instance)))) { if (nonnull) *nonnull = 1; *************** fixed_type_or_null (tree instance, int * *** 5448,5454 **** case TARGET_EXPR: case PARM_DECL: case RESULT_DECL: ! if (IS_AGGR_TYPE (TREE_TYPE (instance))) { if (nonnull) *nonnull = 1; --- 5547,5553 ---- case TARGET_EXPR: case PARM_DECL: case RESULT_DECL: ! if (MAYBE_CLASS_TYPE_P (TREE_TYPE (instance))) { if (nonnull) *nonnull = 1; *************** currently_open_class (tree t) *** 5688,5693 **** --- 5787,5795 ---- { int i; + if (!CLASS_TYPE_P (t)) + return false; + /* We start looking from 1 because entry 0 is from global scope, and has no type. */ for (i = current_class_depth; i > 0; --i) *************** pop_lang_context (void) *** 5830,5838 **** control of FLAGS. Permit pointers to member function if FLAGS permits. If TEMPLATE_ONLY, the name of the overloaded function was a template-id, and EXPLICIT_TARGS are the explicitly provided ! template arguments. If OVERLOAD is for one or more member ! functions, then ACCESS_PATH is the base path used to reference ! those member functions. */ static tree resolve_address_of_overloaded_function (tree target_type, --- 5932,5944 ---- control of FLAGS. Permit pointers to member function if FLAGS permits. If TEMPLATE_ONLY, the name of the overloaded function was a template-id, and EXPLICIT_TARGS are the explicitly provided ! template arguments. ! ! If OVERLOAD is for one or more member functions, then ACCESS_PATH ! is the base path used to reference those member functions. If ! TF_NO_ACCESS_CONTROL is not set in FLAGS, and the address is ! resolved to a member function, access checks will be performed and ! errors issued if appropriate. */ static tree resolve_address_of_overloaded_function (tree target_type, *************** resolve_address_of_overloaded_function ( *** 6046,6070 **** } else if (TREE_CHAIN (matches)) { ! /* There were too many matches. */ ! if (flags & tf_error) { ! tree match; ! error ("converting overloaded function %qD to type %q#T is ambiguous", ! DECL_NAME (OVL_FUNCTION (overload)), ! target_type); ! /* Since print_candidates expects the functions in the ! TREE_VALUE slot, we flip them here. */ ! for (match = matches; match; match = TREE_CHAIN (match)) ! TREE_VALUE (match) = TREE_PURPOSE (match); ! print_candidates (matches); } - - return error_mark_node; } /* Good, exactly one match. Now, convert it to the correct type. */ --- 6152,6184 ---- } else if (TREE_CHAIN (matches)) { ! /* There were too many matches. First check if they're all ! the same function. */ ! tree match; ! fn = TREE_PURPOSE (matches); ! for (match = TREE_CHAIN (matches); match; match = TREE_CHAIN (match)) ! if (!decls_match (fn, TREE_PURPOSE (matches))) ! break; ! ! if (match) { ! if (flags & tf_error) ! { ! error ("converting overloaded function %qD to type %q#T is ambiguous", ! DECL_NAME (OVL_FUNCTION (overload)), ! target_type); ! /* Since print_candidates expects the functions in the ! TREE_VALUE slot, we flip them here. */ ! for (match = matches; match; match = TREE_CHAIN (match)) ! TREE_VALUE (match) = TREE_PURPOSE (match); ! print_candidates (matches); ! } ! return error_mark_node; } } /* Good, exactly one match. Now, convert it to the correct type. */ *************** resolve_address_of_overloaded_function ( *** 6078,6087 **** if (!(flags & tf_error)) return error_mark_node; ! pedwarn ("assuming pointer to member %qD", fn); if (!explained) { ! pedwarn ("(a pointer to member can only be formed with %<&%E%>)", fn); explained = 1; } } --- 6192,6201 ---- if (!(flags & tf_error)) return error_mark_node; ! permerror (input_location, "assuming pointer to member %qD", fn); if (!explained) { ! inform (input_location, "(a pointer to member can only be formed with %<&%E%>)", fn); explained = 1; } } *************** resolve_address_of_overloaded_function ( *** 6092,6113 **** function will be marked as used at this point. */ if (!(flags & tf_conv)) { mark_used (fn); ! /* We could not check access when this expression was originally ! created since we did not know at that time to which function ! the expression referred. */ ! if (DECL_FUNCTION_MEMBER_P (fn)) ! { ! gcc_assert (access_path); ! perform_or_defer_access_check (access_path, fn, fn); ! } } if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type)) ! return build_unary_op (ADDR_EXPR, fn, 0); else { ! /* The target must be a REFERENCE_TYPE. Above, build_unary_op will mark the function as addressed, but here we must do it explicitly. */ cxx_mark_addressable (fn); --- 6206,6233 ---- function will be marked as used at this point. */ if (!(flags & tf_conv)) { + /* Make =delete work with SFINAE. */ + if (DECL_DELETED_FN (fn) && !(flags & tf_error)) + return error_mark_node; + mark_used (fn); ! } ! ! /* We could not check access to member functions when this ! expression was originally created since we did not know at that ! time to which function the expression referred. */ ! if (!(flags & tf_no_access_control) ! && DECL_FUNCTION_MEMBER_P (fn)) ! { ! gcc_assert (access_path); ! perform_or_defer_access_check (access_path, fn, fn); } if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type)) ! return cp_build_unary_op (ADDR_EXPR, fn, 0, flags); else { ! /* The target must be a REFERENCE_TYPE. Above, cp_build_unary_op will mark the function as addressed, but here we must do it explicitly. */ cxx_mark_addressable (fn); *************** is_empty_class (tree type) *** 6349,6355 **** if (type == error_mark_node) return 0; ! if (! IS_AGGR_TYPE (type)) return 0; /* In G++ 3.2, whether or not a class was empty was determined by --- 6469,6475 ---- if (type == error_mark_node) return 0; ! if (! CLASS_TYPE_P (type)) return 0; /* In G++ 3.2, whether or not a class was empty was determined by *************** contains_empty_class_p (tree type) *** 6389,6394 **** --- 6509,6545 ---- return false; } + /* Returns true if TYPE contains no actual data, just various + possible combinations of empty classes. */ + + bool + is_really_empty_class (tree type) + { + if (is_empty_class (type)) + return true; + if (CLASS_TYPE_P (type)) + { + tree field; + tree binfo; + tree base_binfo; + int i; + + for (binfo = TYPE_BINFO (type), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) + if (!is_really_empty_class (BINFO_TYPE (base_binfo))) + return false; + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + if (TREE_CODE (field) == FIELD_DECL + && !DECL_ARTIFICIAL (field) + && !is_really_empty_class (TREE_TYPE (field))) + return false; + return true; + } + else if (TREE_CODE (type) == ARRAY_TYPE) + return is_really_empty_class (TREE_TYPE (type)); + return false; + } + /* Note that NAME was looked up while the current class was being defined and that the result of that lookup was DECL. */ *************** note_name_declared_in_class (tree name, *** 6441,6448 **** A name N used in a class S shall refer to the same declaration in its context and when re-evaluated in the completed scope of S. */ ! pedwarn ("declaration of %q#D", decl); ! pedwarn ("changes meaning of %qD from %q+#D", DECL_NAME (OVL_CURRENT (decl)), (tree) n->value); } } --- 6592,6599 ---- A name N used in a class S shall refer to the same declaration in its context and when re-evaluated in the completed scope of S. */ ! permerror (input_location, "declaration of %q#D", decl); ! permerror (input_location, "changes meaning of %qD from %q+#D", DECL_NAME (OVL_CURRENT (decl)), (tree) n->value); } } *************** build_vtbl_initializer (tree binfo, *** 7383,7389 **** We first check this in update_vtable_entry_for_fn, so we handle restored primary bases properly; we also need to do it here so we ! zero out unused slots in ctor vtables, rather than filling themff with erroneous values (though harmless, apart from relocation costs). */ for (b = binfo; ; b = get_primary_binfo (b)) --- 7534,7540 ---- We first check this in update_vtable_entry_for_fn, so we handle restored primary bases properly; we also need to do it here so we ! zero out unused slots in ctor vtables, rather than filling them with erroneous values (though harmless, apart from relocation costs). */ for (b = binfo; ; b = get_primary_binfo (b)) *************** build_vtbl_initializer (tree binfo, *** 7448,7454 **** TREE_OPERAND (init, 0), build_int_cst (NULL_TREE, i)); TREE_CONSTANT (fdesc) = 1; - TREE_INVARIANT (fdesc) = 1; vfun_inits = tree_cons (NULL_TREE, fdesc, vfun_inits); } --- 7599,7604 ---- diff -Nrcpad gcc-4.3.3/gcc/cp/cp-gimplify.c gcc-4.4.0/gcc/cp/cp-gimplify.c *** gcc-4.3.3/gcc/cp/cp-gimplify.c Fri May 23 13:30:51 2008 --- gcc-4.4.0/gcc/cp/cp-gimplify.c Tue Mar 17 17:51:10 2009 *************** *** 1,6 **** /* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c. ! Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Jason Merrill --- 1,6 ---- /* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c. ! Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Jason Merrill *************** along with GCC; see the file COPYING3. *** 28,34 **** #include "cp-tree.h" #include "c-common.h" #include "toplev.h" ! #include "tree-gimple.h" #include "hashtab.h" #include "pointer-set.h" #include "flags.h" --- 28,35 ---- #include "cp-tree.h" #include "c-common.h" #include "toplev.h" ! #include "tree-iterator.h" ! #include "gimple.h" #include "hashtab.h" #include "pointer-set.h" #include "flags.h" *************** begin_bc_block (enum bc_t bc) *** 62,81 **** If we saw a break (or continue) in the scope, append a LABEL_EXPR to body. Otherwise, just forget the label. */ ! static tree ! finish_bc_block (enum bc_t bc, tree label, tree body) { gcc_assert (label == bc_label[bc]); if (TREE_USED (label)) { ! tree t, sl = NULL; ! ! t = build1 (LABEL_EXPR, void_type_node, label); ! ! append_to_statement_list (body, &sl); ! append_to_statement_list (t, &sl); ! body = sl; } bc_label[bc] = TREE_CHAIN (label); --- 63,76 ---- If we saw a break (or continue) in the scope, append a LABEL_EXPR to body. Otherwise, just forget the label. */ ! static gimple_seq ! finish_bc_block (enum bc_t bc, tree label, gimple_seq body) { gcc_assert (label == bc_label[bc]); if (TREE_USED (label)) { ! gimple_seq_add_stmt (&body, gimple_build_label (label)); } bc_label[bc] = TREE_CHAIN (label); *************** finish_bc_block (enum bc_t bc, tree labe *** 83,93 **** return body; } ! /* Build a GOTO_EXPR to represent a break or continue statement. BC ! indicates which. */ static tree ! build_bc_goto (enum bc_t bc) { tree label = bc_label[bc]; --- 78,88 ---- return body; } ! /* Get the LABEL_EXPR to represent a break or continue statement ! in the current block scope. BC indicates which. */ static tree ! get_bc_label (enum bc_t bc) { tree label = bc_label[bc]; *************** build_bc_goto (enum bc_t bc) *** 103,109 **** /* Mark the label used for finish_bc_block. */ TREE_USED (label) = 1; ! return build1 (GOTO_EXPR, void_type_node, label); } /* Genericize a TRY_BLOCK. */ --- 98,104 ---- /* Mark the label used for finish_bc_block. */ TREE_USED (label) = 1; ! return label; } /* Genericize a TRY_BLOCK. */ *************** genericize_try_block (tree *stmt_p) *** 114,126 **** tree body = TRY_STMTS (*stmt_p); tree cleanup = TRY_HANDLERS (*stmt_p); - gimplify_stmt (&body); - - if (CLEANUP_P (*stmt_p)) - /* A cleanup is an expression, so it doesn't need to be genericized. */; - else - gimplify_stmt (&cleanup); - *stmt_p = build2 (TRY_CATCH_EXPR, void_type_node, body, cleanup); } --- 109,114 ---- *************** genericize_catch_block (tree *stmt_p) *** 132,143 **** tree type = HANDLER_TYPE (*stmt_p); tree body = HANDLER_BODY (*stmt_p); - gimplify_stmt (&body); - /* FIXME should the caught type go in TREE_TYPE? */ *stmt_p = build2 (CATCH_EXPR, void_type_node, type, body); } /* Genericize an EH_SPEC_BLOCK by converting it to a TRY_CATCH_EXPR/EH_FILTER_EXPR pair. */ --- 120,147 ---- tree type = HANDLER_TYPE (*stmt_p); tree body = HANDLER_BODY (*stmt_p); /* FIXME should the caught type go in TREE_TYPE? */ *stmt_p = build2 (CATCH_EXPR, void_type_node, type, body); } + /* A terser interface for building a representation of an exception + specification. */ + + static tree + build_gimple_eh_filter_tree (tree body, tree allowed, tree failure) + { + tree t; + + /* FIXME should the allowed types go in TREE_TYPE? */ + t = build2 (EH_FILTER_EXPR, void_type_node, allowed, NULL_TREE); + append_to_statement_list (failure, &EH_FILTER_FAILURE (t)); + + t = build2 (TRY_CATCH_EXPR, void_type_node, NULL_TREE, t); + append_to_statement_list (body, &TREE_OPERAND (t, 0)); + + return t; + } + /* Genericize an EH_SPEC_BLOCK by converting it to a TRY_CATCH_EXPR/EH_FILTER_EXPR pair. */ *************** genericize_eh_spec_block (tree *stmt_p) *** 147,163 **** tree body = EH_SPEC_STMTS (*stmt_p); tree allowed = EH_SPEC_RAISES (*stmt_p); tree failure = build_call_n (call_unexpected_node, 1, build_exc_ptr ()); - gimplify_stmt (&body); ! *stmt_p = gimple_build_eh_filter (body, allowed, failure); } /* Genericize an IF_STMT by turning it into a COND_EXPR. */ static void ! gimplify_if_stmt (tree *stmt_p) { tree stmt, cond, then_, else_; stmt = *stmt_p; cond = IF_COND (stmt); --- 151,167 ---- tree body = EH_SPEC_STMTS (*stmt_p); tree allowed = EH_SPEC_RAISES (*stmt_p); tree failure = build_call_n (call_unexpected_node, 1, build_exc_ptr ()); ! *stmt_p = build_gimple_eh_filter_tree (body, allowed, failure); } /* Genericize an IF_STMT by turning it into a COND_EXPR. */ static void ! genericize_if_stmt (tree *stmt_p) { tree stmt, cond, then_, else_; + location_t locus = EXPR_LOCATION (*stmt_p); stmt = *stmt_p; cond = IF_COND (stmt); *************** gimplify_if_stmt (tree *stmt_p) *** 175,180 **** --- 179,186 ---- stmt = else_; else stmt = build3 (COND_EXPR, void_type_node, cond, then_, else_); + if (CAN_HAVE_LOCATION_P (stmt) && !EXPR_HAS_LOCATION (stmt)) + SET_EXPR_LOCATION (stmt, locus); *stmt_p = stmt; } *************** gimplify_if_stmt (tree *stmt_p) *** 185,199 **** evaluated before the loop body as in while and for loops, or after the loop body as in do-while loops. */ ! static tree gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first) { ! tree top, entry, exit, cont_block, break_block, stmt_list, t; location_t stmt_locus; stmt_locus = input_location; ! stmt_list = NULL_TREE; ! entry = NULL_TREE; break_block = begin_bc_block (bc_break); cont_block = begin_bc_block (bc_continue); --- 191,210 ---- evaluated before the loop body as in while and for loops, or after the loop body as in do-while loops. */ ! static gimple_seq gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first) { ! gimple top, entry, stmt; ! gimple_seq stmt_list, body_seq, incr_seq, exit_seq; ! tree cont_block, break_block; location_t stmt_locus; stmt_locus = input_location; ! stmt_list = NULL; ! body_seq = NULL; ! incr_seq = NULL; ! exit_seq = NULL; ! entry = NULL; break_block = begin_bc_block (bc_break); cont_block = begin_bc_block (bc_continue); *************** gimplify_cp_loop (tree cond, tree body, *** 201,212 **** /* If condition is zero don't generate a loop construct. */ if (cond && integer_zerop (cond)) { ! top = NULL_TREE; ! exit = NULL_TREE; if (cond_is_first) { ! t = build_bc_goto (bc_break); ! append_to_statement_list (t, &stmt_list); } } else --- 212,223 ---- /* If condition is zero don't generate a loop construct. */ if (cond && integer_zerop (cond)) { ! top = NULL; if (cond_is_first) { ! stmt = gimple_build_goto (get_bc_label (bc_break)); ! gimple_set_location (stmt, stmt_locus); ! gimple_seq_add_stmt (&stmt_list, stmt); } } else *************** gimplify_cp_loop (tree cond, tree body, *** 215,258 **** back through the main gimplifier to lower it. Given that we have to gimplify the loop body NOW so that we can resolve break/continue stmts, seems easier to just expand to gotos. */ ! top = build1 (LABEL_EXPR, void_type_node, NULL_TREE); /* If we have an exit condition, then we build an IF with gotos either out of the loop, or to the top of it. If there's no exit condition, then we just build a jump back to the top. */ - exit = build_and_jump (&LABEL_EXPR_LABEL (top)); if (cond && !integer_nonzerop (cond)) { ! t = build_bc_goto (bc_break); ! exit = fold_build3 (COND_EXPR, void_type_node, cond, exit, t); ! gimplify_stmt (&exit); if (cond_is_first) { if (incr) { ! entry = build1 (LABEL_EXPR, void_type_node, NULL_TREE); ! t = build_and_jump (&LABEL_EXPR_LABEL (entry)); } else ! t = build_bc_goto (bc_continue); ! append_to_statement_list (t, &stmt_list); } } } ! gimplify_stmt (&body); ! gimplify_stmt (&incr); ! body = finish_bc_block (bc_continue, cont_block, body); ! append_to_statement_list (top, &stmt_list); ! append_to_statement_list (body, &stmt_list); ! append_to_statement_list (incr, &stmt_list); ! append_to_statement_list (entry, &stmt_list); ! append_to_statement_list (exit, &stmt_list); ! annotate_all_with_locus (&stmt_list, stmt_locus); return finish_bc_block (bc_break, break_block, stmt_list); } --- 226,280 ---- back through the main gimplifier to lower it. Given that we have to gimplify the loop body NOW so that we can resolve break/continue stmts, seems easier to just expand to gotos. */ ! top = gimple_build_label (create_artificial_label ()); /* If we have an exit condition, then we build an IF with gotos either out of the loop, or to the top of it. If there's no exit condition, then we just build a jump back to the top. */ if (cond && !integer_nonzerop (cond)) { ! if (cond != error_mark_node) ! { ! gimplify_expr (&cond, &exit_seq, NULL, is_gimple_val, fb_rvalue); ! stmt = gimple_build_cond (NE_EXPR, cond, ! build_int_cst (TREE_TYPE (cond), 0), ! gimple_label_label (top), ! get_bc_label (bc_break)); ! gimple_seq_add_stmt (&exit_seq, stmt); ! } if (cond_is_first) { if (incr) { ! entry = gimple_build_label (create_artificial_label ()); ! stmt = gimple_build_goto (gimple_label_label (entry)); } else ! stmt = gimple_build_goto (get_bc_label (bc_continue)); ! gimple_set_location (stmt, stmt_locus); ! gimple_seq_add_stmt (&stmt_list, stmt); } } + else + { + stmt = gimple_build_goto (gimple_label_label (top)); + gimple_seq_add_stmt (&exit_seq, stmt); + } } ! gimplify_stmt (&body, &body_seq); ! gimplify_stmt (&incr, &incr_seq); ! body_seq = finish_bc_block (bc_continue, cont_block, body_seq); ! gimple_seq_add_stmt (&stmt_list, top); ! gimple_seq_add_seq (&stmt_list, body_seq); ! gimple_seq_add_seq (&stmt_list, incr_seq); ! gimple_seq_add_stmt (&stmt_list, entry); ! gimple_seq_add_seq (&stmt_list, exit_seq); ! annotate_all_with_location (stmt_list, stmt_locus); return finish_bc_block (bc_break, break_block, stmt_list); } *************** gimplify_cp_loop (tree cond, tree body, *** 261,305 **** prequeue and hand off to gimplify_cp_loop. */ static void ! gimplify_for_stmt (tree *stmt_p, tree *pre_p) { tree stmt = *stmt_p; if (FOR_INIT_STMT (stmt)) gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); ! *stmt_p = gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), ! FOR_EXPR (stmt), 1); } /* Gimplify a WHILE_STMT node. */ static void ! gimplify_while_stmt (tree *stmt_p) { tree stmt = *stmt_p; ! *stmt_p = gimplify_cp_loop (WHILE_COND (stmt), WHILE_BODY (stmt), ! NULL_TREE, 1); } /* Gimplify a DO_STMT node. */ static void ! gimplify_do_stmt (tree *stmt_p) { tree stmt = *stmt_p; ! *stmt_p = gimplify_cp_loop (DO_COND (stmt), DO_BODY (stmt), ! NULL_TREE, 0); } /* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */ static void ! gimplify_switch_stmt (tree *stmt_p) { tree stmt = *stmt_p; ! tree break_block, body; location_t stmt_locus = input_location; break_block = begin_bc_block (bc_break); --- 283,334 ---- prequeue and hand off to gimplify_cp_loop. */ static void ! gimplify_for_stmt (tree *stmt_p, gimple_seq *pre_p) { tree stmt = *stmt_p; if (FOR_INIT_STMT (stmt)) gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); ! gimple_seq_add_seq (pre_p, ! gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), ! FOR_EXPR (stmt), 1)); ! *stmt_p = NULL_TREE; } /* Gimplify a WHILE_STMT node. */ static void ! gimplify_while_stmt (tree *stmt_p, gimple_seq *pre_p) { tree stmt = *stmt_p; ! gimple_seq_add_seq (pre_p, ! gimplify_cp_loop (WHILE_COND (stmt), WHILE_BODY (stmt), ! NULL_TREE, 1)); ! *stmt_p = NULL_TREE; } /* Gimplify a DO_STMT node. */ static void ! gimplify_do_stmt (tree *stmt_p, gimple_seq *pre_p) { tree stmt = *stmt_p; ! gimple_seq_add_seq (pre_p, ! gimplify_cp_loop (DO_COND (stmt), DO_BODY (stmt), ! NULL_TREE, 0)); ! *stmt_p = NULL_TREE; } /* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */ static void ! gimplify_switch_stmt (tree *stmt_p, gimple_seq *pre_p) { tree stmt = *stmt_p; ! tree break_block, body, t; location_t stmt_locus = input_location; + gimple_seq seq = NULL; break_block = begin_bc_block (bc_break); *************** gimplify_switch_stmt (tree *stmt_p) *** 307,318 **** if (!body) body = build_empty_stmt (); ! *stmt_p = build3 (SWITCH_EXPR, SWITCH_STMT_TYPE (stmt), ! SWITCH_STMT_COND (stmt), body, NULL_TREE); ! SET_EXPR_LOCATION (*stmt_p, stmt_locus); ! gimplify_stmt (stmt_p); ! *stmt_p = finish_bc_block (bc_break, break_block, *stmt_p); } /* Hook into the middle of gimplifying an OMP_FOR node. This is required --- 336,349 ---- if (!body) body = build_empty_stmt (); ! t = build3 (SWITCH_EXPR, SWITCH_STMT_TYPE (stmt), ! SWITCH_STMT_COND (stmt), body, NULL_TREE); ! SET_EXPR_LOCATION (t, stmt_locus); ! gimplify_and_add (t, &seq); ! seq = finish_bc_block (bc_break, break_block, seq); ! gimple_seq_add_seq (pre_p, seq); ! *stmt_p = NULL_TREE; } /* Hook into the middle of gimplifying an OMP_FOR node. This is required *************** gimplify_switch_stmt (tree *stmt_p) *** 321,330 **** regular gimplifier. */ static enum gimplify_status ! cp_gimplify_omp_for (tree *expr_p) { tree for_stmt = *expr_p; tree cont_block; /* Protect ourselves from recursion. */ if (OMP_FOR_GIMPLIFYING_P (for_stmt)) --- 352,363 ---- regular gimplifier. */ static enum gimplify_status ! cp_gimplify_omp_for (tree *expr_p, gimple_seq *pre_p) { tree for_stmt = *expr_p; tree cont_block; + gimple stmt; + gimple_seq seq = NULL; /* Protect ourselves from recursion. */ if (OMP_FOR_GIMPLIFYING_P (for_stmt)) *************** cp_gimplify_omp_for (tree *expr_p) *** 336,345 **** statement expressions within the INIT, COND, or INCR expressions. */ cont_block = begin_bc_block (bc_continue); ! gimplify_stmt (expr_p); - OMP_FOR_BODY (for_stmt) - = finish_bc_block (bc_continue, cont_block, OMP_FOR_BODY (for_stmt)); OMP_FOR_GIMPLIFYING_P (for_stmt) = 0; return GS_ALL_DONE; --- 369,383 ---- statement expressions within the INIT, COND, or INCR expressions. */ cont_block = begin_bc_block (bc_continue); ! gimplify_and_add (for_stmt, &seq); ! stmt = gimple_seq_last_stmt (seq); ! if (gimple_code (stmt) == GIMPLE_OMP_FOR) ! gimple_omp_set_body (stmt, finish_bc_block (bc_continue, cont_block, ! gimple_omp_body (stmt))); ! else ! seq = finish_bc_block (bc_continue, cont_block, seq); ! gimple_seq_add_seq (pre_p, seq); OMP_FOR_GIMPLIFYING_P (for_stmt) = 0; return GS_ALL_DONE; *************** gimplify_expr_stmt (tree *stmt_p) *** 383,389 **** /* Gimplify initialization from an AGGR_INIT_EXPR. */ static void ! cp_gimplify_init_expr (tree *expr_p, tree *pre_p, tree *post_p) { tree from = TREE_OPERAND (*expr_p, 1); tree to = TREE_OPERAND (*expr_p, 0); --- 421,427 ---- /* Gimplify initialization from an AGGR_INIT_EXPR. */ static void ! cp_gimplify_init_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) { tree from = TREE_OPERAND (*expr_p, 1); tree to = TREE_OPERAND (*expr_p, 0); *************** cp_gimplify_init_expr (tree *expr_p, tre *** 422,435 **** if (from != sub) TREE_TYPE (from) = void_type_node; } - else if (TREE_CODE (sub) == INIT_EXPR - && TREE_OPERAND (sub, 0) == slot) - { - /* An INIT_EXPR under TARGET_EXPR created by build_value_init, - will be followed by an AGGR_INIT_EXPR. */ - gimplify_expr (&to, pre_p, post_p, is_gimple_lvalue, fb_lvalue); - TREE_OPERAND (sub, 0) = to; - } if (t == sub) break; --- 460,465 ---- *************** cp_gimplify_init_expr (tree *expr_p, tre *** 441,475 **** /* Gimplify a MUST_NOT_THROW_EXPR. */ ! static void ! gimplify_must_not_throw_expr (tree *expr_p, tree *pre_p) { tree stmt = *expr_p; tree temp = voidify_wrapper_expr (stmt, NULL); tree body = TREE_OPERAND (stmt, 0); ! gimplify_stmt (&body); ! ! stmt = gimple_build_eh_filter (body, NULL_TREE, ! build_call_n (terminate_node, 0)); if (temp) { - append_to_statement_list (stmt, pre_p); *expr_p = temp; } ! else ! *expr_p = stmt; } /* Do C++-specific gimplification. Args are as for gimplify_expr. */ int ! cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p) { int saved_stmts_are_full_exprs_p = 0; enum tree_code code = TREE_CODE (*expr_p); enum gimplify_status ret; if (STATEMENT_CODE_P (code)) { --- 471,507 ---- /* Gimplify a MUST_NOT_THROW_EXPR. */ ! static enum gimplify_status ! gimplify_must_not_throw_expr (tree *expr_p, gimple_seq *pre_p) { tree stmt = *expr_p; tree temp = voidify_wrapper_expr (stmt, NULL); tree body = TREE_OPERAND (stmt, 0); ! stmt = build_gimple_eh_filter_tree (body, NULL_TREE, ! build_call_n (terminate_node, 0)); + gimplify_and_add (stmt, pre_p); if (temp) { *expr_p = temp; + return GS_OK; } ! ! *expr_p = NULL; ! return GS_ALL_DONE; } /* Do C++-specific gimplification. Args are as for gimplify_expr. */ int ! cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) { int saved_stmts_are_full_exprs_p = 0; enum tree_code code = TREE_CODE (*expr_p); enum gimplify_status ret; + tree block = NULL; + VEC(gimple, heap) *bind_expr_stack = NULL; if (STATEMENT_CODE_P (code)) { *************** cp_gimplify_expr (tree *expr_p, tree *pr *** 498,508 **** break; case MUST_NOT_THROW_EXPR: ! gimplify_must_not_throw_expr (expr_p, pre_p); ! ret = GS_OK; break; ! /* We used to do this for GIMPLE_MODIFY_STMT as well, but that's unsafe; the LHS of an assignment might also be involved in the RHS, as in bug 25979. */ case INIT_EXPR: --- 530,539 ---- break; case MUST_NOT_THROW_EXPR: ! ret = gimplify_must_not_throw_expr (expr_p, pre_p); break; ! /* We used to do this for MODIFY_EXPR as well, but that's unsafe; the LHS of an assignment might also be involved in the RHS, as in bug 25979. */ case INIT_EXPR: *************** cp_gimplify_expr (tree *expr_p, tree *pr *** 537,584 **** break; case USING_STMT: ! /* Just ignore for now. Eventually we will want to pass this on to ! the debugger. */ ! *expr_p = build_empty_stmt (); ! ret = GS_ALL_DONE; ! break; ! case IF_STMT: ! gimplify_if_stmt (expr_p); ! ret = GS_OK; break; case FOR_STMT: gimplify_for_stmt (expr_p, pre_p); ! ret = GS_ALL_DONE; break; case WHILE_STMT: ! gimplify_while_stmt (expr_p); ! ret = GS_ALL_DONE; break; case DO_STMT: ! gimplify_do_stmt (expr_p); ! ret = GS_ALL_DONE; break; case SWITCH_STMT: ! gimplify_switch_stmt (expr_p); ! ret = GS_ALL_DONE; break; case OMP_FOR: ! ret = cp_gimplify_omp_for (expr_p); break; case CONTINUE_STMT: ! *expr_p = build_bc_goto (bc_continue); ret = GS_ALL_DONE; break; case BREAK_STMT: ! *expr_p = build_bc_goto (bc_break); ret = GS_ALL_DONE; break; --- 568,639 ---- break; case USING_STMT: ! /* Get the innermost inclosing GIMPLE_BIND that has a non NULL ! BLOCK, and append an IMPORTED_DECL to its ! BLOCK_VARS chained list. */ ! bind_expr_stack = gimple_bind_expr_stack (); ! if (bind_expr_stack) ! { ! int i; ! for (i = VEC_length (gimple, bind_expr_stack) - 1; i >= 0; i--) ! if ((block = gimple_bind_block (VEC_index (gimple, ! bind_expr_stack, ! i)))) ! break; ! } ! if (block) ! { ! tree using_directive; ! gcc_assert (TREE_OPERAND (*expr_p, 0)); ! ! using_directive = make_node (IMPORTED_DECL); ! TREE_TYPE (using_directive) = void_type_node; ! ! IMPORTED_DECL_ASSOCIATED_DECL (using_directive) ! = TREE_OPERAND (*expr_p, 0); ! TREE_CHAIN (using_directive) = BLOCK_VARS (block); ! BLOCK_VARS (block) = using_directive; ! } ! /* The USING_STMT won't appear in GIMPLE. */ ! *expr_p = NULL; ! ret = GS_ALL_DONE; break; case FOR_STMT: gimplify_for_stmt (expr_p, pre_p); ! ret = GS_OK; break; case WHILE_STMT: ! gimplify_while_stmt (expr_p, pre_p); ! ret = GS_OK; break; case DO_STMT: ! gimplify_do_stmt (expr_p, pre_p); ! ret = GS_OK; break; case SWITCH_STMT: ! gimplify_switch_stmt (expr_p, pre_p); ! ret = GS_OK; break; case OMP_FOR: ! ret = cp_gimplify_omp_for (expr_p, pre_p); break; case CONTINUE_STMT: ! gimple_seq_add_stmt (pre_p, gimple_build_predict (PRED_CONTINUE, NOT_TAKEN)); ! gimple_seq_add_stmt (pre_p, gimple_build_goto (get_bc_label (bc_continue))); ! *expr_p = NULL_TREE; ret = GS_ALL_DONE; break; case BREAK_STMT: ! gimple_seq_add_stmt (pre_p, gimple_build_goto (get_bc_label (bc_break))); ! *expr_p = NULL_TREE; ret = GS_ALL_DONE; break; *************** cp_genericize_r (tree *stmt_p, int *walk *** 694,703 **** else if (TREE_CODE (stmt) == OMP_CLAUSE) switch (OMP_CLAUSE_CODE (stmt)) { case OMP_CLAUSE_PRIVATE: case OMP_CLAUSE_SHARED: case OMP_CLAUSE_FIRSTPRIVATE: - case OMP_CLAUSE_LASTPRIVATE: case OMP_CLAUSE_COPYIN: case OMP_CLAUSE_COPYPRIVATE: /* Don't dereference an invisiref in OpenMP clauses. */ --- 749,767 ---- else if (TREE_CODE (stmt) == OMP_CLAUSE) switch (OMP_CLAUSE_CODE (stmt)) { + case OMP_CLAUSE_LASTPRIVATE: + /* Don't dereference an invisiref in OpenMP clauses. */ + if (is_invisiref_parm (OMP_CLAUSE_DECL (stmt))) + { + *walk_subtrees = 0; + if (OMP_CLAUSE_LASTPRIVATE_STMT (stmt)) + cp_walk_tree (&OMP_CLAUSE_LASTPRIVATE_STMT (stmt), + cp_genericize_r, p_set, NULL); + } + break; case OMP_CLAUSE_PRIVATE: case OMP_CLAUSE_SHARED: case OMP_CLAUSE_FIRSTPRIVATE: case OMP_CLAUSE_COPYIN: case OMP_CLAUSE_COPYPRIVATE: /* Don't dereference an invisiref in OpenMP clauses. */ *************** cp_genericize_r (tree *stmt_p, int *walk *** 723,728 **** --- 787,831 ---- CLEANUP_BODY (stmt), CLEANUP_EXPR (stmt)); + else if (TREE_CODE (stmt) == IF_STMT) + { + genericize_if_stmt (stmt_p); + /* *stmt_p has changed, tail recurse to handle it again. */ + return cp_genericize_r (stmt_p, walk_subtrees, data); + } + + /* COND_EXPR might have incompatible types in branches if one or both + arms are bitfields. Fix it up now. */ + else if (TREE_CODE (stmt) == COND_EXPR) + { + tree type_left + = (TREE_OPERAND (stmt, 1) + ? is_bitfield_expr_with_lowered_type (TREE_OPERAND (stmt, 1)) + : NULL_TREE); + tree type_right + = (TREE_OPERAND (stmt, 2) + ? is_bitfield_expr_with_lowered_type (TREE_OPERAND (stmt, 2)) + : NULL_TREE); + if (type_left + && !useless_type_conversion_p (TREE_TYPE (stmt), + TREE_TYPE (TREE_OPERAND (stmt, 1)))) + { + TREE_OPERAND (stmt, 1) + = fold_convert (type_left, TREE_OPERAND (stmt, 1)); + gcc_assert (useless_type_conversion_p (TREE_TYPE (stmt), + type_left)); + } + if (type_right + && !useless_type_conversion_p (TREE_TYPE (stmt), + TREE_TYPE (TREE_OPERAND (stmt, 2)))) + { + TREE_OPERAND (stmt, 2) + = fold_convert (type_right, TREE_OPERAND (stmt, 2)); + gcc_assert (useless_type_conversion_p (TREE_TYPE (stmt), + type_right)); + } + } + pointer_set_insert (p_set, *stmt_p); return NULL; *************** cxx_omp_clause_apply_fn (tree fn, tree a *** 826,838 **** end1 = build2 (POINTER_PLUS_EXPR, TREE_TYPE (start1), start1, end1); p1 = create_tmp_var (TREE_TYPE (start1), NULL); ! t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p1, start1); append_to_statement_list (t, &ret); if (arg2) { p2 = create_tmp_var (TREE_TYPE (start2), NULL); ! t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p2, start2); append_to_statement_list (t, &ret); } --- 929,941 ---- end1 = build2 (POINTER_PLUS_EXPR, TREE_TYPE (start1), start1, end1); p1 = create_tmp_var (TREE_TYPE (start1), NULL); ! t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, start1); append_to_statement_list (t, &ret); if (arg2) { p2 = create_tmp_var (TREE_TYPE (start2), NULL); ! t = build2 (MODIFY_EXPR, TREE_TYPE (p2), p2, start2); append_to_statement_list (t, &ret); } *************** cxx_omp_clause_apply_fn (tree fn, tree a *** 855,868 **** t = TYPE_SIZE_UNIT (inner_type); t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p1), p1, t); ! t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p1, t); append_to_statement_list (t, &ret); if (arg2) { t = TYPE_SIZE_UNIT (inner_type); t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p2), p2, t); ! t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p2, t); append_to_statement_list (t, &ret); } --- 958,971 ---- t = TYPE_SIZE_UNIT (inner_type); t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p1), p1, t); ! t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, t); append_to_statement_list (t, &ret); if (arg2) { t = TYPE_SIZE_UNIT (inner_type); t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p2), p2, t); ! t = build2 (MODIFY_EXPR, TREE_TYPE (p2), p2, t); append_to_statement_list (t, &ret); } *************** cxx_omp_clause_apply_fn (tree fn, tree a *** 893,899 **** NULL if there's nothing to do. */ tree ! cxx_omp_clause_default_ctor (tree clause, tree decl) { tree info = CP_OMP_CLAUSE_INFO (clause); tree ret = NULL; --- 996,1003 ---- NULL if there's nothing to do. */ tree ! cxx_omp_clause_default_ctor (tree clause, tree decl, ! tree outer ATTRIBUTE_UNUSED) { tree info = CP_OMP_CLAUSE_INFO (clause); tree ret = NULL; *************** cxx_omp_clause_copy_ctor (tree clause, t *** 915,921 **** if (info) ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0), dst, src); if (ret == NULL) ! ret = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src); return ret; } --- 1019,1025 ---- if (info) ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0), dst, src); if (ret == NULL) ! ret = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src); return ret; } *************** cxx_omp_clause_assign_op (tree clause, t *** 931,937 **** if (info) ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 2), dst, src); if (ret == NULL) ! ret = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src); return ret; } --- 1035,1041 ---- if (info) ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 2), dst, src); if (ret == NULL) ! ret = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src); return ret; } *************** cxx_omp_privatize_by_reference (const_tr *** 958,960 **** --- 1062,1161 ---- { return is_invisiref_parm (decl); } + + /* True if OpenMP sharing attribute of DECL is predetermined. */ + + enum omp_clause_default_kind + cxx_omp_predetermined_sharing (tree decl) + { + tree type; + + /* Static data members are predetermined as shared. */ + if (TREE_STATIC (decl)) + { + tree ctx = CP_DECL_CONTEXT (decl); + if (TYPE_P (ctx) && MAYBE_CLASS_TYPE_P (ctx)) + return OMP_CLAUSE_DEFAULT_SHARED; + } + + type = TREE_TYPE (decl); + if (TREE_CODE (type) == REFERENCE_TYPE) + { + if (!is_invisiref_parm (decl)) + return OMP_CLAUSE_DEFAULT_UNSPECIFIED; + type = TREE_TYPE (type); + + if (TREE_CODE (decl) == RESULT_DECL && DECL_NAME (decl)) + { + /* NVR doesn't preserve const qualification of the + variable's type. */ + tree outer = outer_curly_brace_block (current_function_decl); + tree var; + + if (outer) + for (var = BLOCK_VARS (outer); var; var = TREE_CHAIN (var)) + if (DECL_NAME (decl) == DECL_NAME (var) + && (TYPE_MAIN_VARIANT (type) + == TYPE_MAIN_VARIANT (TREE_TYPE (var)))) + { + if (TYPE_READONLY (TREE_TYPE (var))) + type = TREE_TYPE (var); + break; + } + } + } + + if (type == error_mark_node) + return OMP_CLAUSE_DEFAULT_UNSPECIFIED; + + /* Variables with const-qualified type having no mutable member + are predetermined shared. */ + if (TYPE_READONLY (type) && !cp_has_mutable_p (type)) + return OMP_CLAUSE_DEFAULT_SHARED; + + return OMP_CLAUSE_DEFAULT_UNSPECIFIED; + } + + /* Finalize an implicitly determined clause. */ + + void + cxx_omp_finish_clause (tree c) + { + tree decl, inner_type; + bool make_shared = false; + + if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_FIRSTPRIVATE) + return; + + decl = OMP_CLAUSE_DECL (c); + decl = require_complete_type (decl); + inner_type = TREE_TYPE (decl); + if (decl == error_mark_node) + make_shared = true; + else if (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE) + { + if (is_invisiref_parm (decl)) + inner_type = TREE_TYPE (inner_type); + else + { + error ("%qE implicitly determined as % has reference type", + decl); + make_shared = true; + } + } + + /* We're interested in the base element, not arrays. */ + while (TREE_CODE (inner_type) == ARRAY_TYPE) + inner_type = TREE_TYPE (inner_type); + + /* Check for special function availability by building a call to one. + Save the results, because later we won't be in the right context + for making these queries. */ + if (!make_shared + && CLASS_TYPE_P (inner_type) + && cxx_omp_create_clause_info (c, inner_type, false, true, false)) + make_shared = true; + + if (make_shared) + OMP_CLAUSE_CODE (c) = OMP_CLAUSE_SHARED; + } diff -Nrcpad gcc-4.3.3/gcc/cp/cp-lang.c gcc-4.4.0/gcc/cp/cp-lang.c *** gcc-4.3.3/gcc/cp/cp-lang.c Fri Jan 25 12:06:31 2008 --- gcc-4.4.0/gcc/cp/cp-lang.c Fri Feb 20 15:20:38 2009 *************** *** 1,5 **** /* Language-dependent hooks for C++. ! Copyright 2001, 2002, 2004, 2007 Free Software Foundation, Inc. Contributed by Alexandre Oliva This file is part of GCC. --- 1,5 ---- /* Language-dependent hooks for C++. ! Copyright 2001, 2002, 2004, 2007, 2008 Free Software Foundation, Inc. Contributed by Alexandre Oliva This file is part of GCC. *************** static enum classify_record cp_classify_ *** 57,109 **** #define LANG_HOOKS_FOLD_OBJ_TYPE_REF cp_fold_obj_type_ref #undef LANG_HOOKS_INIT_TS #define LANG_HOOKS_INIT_TS cp_init_ts - #undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS - #define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true /* Each front end provides its own lang hook initializer. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; - /* Tree code classes. */ - - #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, - - const enum tree_code_class tree_code_type[] = { - #include "tree.def" - tcc_exceptional, - #include "c-common.def" - tcc_exceptional, - #include "cp-tree.def" - }; - #undef DEFTREECODE - - /* Table indexed by tree code giving number of expression - operands beyond the fixed part of the node structure. - Not used for types or decls. */ - - #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH, - - const unsigned char tree_code_length[] = { - #include "tree.def" - 0, - #include "c-common.def" - 0, - #include "cp-tree.def" - }; - #undef DEFTREECODE - - /* Names of tree components. - Used for printing out the tree and error messages. */ - #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME, - - const char *const tree_code_name[] = { - #include "tree.def" - "@@dummy", - #include "c-common.def" - "@@dummy", - #include "cp-tree.def" - }; - #undef DEFTREECODE - /* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c; there should be very few routines below. */ --- 57,66 ---- diff -Nrcpad gcc-4.3.3/gcc/cp/cp-objcp-common.c gcc-4.4.0/gcc/cp/cp-objcp-common.c *** gcc-4.3.3/gcc/cp/cp-objcp-common.c Sat Aug 25 15:10:40 2007 --- gcc-4.4.0/gcc/cp/cp-objcp-common.c Thu Mar 5 14:10:07 2009 *************** *** 1,5 **** /* Some code common to C++ and ObjC++ front ends. ! Copyright (C) 2004, 2007 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. --- 1,5 ---- /* Some code common to C++ and ObjC++ front ends. ! Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. *************** cp_expr_size (const_tree exp) *** 101,107 **** constructed, this is a valid transformation. */ || CP_AGGREGATE_TYPE_P (type)) /* This would be wrong for a type with virtual bases. */ ! return (is_empty_class (type) ? size_zero_node : CLASSTYPE_SIZE_UNIT (type)); else --- 101,107 ---- constructed, this is a valid transformation. */ || CP_AGGREGATE_TYPE_P (type)) /* This would be wrong for a type with virtual bases. */ ! return (is_really_empty_class (type) ? size_zero_node : CLASSTYPE_SIZE_UNIT (type)); else *************** cxx_initialize_diagnostics (diagnostic_c *** 185,203 **** int cxx_types_compatible_p (tree x, tree y) { ! if (same_type_ignoring_top_level_qualifiers_p (x, y)) ! return 1; ! ! /* Once we get to the middle-end, references and pointers are ! interchangeable. FIXME should we try to replace all references with ! pointers? */ ! if (POINTER_TYPE_P (x) && POINTER_TYPE_P (y) ! && TYPE_MODE (x) == TYPE_MODE (y) ! && TYPE_REF_CAN_ALIAS_ALL (x) == TYPE_REF_CAN_ALIAS_ALL (y) ! && same_type_p (TREE_TYPE (x), TREE_TYPE (y))) ! return 1; ! ! return 0; } tree --- 185,191 ---- int cxx_types_compatible_p (tree x, tree y) { ! return same_type_ignoring_top_level_qualifiers_p (x, y); } tree diff -Nrcpad gcc-4.3.3/gcc/cp/cp-objcp-common.h gcc-4.4.0/gcc/cp/cp-objcp-common.h *** gcc-4.3.3/gcc/cp/cp-objcp-common.h Thu Apr 24 16:31:59 2008 --- gcc-4.4.0/gcc/cp/cp-objcp-common.h Fri Feb 20 15:20:38 2009 *************** *** 1,5 **** /* Language hooks common to C++ and ObjC++ front ends. ! Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. --- 1,5 ---- /* Language hooks common to C++ and ObjC++ front ends. ! Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. *************** extern tree objcp_tsubst_copy_and_build *** 52,59 **** #define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set #undef LANG_HOOKS_EXPAND_EXPR #define LANG_HOOKS_EXPAND_EXPR c_expand_expr - #undef LANG_HOOKS_EXPAND_DECL - #define LANG_HOOKS_EXPAND_DECL c_expand_decl #undef LANG_HOOKS_PARSE_FILE #define LANG_HOOKS_PARSE_FILE c_common_parse_file #undef LANG_HOOKS_STATICP --- 52,57 ---- *************** extern tree objcp_tsubst_copy_and_build *** 86,100 **** #define LANG_HOOKS_COMDAT_GROUP cxx_comdat_group #undef LANG_HOOKS_BUILTIN_FUNCTION #define LANG_HOOKS_BUILTIN_FUNCTION cxx_builtin_function #undef LANG_HOOKS_TYPE_HASH_EQ #define LANG_HOOKS_TYPE_HASH_EQ cxx_type_hash_eq ! ! #undef LANG_HOOKS_FUNCTION_INIT ! #define LANG_HOOKS_FUNCTION_INIT cxx_push_function_context ! #undef LANG_HOOKS_FUNCTION_FINAL ! #define LANG_HOOKS_FUNCTION_FINAL cxx_pop_function_context ! #undef LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P ! #define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P cp_missing_noreturn_ok_p /* Attribute hooks. */ #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE --- 84,95 ---- #define LANG_HOOKS_COMDAT_GROUP cxx_comdat_group #undef LANG_HOOKS_BUILTIN_FUNCTION #define LANG_HOOKS_BUILTIN_FUNCTION cxx_builtin_function + #undef LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE + #define LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE cxx_builtin_function_ext_scope #undef LANG_HOOKS_TYPE_HASH_EQ #define LANG_HOOKS_TYPE_HASH_EQ cxx_type_hash_eq ! #undef LANG_HOOKS_MISSING_NORETURN_OK_P ! #define LANG_HOOKS_MISSING_NORETURN_OK_P cp_missing_noreturn_ok_p /* Attribute hooks. */ #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE *************** extern tree objcp_tsubst_copy_and_build *** 146,151 **** --- 141,148 ---- #define LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP cxx_omp_clause_assign_op #undef LANG_HOOKS_OMP_CLAUSE_DTOR #define LANG_HOOKS_OMP_CLAUSE_DTOR cxx_omp_clause_dtor + #undef LANG_HOOKS_OMP_FINISH_CLAUSE + #define LANG_HOOKS_OMP_FINISH_CLAUSE cxx_omp_finish_clause #undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE #define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE cxx_omp_privatize_by_reference diff -Nrcpad gcc-4.3.3/gcc/cp/cp-tree.h gcc-4.4.0/gcc/cp/cp-tree.h *** gcc-4.3.3/gcc/cp/cp-tree.h Thu Jan 15 22:34:20 2009 --- gcc-4.4.0/gcc/cp/cp-tree.h Tue Apr 7 04:38:10 2009 *************** *** 1,6 **** /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) --- 1,6 ---- /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) *************** along with GCC; see the file COPYING3. *** 31,38 **** #include "varray.h" #include "c-common.h" #include "name-lookup.h" ! struct diagnostic_context; ! struct diagnostic_info; /* Usage of TREE_LANG_FLAG_?: 0: IDENTIFIER_MARKED (IDENTIFIER_NODEs) --- 31,58 ---- #include "varray.h" #include "c-common.h" #include "name-lookup.h" ! ! /* In order for the format checking to accept the C++ front end ! diagnostic framework extensions, you must include this file before ! toplev.h, not after. We override the definition of GCC_DIAG_STYLE ! in c-common.h. */ ! #undef GCC_DIAG_STYLE ! #define GCC_DIAG_STYLE __gcc_cxxdiag__ ! #if GCC_VERSION >= 4001 ! #define ATTRIBUTE_GCC_CXXDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m) ! #else ! #define ATTRIBUTE_GCC_CXXDIAG(m, n) ATTRIBUTE_NONNULL(m) ! #endif ! extern void cp_cpp_error (cpp_reader *, int, ! const char *, va_list *) ! ATTRIBUTE_GCC_CXXDIAG(3,0); ! #ifdef GCC_TOPLEV_H ! #error \ ! In order for the format checking to accept the C++ front end diagnostic \ ! framework extensions, you must include this file before toplev.h, not after. ! #endif ! #include "toplev.h" ! #include "diagnostic.h" /* Usage of TREE_LANG_FLAG_?: 0: IDENTIFIER_MARKED (IDENTIFIER_NODEs) *************** struct diagnostic_info; *** 59,64 **** --- 79,85 ---- TEMPLATE_PARM_PARAMETER_PACK (in TEMPLATE_PARM_INDEX) TYPE_REF_IS_RVALUE (in REFERENCE_TYPE) ATTR_IS_DEPENDENT (in the TREE_LIST for an attribute) + CONSTRUCTOR_IS_DIRECT_INIT (in CONSTRUCTOR) 1: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE) TI_PENDING_TEMPLATE_FLAG. TEMPLATE_PARMS_FOR_INLINE. *************** struct diagnostic_info; *** 68,73 **** --- 89,95 ---- DECL_INITIALIZED_P (in VAR_DECL) TYPENAME_IS_CLASS_P (in TYPENAME_TYPE) STMT_IS_FULL_EXPR_P (in _STMT) + TARGET_EXPR_LIST_INIT_P (in TARGET_EXPR) 2: IDENTIFIER_OPNAME_P (in IDENTIFIER_NODE) ICS_THIS_FLAG (in _CONV) DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL) *************** struct diagnostic_info; *** 95,101 **** 2: Unused 3: TYPE_FOR_JAVA. 4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR ! 5: IS_AGGR_TYPE. 6: TYPE_DEPENDENT_P_VALID Usage of DECL_LANG_FLAG_?: --- 117,124 ---- 2: Unused 3: TYPE_FOR_JAVA. 4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR ! 5: CLASS_TYPE_P (in RECORD_TYPE and UNION_TYPE) ! SCOPED_ENUM_P (in ENUMERAL_TYPE) 6: TYPE_DEPENDENT_P_VALID Usage of DECL_LANG_FLAG_?: *************** struct diagnostic_info; *** 153,161 **** to which the vptr should be initialized. Use get_vtbl_decl_for_binfo to extract the VAR_DECL for the complete vtable. - DECL_ARGUMENTS - For a VAR_DECL this is DECL_ANON_UNION_ELEMS. - DECL_VINDEX This field is NULL for a non-virtual function. For a virtual function, it is eventually set to an INTEGER_CST indicating the --- 176,181 ---- *************** typedef struct ptrmem_cst * ptrmem_cst_t *** 281,287 **** /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual sense of `same'. */ #define same_type_p(TYPE1, TYPE2) \ ! cp_comptypes ((TYPE1), (TYPE2), COMPARE_STRICT) /* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring top-level qualifiers. */ --- 301,307 ---- /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual sense of `same'. */ #define same_type_p(TYPE1, TYPE2) \ ! comptypes ((TYPE1), (TYPE2), COMPARE_STRICT) /* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring top-level qualifiers. */ *************** typedef struct ptrmem_cst * ptrmem_cst_t *** 297,304 **** #define DECL_MAIN_P(NODE) \ (DECL_EXTERN_C_FUNCTION_P (NODE) \ && DECL_NAME (NODE) != NULL_TREE \ ! && MAIN_NAME_P (DECL_NAME (NODE))) \ ! && flag_hosted /* The overloaded FUNCTION_DECL. */ #define OVL_FUNCTION(NODE) \ --- 317,324 ---- #define DECL_MAIN_P(NODE) \ (DECL_EXTERN_C_FUNCTION_P (NODE) \ && DECL_NAME (NODE) != NULL_TREE \ ! && MAIN_NAME_P (DECL_NAME (NODE)) \ ! && flag_hosted) /* The overloaded FUNCTION_DECL. */ #define OVL_FUNCTION(NODE) \ *************** enum cp_tree_node_structure_enum { *** 533,539 **** /* The resulting tree type. */ union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"), ! chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.generic)"))) { union tree_node GTY ((tag ("TS_CP_GENERIC"), desc ("tree_node_structure (&%h)"))) generic; --- 553,559 ---- /* The resulting tree type. */ union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"), ! chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)"))) { union tree_node GTY ((tag ("TS_CP_GENERIC"), desc ("tree_node_structure (&%h)"))) generic; *************** enum cp_tree_index *** 572,577 **** --- 592,598 ---- CPTI_CLASS_TYPE, CPTI_UNKNOWN_TYPE, + CPTI_INIT_LIST_TYPE, CPTI_VTBL_TYPE, CPTI_VTBL_PTR_TYPE, CPTI_STD, *************** extern GTY(()) tree cp_global_trees[CPTI *** 637,642 **** --- 658,664 ---- #define class_type_node cp_global_trees[CPTI_CLASS_TYPE] #define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE] + #define init_list_type_node cp_global_trees[CPTI_INIT_LIST_TYPE] #define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE] #define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE] #define std_node cp_global_trees[CPTI_STD] *************** struct language_function GTY(()) *** 850,856 **** #define cp_function_chain (cfun->language) /* In a constructor destructor, the point at which all derived class ! destroying/construction has been has been done. Ie. just before a constructor returns, or before any base class destroying will be done in a destructor. */ --- 872,878 ---- #define cp_function_chain (cfun->language) /* In a constructor destructor, the point at which all derived class ! destroying/construction has been done. I.e., just before a constructor returns, or before any base class destroying will be done in a destructor. */ *************** struct language_function GTY(()) *** 926,940 **** ((NODE) == error_mark_node \ || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node)) - /* C++ language-specific tree codes. */ - #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, - enum cplus_tree_code { - CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE, - #include "cp-tree.def" - LAST_CPLUS_TREE_CODE - }; - #undef DEFTREECODE - /* TRUE if a tree code represents a statement. */ extern bool statement_code_p[MAX_TREE_CODES]; --- 948,953 ---- *************** enum languages { lang_c, lang_cplusplus, *** 958,991 **** /* Nonzero if T is a class (or struct or union) type. Also nonzero for template type parameters, typename types, and instantiated ! template template parameters. Despite its name, ! this macro has nothing to do with the definition of aggregate given ! in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. Keep ! these checks in ascending code order. */ ! #define IS_AGGR_TYPE(T) \ (TREE_CODE (T) == TEMPLATE_TYPE_PARM \ || TREE_CODE (T) == TYPENAME_TYPE \ || TREE_CODE (T) == TYPEOF_TYPE \ || TREE_CODE (T) == BOUND_TEMPLATE_TEMPLATE_PARM \ || TREE_CODE (T) == DECLTYPE_TYPE \ ! || TYPE_LANG_FLAG_5 (T)) ! /* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or union type. */ ! #define SET_IS_AGGR_TYPE(T, VAL) \ (TYPE_LANG_FLAG_5 (T) = (VAL)) /* Nonzero if T is a class type. Zero for template type parameters, typename types, and so forth. */ #define CLASS_TYPE_P(T) \ ! (IS_AGGR_TYPE_CODE (TREE_CODE (T)) && TYPE_LANG_FLAG_5 (T)) /* Nonzero if T is a class type but not an union. */ #define NON_UNION_CLASS_TYPE_P(T) \ (CLASS_TYPE_P (T) && TREE_CODE (T) != UNION_TYPE) /* Keep these checks in ascending code order. */ ! #define IS_AGGR_TYPE_CODE(T) \ ((T) == RECORD_TYPE || (T) == UNION_TYPE) #define TAGGED_TYPE_P(T) \ (CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE) --- 971,1002 ---- /* Nonzero if T is a class (or struct or union) type. Also nonzero for template type parameters, typename types, and instantiated ! template template parameters. Keep these checks in ascending code ! order. */ ! #define MAYBE_CLASS_TYPE_P(T) \ (TREE_CODE (T) == TEMPLATE_TYPE_PARM \ || TREE_CODE (T) == TYPENAME_TYPE \ || TREE_CODE (T) == TYPEOF_TYPE \ || TREE_CODE (T) == BOUND_TEMPLATE_TEMPLATE_PARM \ || TREE_CODE (T) == DECLTYPE_TYPE \ ! || CLASS_TYPE_P (T)) ! /* Set CLASS_TYPE_P for T to VAL. T must be a class, struct, or union type. */ ! #define SET_CLASS_TYPE_P(T, VAL) \ (TYPE_LANG_FLAG_5 (T) = (VAL)) /* Nonzero if T is a class type. Zero for template type parameters, typename types, and so forth. */ #define CLASS_TYPE_P(T) \ ! (RECORD_OR_UNION_CODE_P (TREE_CODE (T)) && TYPE_LANG_FLAG_5 (T)) /* Nonzero if T is a class type but not an union. */ #define NON_UNION_CLASS_TYPE_P(T) \ (CLASS_TYPE_P (T) && TREE_CODE (T) != UNION_TYPE) /* Keep these checks in ascending code order. */ ! #define RECORD_OR_UNION_CODE_P(T) \ ((T) == RECORD_TYPE || (T) == UNION_TYPE) #define TAGGED_TYPE_P(T) \ (CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE) *************** enum languages { lang_c, lang_cplusplus, *** 1034,1044 **** #define FUNCTION_FIRST_USER_PARM(NODE) \ skip_artificial_parms_for ((NODE), DECL_ARGUMENTS (NODE)) - #define PROMOTES_TO_AGGR_TYPE(NODE, CODE) \ - (((CODE) == TREE_CODE (NODE) \ - && IS_AGGR_TYPE (TREE_TYPE (NODE))) \ - || IS_AGGR_TYPE (NODE)) - /* Nonzero iff TYPE is derived from PARENT. Ignores accessibility and ambiguity issues. */ #define DERIVED_FROM_P(PARENT, TYPE) \ --- 1045,1050 ---- *************** struct lang_type_class GTY(()) *** 1142,1147 **** --- 1148,1154 ---- unsigned has_complex_assign_ref : 1; unsigned non_aggregate : 1; unsigned has_complex_dflt : 1; + unsigned has_list_ctor : 1; /* When adding a flag here, consider whether or not it ought to apply to a template instance if it applies to the template. If *************** struct lang_type_class GTY(()) *** 1150,1156 **** /* There are some bits left to fill out a 32-bit word. Keep track of this by updating the size of this bitfield whenever you add or remove a flag. */ ! unsigned dummy : 11; tree primary_base; VEC(tree_pair_s,gc) *vcall_indices; --- 1157,1163 ---- /* There are some bits left to fill out a 32-bit word. Keep track of this by updating the size of this bitfield whenever you add or remove a flag. */ ! unsigned dummy : 10; tree primary_base; VEC(tree_pair_s,gc) *vcall_indices; *************** struct lang_type GTY(()) *** 1264,1269 **** --- 1271,1280 ---- #define TYPE_HAS_CONST_INIT_REF(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->has_const_init_ref) + /* Nonzero if this class has an X(initializer_list) constructor. */ + #define TYPE_HAS_LIST_CTOR(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->has_list_ctor) + /* Nonzero if this class defines an overloaded operator new. (An operator new [] doesn't count.) */ #define TYPE_HAS_NEW_OPERATOR(NODE) \ *************** struct lang_decl_flags GTY(()) *** 1616,1623 **** unsigned this_thunk_p : 1; unsigned repo_available_p : 1; unsigned hidden_friend_p : 1; ! unsigned threadprivate_p : 1; ! /* One unused bit. */ union lang_decl_u { /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is --- 1627,1634 ---- unsigned this_thunk_p : 1; unsigned repo_available_p : 1; unsigned hidden_friend_p : 1; ! unsigned threadprivate_or_deleted_p : 1; ! unsigned defaulted_p : 1; union lang_decl_u { /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is *************** struct lang_decl GTY(()) *** 1867,1873 **** (IDENTIFIER_OPNAME_P (DECL_NAME (NODE)) \ ? DECL_LANG_SPECIFIC (NODE)->u.f.operator_code : ERROR_MARK) ! /* Nonzero if NODE is an assignment operator. */ #define DECL_ASSIGNMENT_OPERATOR_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.assignment_operator_p) --- 1878,1884 ---- (IDENTIFIER_OPNAME_P (DECL_NAME (NODE)) \ ? DECL_LANG_SPECIFIC (NODE)->u.f.operator_code : ERROR_MARK) ! /* Nonzero if NODE is an assignment operator (including += and such). */ #define DECL_ASSIGNMENT_OPERATOR_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.assignment_operator_p) *************** struct lang_decl GTY(()) *** 1925,1931 **** /* Nonzero if the DECL was initialized in the class definition itself, rather than outside the class. This is used for both static member ! VAR_DECLS, and FUNTION_DECLS that are defined in the class. */ #define DECL_INITIALIZED_IN_CLASS_P(DECL) \ (DECL_LANG_SPECIFIC (DECL)->decl_flags.initialized_in_class) --- 1936,1942 ---- /* Nonzero if the DECL was initialized in the class definition itself, rather than outside the class. This is used for both static member ! VAR_DECLS, and FUNCTION_DECLS that are defined in the class. */ #define DECL_INITIALIZED_IN_CLASS_P(DECL) \ (DECL_LANG_SPECIFIC (DECL)->decl_flags.initialized_in_class) *************** struct lang_decl GTY(()) *** 1968,1975 **** /* Nonzero for a DECL means that this member is a non-static member. */ #define DECL_NONSTATIC_MEMBER_P(NODE) \ ! ((TREE_CODE (NODE) == FUNCTION_DECL \ ! && DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)) \ || TREE_CODE (NODE) == FIELD_DECL) /* Nonzero for _DECL means that this member object type --- 1979,1985 ---- /* Nonzero for a DECL means that this member is a non-static member. */ #define DECL_NONSTATIC_MEMBER_P(NODE) \ ! (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) \ || TREE_CODE (NODE) == FIELD_DECL) /* Nonzero for _DECL means that this member object type *************** extern void decl_shadowed_for_var_insert *** 2260,2267 **** /* Nonzero if the template arguments is actually a vector of vectors, rather than just a vector. */ ! #define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \ ! (NODE && TREE_VEC_ELT (NODE, 0) \ && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC) /* The depth of a template argument vector. When called directly by --- 2270,2277 ---- /* Nonzero if the template arguments is actually a vector of vectors, rather than just a vector. */ ! #define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \ ! (NODE && TREE_VEC_LENGTH (NODE) && TREE_VEC_ELT (NODE, 0) \ && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC) /* The depth of a template argument vector. When called directly by *************** extern void decl_shadowed_for_var_insert *** 2482,2487 **** --- 2492,2502 ---- #define AGGR_INIT_VIA_CTOR_P(NODE) \ TREE_LANG_FLAG_0 (AGGR_INIT_EXPR_CHECK (NODE)) + /* Nonzero if expanding this AGGR_INIT_EXPR should first zero-initialize + the object. */ + #define AGGR_INIT_ZERO_FIRST(NODE) \ + TREE_LANG_FLAG_2 (AGGR_INIT_EXPR_CHECK (NODE)) + /* AGGR_INIT_EXPR accessors. These are equivalent to the CALL_EXPR accessors, except for AGGR_INIT_EXPR_SLOT (which takes the place of CALL_EXPR_STATIC_CHAIN). */ *************** more_aggr_init_expr_args_p (const aggr_i *** 2632,2638 **** /* Nonzero if DECL has been declared threadprivate by #pragma omp threadprivate. */ #define CP_DECL_THREADPRIVATE_P(DECL) \ ! (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (DECL))->decl_flags.threadprivate_p) /* Record whether a typedef for type `int' was actually `signed int'. */ #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP) --- 2647,2661 ---- /* Nonzero if DECL has been declared threadprivate by #pragma omp threadprivate. */ #define CP_DECL_THREADPRIVATE_P(DECL) \ ! (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (DECL))->decl_flags.threadprivate_or_deleted_p) ! ! /* Nonzero if DECL was declared with '= delete'. */ ! #define DECL_DELETED_FN(DECL) \ ! (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.threadprivate_or_deleted_p) ! ! /* Nonzero if DECL was declared with '= default'. */ ! #define DECL_DEFAULTED_FN(DECL) \ ! (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.defaulted_p) /* Record whether a typedef for type `int' was actually `signed int'. */ #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP) *************** more_aggr_init_expr_args_p (const aggr_i *** 2668,2673 **** --- 2691,2700 ---- #define INTEGRAL_OR_ENUMERATION_TYPE_P(TYPE) \ (TREE_CODE (TYPE) == ENUMERAL_TYPE || CP_INTEGRAL_TYPE_P (TYPE)) + /* Returns true if TYPE is an integral or unscoped enumeration type. */ + #define INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P(TYPE) \ + (UNSCOPED_ENUM_P (TYPE) || CP_INTEGRAL_TYPE_P (TYPE)) + /* [basic.fundamental] Integral and floating types are collectively called arithmetic *************** more_aggr_init_expr_args_p (const aggr_i *** 2694,2699 **** --- 2721,2779 ---- || TYPE_PTR_P (TYPE) \ || TYPE_PTRMEMFUNC_P (TYPE)) + /* Determines whether this type is a C++0x scoped enumeration + type. Scoped enumerations types are introduced via "enum class" or + "enum struct", e.g., + + enum class Color { + Red, Green, Blue + }; + + Scoped enumeration types are different from normal (unscoped) + enumeration types in several ways: + + - The enumerators of a scoped enumeration type are only available + within the scope of the enumeration type and not in the + enclosing scope. For example, the Red color can be referred to + with "Color::Red" but not "Red". + + - Scoped enumerators and enumerations do not implicitly convert + to integers or 'bool'. + + - The underlying type of the enum is well-defined. */ + #define SCOPED_ENUM_P(TYPE) \ + (TREE_CODE (TYPE) == ENUMERAL_TYPE && TYPE_LANG_FLAG_5 (TYPE)) + + /* Determine whether this is an unscoped enumeration type. */ + #define UNSCOPED_ENUM_P(TYPE) \ + (TREE_CODE (TYPE) == ENUMERAL_TYPE && !TYPE_LANG_FLAG_5 (TYPE)) + + /* Set the flag indicating whether an ENUMERAL_TYPE is a C++0x scoped + enumeration type (1) or a normal (unscoped) enumeration type + (0). */ + #define SET_SCOPED_ENUM_P(TYPE, VAL) \ + (TYPE_LANG_FLAG_5 (ENUMERAL_TYPE_CHECK (TYPE)) = (VAL)) + + /* Returns the underlying type of the given enumeration type. The + underlying type is determined in different ways, depending on the + properties of the enum: + + - In C++0x, the underlying type can be explicitly specified, e.g., + + enum E1 : char { ... } // underlying type is char + + - In a C++0x scoped enumeration, the underlying type is int + unless otherwises specified: + + enum class E2 { ... } // underlying type is int + + - Otherwise, the underlying type is determined based on the + values of the enumerators. In this case, the + ENUM_UNDERLYING_TYPE will not be set until after the definition + of the enumeration is completed by finish_enum. */ + #define ENUM_UNDERLYING_TYPE(TYPE) \ + TREE_TYPE (ENUMERAL_TYPE_CHECK (TYPE)) + /* [dcl.init.aggr] An aggregate is an array or a class with no user-declared *************** more_aggr_init_expr_args_p (const aggr_i *** 2729,2735 **** /* True if NODE is a brace-enclosed initializer. */ #define BRACE_ENCLOSED_INITIALIZER_P(NODE) \ ! (TREE_CODE (NODE) == CONSTRUCTOR && !TREE_TYPE (NODE)) /* True if NODE is a compound-literal, i.e., a brace-enclosed initializer cast to a particular type. */ --- 2809,2815 ---- /* True if NODE is a brace-enclosed initializer. */ #define BRACE_ENCLOSED_INITIALIZER_P(NODE) \ ! (TREE_CODE (NODE) == CONSTRUCTOR && TREE_TYPE (NODE) == init_list_type_node) /* True if NODE is a compound-literal, i.e., a brace-enclosed initializer cast to a particular type. */ *************** more_aggr_init_expr_args_p (const aggr_i *** 2741,2752 **** CONSTRUCTOR_ELTS (NODE)) \ && !TREE_HAS_CONSTRUCTOR (NODE)) /* Nonzero means that an object of this type can not be initialized using an initializer list. */ #define CLASSTYPE_NON_AGGREGATE(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->non_aggregate) #define TYPE_NON_AGGREGATE_CLASS(NODE) \ ! (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE)) /* Nonzero if there is a user-defined X::op=(x&) for this class. */ #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_assign_ref) --- 2821,2836 ---- CONSTRUCTOR_ELTS (NODE)) \ && !TREE_HAS_CONSTRUCTOR (NODE)) + /* True if NODE is a init-list used as a direct-initializer, i.e. + B b{1,2}, not B b({1,2}) or B b = {1,2}. */ + #define CONSTRUCTOR_IS_DIRECT_INIT(NODE) (TREE_LANG_FLAG_0 (CONSTRUCTOR_CHECK (NODE))) + /* Nonzero means that an object of this type can not be initialized using an initializer list. */ #define CLASSTYPE_NON_AGGREGATE(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->non_aggregate) #define TYPE_NON_AGGREGATE_CLASS(NODE) \ ! (CLASS_TYPE_P (NODE) && CLASSTYPE_NON_AGGREGATE (NODE)) /* Nonzero if there is a user-defined X::op=(x&) for this class. */ #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_assign_ref) *************** more_aggr_init_expr_args_p (const aggr_i *** 3203,3209 **** template struct S { friend void f(T) {}; }; the declaration of `void f(int)' generated when S is instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be ! a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION. */ #define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \ (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL)) --- 3287,3293 ---- template struct S { friend void f(T) {}; }; the declaration of `void f(int)' generated when S is instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be ! a DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION. */ #define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \ (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL)) *************** more_aggr_init_expr_args_p (const aggr_i *** 3385,3390 **** --- 3469,3479 ---- #define TARGET_EXPR_IMPLICIT_P(NODE) \ TREE_LANG_FLAG_0 (TARGET_EXPR_CHECK (NODE)) + /* True if this TARGET_EXPR is the result of list-initialization of a + temporary. */ + #define TARGET_EXPR_LIST_INIT_P(NODE) \ + TREE_LANG_FLAG_1 (TARGET_EXPR_CHECK (NODE)) + /* An enumeration of the kind of tags that C++ accepts. */ enum tag_types { none_type = 0, /* Not a tag type. */ *************** typedef enum linkage_kind { *** 3476,3495 **** /* Bitmask flags to control type substitution. */ typedef enum tsubst_flags_t { ! tf_none = 0, /* nothing special */ ! tf_error = 1 << 0, /* give error messages */ ! tf_warning = 1 << 1, /* give warnings too */ ! tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */ ! tf_keep_type_decl = 1 << 3, /* retain typedef type decls ! (make_typename_type use) */ ! tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal ! instantiate_type use) */ ! tf_user = 1 << 5, /* found template must be a user template ! (lookup_template_class use) */ ! tf_conv = 1 << 6, /* We are determining what kind of ! conversion might be permissible, ! not actually performing the ! conversion. */ /* Convenient substitution flags combinations. */ tf_warning_or_error = tf_warning | tf_error } tsubst_flags_t; --- 3565,3586 ---- /* Bitmask flags to control type substitution. */ typedef enum tsubst_flags_t { ! tf_none = 0, /* nothing special */ ! tf_error = 1 << 0, /* give error messages */ ! tf_warning = 1 << 1, /* give warnings too */ ! tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */ ! tf_keep_type_decl = 1 << 3, /* retain typedef type decls ! (make_typename_type use) */ ! tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal ! instantiate_type use) */ ! tf_user = 1 << 5, /* found template must be a user template ! (lookup_template_class use) */ ! tf_conv = 1 << 6, /* We are determining what kind of ! conversion might be permissible, ! not actually performing the ! conversion. */ ! tf_no_access_control = 1 << 7, /* Do not perform access checks, even ! when issuing other errors. */ /* Convenient substitution flags combinations. */ tf_warning_or_error = tf_warning | tf_error } tsubst_flags_t; *************** extern GTY(()) VEC(tree,gc) *local_class *** 3569,3588 **** at a particular location, we can index into the string at any other location that provides distinguishing characters). */ ! /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler ! doesn't allow '$' in symbol names. */ ! #ifndef NO_DOLLAR_IN_LABEL ! ! #define JOINER '$' ! ! #define AUTO_TEMP_NAME "_$tmp_" ! #define VFIELD_BASE "$vf" ! #define VFIELD_NAME "_vptr$" ! #define VFIELD_NAME_FORMAT "_vptr$%s" ! #define ANON_AGGRNAME_FORMAT "$_%d" ! ! #else /* NO_DOLLAR_IN_LABEL */ ! #ifndef NO_DOT_IN_LABEL #define JOINER '.' --- 3660,3667 ---- at a particular location, we can index into the string at any other location that provides distinguishing characters). */ ! /* Define NO_DOT_IN_LABEL in your favorite tm file if your assembler ! doesn't allow '.' in symbol names. */ #ifndef NO_DOT_IN_LABEL #define JOINER '.' *************** extern GTY(()) VEC(tree,gc) *local_class *** 3596,3601 **** --- 3675,3692 ---- #else /* NO_DOT_IN_LABEL */ + #ifndef NO_DOLLAR_IN_LABEL + + #define JOINER '$' + + #define AUTO_TEMP_NAME "_$tmp_" + #define VFIELD_BASE "$vf" + #define VFIELD_NAME "_vptr$" + #define VFIELD_NAME_FORMAT "_vptr$%s" + #define ANON_AGGRNAME_FORMAT "$_%d" + + #else /* NO_DOLLAR_IN_LABEL */ + #define IN_CHARGE_NAME "__in_chrg" #define AUTO_TEMP_NAME "__tmp_" #define TEMP_NAME_P(ID_NODE) \ *************** extern GTY(()) VEC(tree,gc) *local_class *** 3618,3625 **** sizeof (ANON_AGGRNAME_PREFIX) - 1)) #define ANON_AGGRNAME_FORMAT "__anon_%d" - #endif /* NO_DOT_IN_LABEL */ #endif /* NO_DOLLAR_IN_LABEL */ #define THIS_NAME "this" --- 3709,3716 ---- sizeof (ANON_AGGRNAME_PREFIX) - 1)) #define ANON_AGGRNAME_FORMAT "__anon_%d" #endif /* NO_DOLLAR_IN_LABEL */ + #endif /* NO_DOT_IN_LABEL */ #define THIS_NAME "this" *************** enum overload_flags { NO_SPECIAL = 0, DT *** 3704,3709 **** --- 3795,3805 ---- #define LOOKUP_HIDDEN (LOOKUP_PREFER_NAMESPACES << 1) /* Prefer that the lvalue be treated as an rvalue. */ #define LOOKUP_PREFER_RVALUE (LOOKUP_HIDDEN << 1) + /* We're inside an init-list, so narrowing conversions are ill-formed. */ + #define LOOKUP_NO_NARROWING (LOOKUP_PREFER_RVALUE << 1) + /* Avoid user-defined conversions for the first parameter of a copy + constructor. */ + #define LOOKUP_NO_COPY_CTOR_CONVERSION (LOOKUP_NO_NARROWING << 1) #define LOOKUP_NAMESPACES_ONLY(F) \ (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES)) *************** enum overload_flags { NO_SPECIAL = 0, DT *** 3744,3750 **** #define WANT_VECTOR 32 /* vector types */ #define WANT_ARITH (WANT_INT | WANT_FLOAT | WANT_VECTOR) ! /* Used with cp_comptypes, and related functions, to guide type comparison. */ #define COMPARE_STRICT 0 /* Just check if the types are the --- 3840,3846 ---- #define WANT_VECTOR 32 /* vector types */ #define WANT_ARITH (WANT_INT | WANT_FLOAT | WANT_VECTOR) ! /* Used with comptypes, and related functions, to guide type comparison. */ #define COMPARE_STRICT 0 /* Just check if the types are the *************** enum overload_flags { NO_SPECIAL = 0, DT *** 3776,3786 **** #define SF_INCLASS_INLINE 2 /* The function is an inline, defined in the class body. */ /* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2 is derived from TYPE1, or if TYPE2 is a pointer (reference) to a class derived from the type pointed to (referred to) by TYPE1. */ #define same_or_base_type_p(TYPE1, TYPE2) \ ! cp_comptypes ((TYPE1), (TYPE2), COMPARE_BASE) /* These macros are used to access a TEMPLATE_PARM_INDEX. */ #define TEMPLATE_PARM_INDEX_CAST(NODE) \ --- 3872,3888 ---- #define SF_INCLASS_INLINE 2 /* The function is an inline, defined in the class body. */ + /* Used with start_decl's initialized parameter. */ + #define SD_UNINITIALIZED 0 + #define SD_INITIALIZED 1 + #define SD_DEFAULTED 2 + #define SD_DELETED 3 + /* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2 is derived from TYPE1, or if TYPE2 is a pointer (reference) to a class derived from the type pointed to (referred to) by TYPE1. */ #define same_or_base_type_p(TYPE1, TYPE2) \ ! comptypes ((TYPE1), (TYPE2), COMPARE_BASE) /* These macros are used to access a TEMPLATE_PARM_INDEX. */ #define TEMPLATE_PARM_INDEX_CAST(NODE) \ *************** typedef struct operator_name_info_t GTY( *** 3872,3881 **** /* A mapping from tree codes to operator name information. */ extern GTY(()) operator_name_info_t operator_name_info ! [(int) LAST_CPLUS_TREE_CODE]; /* Similar, but for assignment operators. */ extern GTY(()) operator_name_info_t assignment_operator_name_info ! [(int) LAST_CPLUS_TREE_CODE]; /* A type-qualifier, or bitmask therefore, using the TYPE_QUAL constants. */ --- 3974,3983 ---- /* A mapping from tree codes to operator name information. */ extern GTY(()) operator_name_info_t operator_name_info ! [(int) MAX_TREE_CODES]; /* Similar, but for assignment operators. */ extern GTY(()) operator_name_info_t assignment_operator_name_info ! [(int) MAX_TREE_CODES]; /* A type-qualifier, or bitmask therefore, using the TYPE_QUAL constants. */ *************** typedef struct cp_decl_specifier_seq { *** 3926,3931 **** --- 4028,4036 ---- reflected here. This field will be a TYPE, unless a typedef-name was used, in which case it will be a TYPE_DECL. */ tree type; + /* The location of the primary type. Mainly used for error + reporting. */ + location_t type_location; /* The attributes, if any, provided with the specifier sequence. */ tree attributes; /* If non-NULL, a built-in type that the user attempted to redefine *************** struct cp_declarator { *** 3996,4002 **** /* For all but cdk_id and cdk_error, the contained declarator. For cdk_id and cdk_error, guaranteed to be NULL. */ cp_declarator *declarator; ! location_t id_loc; /* Currently only set for cdk_id. */ union { /* For identifiers. */ struct { --- 4101,4107 ---- /* For all but cdk_id and cdk_error, the contained declarator. For cdk_id and cdk_error, guaranteed to be NULL. */ cp_declarator *declarator; ! location_t id_loc; /* Currently only set for cdk_id and cdk_function. */ union { /* For identifiers. */ struct { *************** struct cp_declarator { *** 4012,4023 **** } id; /* For functions. */ struct { ! /* The parameters to the function. */ ! cp_parameter_declarator *parameters; /* The cv-qualifiers for the function. */ cp_cv_quals qualifiers; /* The exception-specification for the function. */ tree exception_specification; } function; /* For arrays. */ struct { --- 4117,4130 ---- } id; /* For functions. */ struct { ! /* The parameters to the function as a TREE_LIST of decl/default. */ ! tree parameters; /* The cv-qualifiers for the function. */ cp_cv_quals qualifiers; /* The exception-specification for the function. */ tree exception_specification; + /* The late-specified return type, if any. */ + tree late_return_type; } function; /* For arrays. */ struct { *************** struct tinst_level GTY(()) *** 4064,4074 **** e.g "int f(void)". */ extern cp_parameter_declarator *no_parameters; /* in call.c */ extern bool check_dtor_name (tree, tree); extern tree build_vfield_ref (tree, tree); ! extern tree build_conditional_expr (tree, tree, tree); extern tree build_addr_func (tree); extern tree build_call_a (tree, int, tree*); extern tree build_call_n (tree, int, ...); --- 4171,4185 ---- e.g "int f(void)". */ extern cp_parameter_declarator *no_parameters; + /* True if we saw "#pragma GCC java_exceptions". */ + extern bool pragma_java_exceptions; + /* in call.c */ extern bool check_dtor_name (tree, tree); extern tree build_vfield_ref (tree, tree); ! extern tree build_conditional_expr (tree, tree, tree, ! tsubst_flags_t); extern tree build_addr_func (tree); extern tree build_call_a (tree, int, tree*); extern tree build_call_n (tree, int, ...); *************** extern bool null_ptr_cst_p (tree); *** 4076,4088 **** extern bool sufficient_parms_p (const_tree); extern tree type_decays_to (tree); extern tree build_user_type_conversion (tree, tree, int); ! extern tree build_new_function_call (tree, tree, bool); extern tree build_operator_new_call (tree, tree, tree *, tree *, tree *); extern tree build_new_method_call (tree, tree, tree, tree, int, ! tree *); ! extern tree build_special_member_call (tree, tree, tree, tree, int); ! extern tree build_new_op (enum tree_code, int, tree, tree, tree, bool *); extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree, tree); extern bool can_convert (tree, tree); extern bool can_convert_arg (tree, tree, tree, int); --- 4187,4203 ---- extern bool sufficient_parms_p (const_tree); extern tree type_decays_to (tree); extern tree build_user_type_conversion (tree, tree, int); ! extern tree build_new_function_call (tree, tree, bool, ! tsubst_flags_t); extern tree build_operator_new_call (tree, tree, tree *, tree *, tree *); extern tree build_new_method_call (tree, tree, tree, tree, int, ! tree *, tsubst_flags_t); ! extern tree build_special_member_call (tree, tree, tree, tree, int, ! tsubst_flags_t); ! extern tree build_new_op (enum tree_code, int, tree, ! tree, tree, bool *, ! tsubst_flags_t); extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree, tree); extern bool can_convert (tree, tree); extern bool can_convert_arg (tree, tree, tree, int); *************** extern tree cxx_type_promotes_to (tree) *** 4095,4107 **** extern tree type_passed_as (tree); extern tree convert_for_arg_passing (tree, tree); extern bool is_properly_derived_from (tree, tree); extern tree initialize_reference (tree, tree, tree, tree *); extern tree make_temporary_var_for_ref_to_temp (tree, tree); extern tree strip_top_quals (tree); ! extern tree perform_implicit_conversion (tree, tree); ! extern tree perform_direct_initialization_if_possible (tree, tree, bool); extern tree in_charge_arg_for_name (tree); extern tree build_cxx_call (tree, int, tree *); #ifdef ENABLE_CHECKING extern void validate_conversion_obstack (void); #endif /* ENABLE_CHECKING */ --- 4210,4226 ---- extern tree type_passed_as (tree); extern tree convert_for_arg_passing (tree, tree); extern bool is_properly_derived_from (tree, tree); + extern tree set_up_extended_ref_temp (tree, tree, tree *, tree *); extern tree initialize_reference (tree, tree, tree, tree *); extern tree make_temporary_var_for_ref_to_temp (tree, tree); extern tree strip_top_quals (tree); ! extern tree perform_implicit_conversion (tree, tree, tsubst_flags_t); ! extern tree perform_direct_initialization_if_possible (tree, tree, bool, ! tsubst_flags_t); extern tree in_charge_arg_for_name (tree); extern tree build_cxx_call (tree, int, tree *); + extern bool is_std_init_list (tree); + extern bool is_list_ctor (tree); #ifdef ENABLE_CHECKING extern void validate_conversion_obstack (void); #endif /* ENABLE_CHECKING */ *************** extern void finish_struct_1 (tree); *** 4124,4129 **** --- 4243,4249 ---- extern int resolves_to_fixed_type_p (tree, int *); extern void init_class_processing (void); extern int is_empty_class (tree); + extern bool is_really_empty_class (tree); extern void pushclass (tree); extern void popclass (void); extern void push_nested_class (tree); *************** extern void check_for_override (tree, *** 4158,4163 **** --- 4278,4286 ---- extern void push_class_stack (void); extern void pop_class_stack (void); extern bool type_has_user_nondefault_constructor (tree); + extern bool type_has_user_provided_constructor (tree); + extern bool type_has_user_provided_default_constructor (tree); + extern bool defaultable_fn_p (tree); /* in cvt.c */ extern tree convert_to_reference (tree, tree, int, int, tree); *************** extern tree force_rvalue (tree); *** 4166,4172 **** extern tree ocp_convert (tree, tree, int, int); extern tree cp_convert (tree, tree); extern tree cp_convert_and_check (tree, tree); ! extern tree convert_to_void (tree, const char */*implicit context*/); extern tree convert_force (tree, tree, int); extern tree build_expr_type_conversion (int, tree, bool); extern tree type_promotes_to (tree); --- 4289,4296 ---- extern tree ocp_convert (tree, tree, int, int); extern tree cp_convert (tree, tree); extern tree cp_convert_and_check (tree, tree); ! extern tree convert_to_void (tree, const char */*implicit context*/, ! tsubst_flags_t); extern tree convert_force (tree, tree, int); extern tree build_expr_type_conversion (int, tree, bool); extern tree type_promotes_to (tree); *************** extern void cxx_init_decl_processing (v *** 4183,4190 **** enum cp_tree_node_structure_enum cp_tree_node_structure (union lang_tree_node *); extern bool cxx_mark_addressable (tree); - extern void cxx_push_function_context (struct function *); - extern void cxx_pop_function_context (struct function *); extern void maybe_push_cleanup_level (tree); extern void finish_scope (void); extern void push_switch (tree); --- 4307,4312 ---- *************** extern bool check_omp_return (void); *** 4202,4216 **** extern tree make_typename_type (tree, tree, enum tag_types, tsubst_flags_t); extern tree make_unbound_class_template (tree, tree, tree, tsubst_flags_t); extern tree check_for_out_of_scope_variable (tree); - extern tree build_library_fn (tree, tree); extern tree build_library_fn_ptr (const char *, tree); extern tree build_cp_library_fn_ptr (const char *, tree); ! extern tree push_library_fn (tree, tree); extern tree push_void_library_fn (tree, tree); extern tree push_throw_library_fn (tree, tree); extern tree check_tag_decl (cp_decl_specifier_seq *); extern tree shadow_tag (cp_decl_specifier_seq *); ! extern tree groktypename (cp_decl_specifier_seq *, const cp_declarator *); extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, tree, tree, tree *); extern void start_decl_1 (tree, bool); extern bool check_array_initializer (tree, tree, tree); --- 4324,4337 ---- extern tree make_typename_type (tree, tree, enum tag_types, tsubst_flags_t); extern tree make_unbound_class_template (tree, tree, tree, tsubst_flags_t); extern tree check_for_out_of_scope_variable (tree); extern tree build_library_fn_ptr (const char *, tree); extern tree build_cp_library_fn_ptr (const char *, tree); ! extern tree push_library_fn (tree, tree, tree); extern tree push_void_library_fn (tree, tree); extern tree push_throw_library_fn (tree, tree); extern tree check_tag_decl (cp_decl_specifier_seq *); extern tree shadow_tag (cp_decl_specifier_seq *); ! extern tree groktypename (cp_decl_specifier_seq *, const cp_declarator *, bool); extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, tree, tree, tree *); extern void start_decl_1 (tree, bool); extern bool check_array_initializer (tree, tree, tree); *************** extern bool grok_op_properties (tree, *** 4230,4246 **** extern tree xref_tag (enum tag_types, tree, tag_scope, bool); extern tree xref_tag_from_type (tree, tree, tag_scope); extern bool xref_basetypes (tree, tree); ! extern tree start_enum (tree); extern void finish_enum (tree); extern void build_enumerator (tree, tree, tree); extern void start_preparsed_function (tree, tree, int); extern int start_function (cp_decl_specifier_seq *, const cp_declarator *, tree); extern tree begin_function_body (void); extern void finish_function_body (tree); extern tree finish_function (int); extern tree start_method (cp_decl_specifier_seq *, const cp_declarator *, tree); extern tree finish_method (tree); extern void maybe_register_incomplete_var (tree); extern void complete_vars (tree); extern void finish_stmt (void); extern void print_other_binding_stack (struct cp_binding_level *); --- 4351,4370 ---- extern tree xref_tag (enum tag_types, tree, tag_scope, bool); extern tree xref_tag_from_type (tree, tree, tag_scope); extern bool xref_basetypes (tree, tree); ! extern tree start_enum (tree, tree, bool); extern void finish_enum (tree); extern void build_enumerator (tree, tree, tree); + extern tree lookup_enumerator (tree, tree); extern void start_preparsed_function (tree, tree, int); extern int start_function (cp_decl_specifier_seq *, const cp_declarator *, tree); extern tree begin_function_body (void); extern void finish_function_body (tree); + extern tree outer_curly_brace_block (tree); extern tree finish_function (int); extern tree start_method (cp_decl_specifier_seq *, const cp_declarator *, tree); extern tree finish_method (tree); extern void maybe_register_incomplete_var (tree); + extern void maybe_commonize_var (tree); extern void complete_vars (tree); extern void finish_stmt (void); extern void print_other_binding_stack (struct cp_binding_level *); *************** extern tree register_dtor_fn (tree); *** 4262,4267 **** --- 4386,4392 ---- extern tmpl_spec_kind current_tmpl_spec_kind (int); extern tree cp_fname_init (const char *, tree *); extern tree cxx_builtin_function (tree decl); + extern tree cxx_builtin_function_ext_scope (tree decl); extern tree check_elaborated_type_specifier (enum tag_types, tree, bool); extern void warn_extern_redeclared_static (tree, tree); extern const char *cxx_comdat_group (tree); *************** extern void initialize_artificial_var ( *** 4270,4275 **** --- 4395,4403 ---- extern tree check_var_type (tree, tree); extern tree reshape_init (tree, tree); + extern bool defer_mark_used_calls; + extern GTY(()) VEC(tree, gc) *deferred_mark_used_calls; + /* in decl2.c */ extern bool check_java_method (tree); extern tree build_memfn_type (tree, tree, cp_cv_quals); *************** extern void mark_needed (tree); *** 4310,4315 **** --- 4438,4445 ---- extern bool decl_needed_p (tree); extern void note_vague_linkage_fn (tree); extern tree build_artificial_parm (tree, tree); + extern bool possibly_inlined_p (tree); + extern int parm_index (tree); /* in error.c */ extern void init_error (void); *************** extern const char *language_to_string ( *** 4321,4326 **** --- 4451,4457 ---- extern const char *class_key_or_enum_as_string (tree); extern void print_instantiation_context (void); extern void maybe_warn_variadic_templates (void); + extern void maybe_warn_cpp0x (const char *); /* in except.c */ extern void init_exception_processing (void); *************** extern tree do_friend (tree, tree, tr *** 4345,4359 **** /* in init.c */ extern tree expand_member_init (tree); extern void emit_mem_initializers (tree); ! extern tree build_aggr_init (tree, tree, int); ! extern int is_aggr_type (tree, int); extern tree get_type_value (tree); extern tree build_zero_init (tree, tree, bool); extern tree build_value_init (tree); extern tree build_offset_ref (tree, tree, bool); ! extern tree build_new (tree, tree, tree, tree, int); ! extern tree build_vec_init (tree, tree, tree, bool, int); ! extern tree build_default_init (tree, tree); extern tree build_delete (tree, tree, special_function_kind, int, int); --- 4476,4493 ---- /* in init.c */ extern tree expand_member_init (tree); extern void emit_mem_initializers (tree); ! extern tree build_aggr_init (tree, tree, int, ! tsubst_flags_t); ! extern int is_class_type (tree, int); extern tree get_type_value (tree); extern tree build_zero_init (tree, tree, bool); extern tree build_value_init (tree); + extern tree build_value_init_noctor (tree); extern tree build_offset_ref (tree, tree, bool); ! extern tree build_new (tree, tree, tree, tree, int, ! tsubst_flags_t); ! extern tree build_vec_init (tree, tree, tree, bool, int, ! tsubst_flags_t); extern tree build_delete (tree, tree, special_function_kind, int, int); *************** extern void retrofit_lang_decl (tree); *** 4376,4382 **** extern tree copy_decl (tree); extern tree copy_type (tree); extern tree cxx_make_type (enum tree_code); ! extern tree make_aggr_type (enum tree_code); extern void yyerror (const char *); extern void yyhook (int); extern bool cxx_init (void); --- 4510,4516 ---- extern tree copy_decl (tree); extern tree copy_type (tree); extern tree cxx_make_type (enum tree_code); ! extern tree make_class_type (enum tree_code); extern void yyerror (const char *); extern void yyhook (int); extern bool cxx_init (void); *************** extern tree locate_dtor (tree, void * *** 4402,4408 **** extern bool maybe_clone_body (tree); /* in pt.c */ ! extern void check_template_shadow (tree); extern tree get_innermost_template_args (tree, int); extern void maybe_begin_member_template_processing (tree); extern void maybe_end_member_template_processing (void); --- 4536,4542 ---- extern bool maybe_clone_body (tree); /* in pt.c */ ! extern bool check_template_shadow (tree); extern tree get_innermost_template_args (tree, int); extern void maybe_begin_member_template_processing (tree); extern void maybe_end_member_template_processing (void); *************** extern void end_specialization (void); *** 4414,4419 **** --- 4548,4558 ---- extern void begin_explicit_instantiation (void); extern void end_explicit_instantiation (void); extern tree check_explicit_specialization (tree, tree, int, int); + extern tree make_auto (void); + extern tree do_auto_deduction (tree, tree, tree); + extern tree type_uses_auto (tree); + extern tree splice_late_return_type (tree, tree); + extern bool is_auto (const_tree); extern tree process_template_parm (tree, tree, bool, bool); extern tree end_template_parm_list (tree); extern void end_template_decl (void); *************** extern struct tinst_level *current_insta *** 4460,4472 **** --- 4599,4614 ---- extern tree maybe_get_template_decl_from_type_decl (tree); extern int processing_template_parmlist; extern bool dependent_type_p (tree); + extern bool dependent_scope_p (tree); extern bool any_dependent_template_arguments_p (const_tree); extern bool dependent_template_p (tree); extern bool dependent_template_id_p (tree, tree); extern bool type_dependent_expression_p (tree); extern bool any_type_dependent_arguments_p (const_tree); + extern bool type_dependent_expression_p_push (tree); extern bool value_dependent_expression_p (tree); extern bool any_value_dependent_elements_p (const_tree); + extern bool dependent_omp_for_p (tree, tree, tree, tree); extern tree resolve_typename_type (tree, bool); extern tree template_for_substitution (tree); extern tree build_non_dependent_expr (tree); *************** extern tree build_typeid (tree); *** 4492,4498 **** extern tree get_tinfo_decl (tree); extern tree get_typeid (tree); extern tree build_headof (tree); ! extern tree build_dynamic_cast (tree, tree); extern void emit_support_tinfos (void); extern bool emit_tinfo_decl (tree); --- 4634,4640 ---- extern tree get_tinfo_decl (tree); extern tree get_typeid (tree); extern tree build_headof (tree); ! extern tree build_dynamic_cast (tree, tree, tsubst_flags_t); extern void emit_support_tinfos (void); extern bool emit_tinfo_decl (tree); *************** extern tree finish_stmt_expr_expr (tree *** 4623,4634 **** extern tree finish_stmt_expr (tree, bool); extern tree stmt_expr_value_expr (tree); extern tree perform_koenig_lookup (tree, tree); ! extern tree finish_call_expr (tree, tree, bool, bool); extern tree finish_increment_expr (tree, enum tree_code); extern tree finish_this_expr (void); extern tree finish_pseudo_destructor_expr (tree, tree, tree); extern tree finish_unary_op_expr (enum tree_code, tree); ! extern tree finish_compound_literal (tree, VEC(constructor_elt,gc) *); extern tree finish_fname (tree); extern void finish_translation_unit (void); extern tree finish_template_type_parm (tree, tree); --- 4765,4777 ---- extern tree finish_stmt_expr (tree, bool); extern tree stmt_expr_value_expr (tree); extern tree perform_koenig_lookup (tree, tree); ! extern tree finish_call_expr (tree, tree, bool, bool, ! tsubst_flags_t); extern tree finish_increment_expr (tree, enum tree_code); extern tree finish_this_expr (void); extern tree finish_pseudo_destructor_expr (tree, tree, tree); extern tree finish_unary_op_expr (enum tree_code, tree); ! extern tree finish_compound_literal (tree, tree); extern tree finish_fname (tree); extern void finish_translation_unit (void); extern tree finish_template_type_parm (tree, tree); *************** extern void finish_template_decl (tree) *** 4638,4650 **** extern tree finish_template_type (tree, tree, int); extern tree finish_base_specifier (tree, tree, bool); extern void finish_member_declaration (tree); ! extern void qualified_name_lookup_error (tree, tree, tree); extern void check_template_keyword (tree); extern tree finish_id_expression (tree, tree, tree, cp_id_kind *, bool, bool, bool *, bool, bool, bool, bool, ! const char **); extern tree finish_typeof (tree); extern tree finish_offsetof (tree); extern void finish_decl_cleanup (tree, tree); --- 4781,4795 ---- extern tree finish_template_type (tree, tree, int); extern tree finish_base_specifier (tree, tree, bool); extern void finish_member_declaration (tree); ! extern void qualified_name_lookup_error (tree, tree, tree, ! location_t); extern void check_template_keyword (tree); extern tree finish_id_expression (tree, tree, tree, cp_id_kind *, bool, bool, bool *, bool, bool, bool, bool, ! const char **, ! location_t); extern tree finish_typeof (tree); extern tree finish_offsetof (tree); extern void finish_decl_cleanup (tree, tree); *************** extern tree begin_omp_structured_block *** 4665,4684 **** extern tree finish_omp_structured_block (tree); extern tree begin_omp_parallel (void); extern tree finish_omp_parallel (tree, tree); extern tree finish_omp_for (location_t, tree, tree, ! tree, tree, tree, tree); extern void finish_omp_atomic (enum tree_code, tree, tree); extern void finish_omp_barrier (void); extern void finish_omp_flush (void); extern enum omp_clause_default_kind cxx_omp_predetermined_sharing (tree); ! extern tree cxx_omp_clause_default_ctor (tree, tree); extern tree cxx_omp_clause_copy_ctor (tree, tree, tree); extern tree cxx_omp_clause_assign_op (tree, tree, tree); extern tree cxx_omp_clause_dtor (tree, tree); extern bool cxx_omp_privatize_by_reference (const_tree); extern tree baselink_for_fns (tree); extern void finish_static_assert (tree, tree, location_t, bool); extern tree finish_decltype_type (tree, bool); extern tree finish_trait_expr (enum cp_trait_kind, tree, tree); --- 4810,4835 ---- extern tree finish_omp_structured_block (tree); extern tree begin_omp_parallel (void); extern tree finish_omp_parallel (tree, tree); + extern tree begin_omp_task (void); + extern tree finish_omp_task (tree, tree); extern tree finish_omp_for (location_t, tree, tree, ! tree, tree, tree, tree, tree); extern void finish_omp_atomic (enum tree_code, tree, tree); extern void finish_omp_barrier (void); extern void finish_omp_flush (void); + extern void finish_omp_taskwait (void); extern enum omp_clause_default_kind cxx_omp_predetermined_sharing (tree); ! extern tree cxx_omp_clause_default_ctor (tree, tree, tree); extern tree cxx_omp_clause_copy_ctor (tree, tree, tree); extern tree cxx_omp_clause_assign_op (tree, tree, tree); extern tree cxx_omp_clause_dtor (tree, tree); + extern void cxx_omp_finish_clause (tree); extern bool cxx_omp_privatize_by_reference (const_tree); + extern bool cxx_omp_create_clause_info (tree, tree, bool, bool, bool); extern tree baselink_for_fns (tree); extern void finish_static_assert (tree, tree, location_t, bool); + extern tree describable_type (tree); extern tree finish_decltype_type (tree, bool); extern tree finish_trait_expr (enum cp_trait_kind, tree, tree); *************** extern tree build_min_nt (enum tree_co *** 4706,4713 **** --- 4857,4866 ---- extern tree build_min_non_dep (enum tree_code, tree, ...); extern tree build_min_non_dep_call_list (tree, tree, tree); extern tree build_cplus_new (tree, tree); + extern tree build_aggr_init_expr (tree, tree); extern tree get_target_expr (tree); extern tree build_cplus_array_type (tree, tree); + extern tree build_array_of_n_type (tree, int); extern tree hash_tree_cons (tree, tree, tree); extern tree hash_tree_chain (tree, tree); extern tree build_qualified_name (tree, tree, tree, bool); *************** extern tree complete_type (tree); *** 4768,4807 **** extern tree complete_type_or_else (tree, tree); extern int type_unknown_p (const_tree); extern bool comp_except_specs (const_tree, const_tree, bool); ! extern bool cp_comptypes (tree, tree, int); extern bool compparms (const_tree, const_tree); extern int comp_cv_qualification (const_tree, const_tree); extern int comp_cv_qual_signature (tree, tree); ! extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code); extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); ! #define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false) ! extern tree inline_conversion (tree); extern tree is_bitfield_expr_with_lowered_type (const_tree); extern tree unlowered_expr_type (const_tree); extern tree decay_conversion (tree); ! extern tree build_class_member_access_expr (tree, tree, tree, bool); ! extern tree finish_class_member_access_expr (tree, tree, bool); ! extern tree build_x_indirect_ref (tree, const char *); ! extern tree build_indirect_ref (tree, const char *); ! extern tree build_array_ref (tree, tree); extern tree get_member_function_from_ptrfunc (tree *, tree); extern tree build_x_binary_op (enum tree_code, tree, enum tree_code, tree, ! enum tree_code, bool *); ! extern tree build_x_unary_op (enum tree_code, tree); extern tree unary_complex_lvalue (enum tree_code, tree); ! extern tree build_x_conditional_expr (tree, tree, tree); extern tree build_x_compound_expr_from_list (tree, const char *); ! extern tree build_x_compound_expr (tree, tree); ! extern tree build_compound_expr (tree, tree); ! extern tree build_static_cast (tree, tree); ! extern tree build_reinterpret_cast (tree, tree); ! extern tree build_const_cast (tree, tree); extern tree build_c_cast (tree, tree); ! extern tree build_x_modify_expr (tree, enum tree_code, tree); ! extern tree build_modify_expr (tree, enum tree_code, tree); extern tree convert_for_initialization (tree, tree, tree, int, ! const char *, tree, int); extern int comp_ptr_ttypes (tree, tree); extern bool comp_ptr_ttypes_const (tree, tree); extern int ptr_reasonably_similar (const_tree, const_tree); --- 4921,4975 ---- extern tree complete_type_or_else (tree, tree); extern int type_unknown_p (const_tree); extern bool comp_except_specs (const_tree, const_tree, bool); ! extern bool comptypes (tree, tree, int); extern bool compparms (const_tree, const_tree); extern int comp_cv_qualification (const_tree, const_tree); extern int comp_cv_qual_signature (tree, tree); ! extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code, bool); extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); ! extern tree cxx_sizeof_nowarn (tree); extern tree is_bitfield_expr_with_lowered_type (const_tree); extern tree unlowered_expr_type (const_tree); extern tree decay_conversion (tree); ! extern tree build_class_member_access_expr (tree, tree, tree, bool, ! tsubst_flags_t); ! extern tree finish_class_member_access_expr (tree, tree, bool, ! tsubst_flags_t); ! extern tree build_x_indirect_ref (tree, const char *, ! tsubst_flags_t); ! extern tree cp_build_indirect_ref (tree, const char *, ! tsubst_flags_t); ! extern tree build_array_ref (tree, tree, location_t); extern tree get_member_function_from_ptrfunc (tree *, tree); + extern tree cp_build_function_call (tree, tree, tsubst_flags_t); extern tree build_x_binary_op (enum tree_code, tree, enum tree_code, tree, ! enum tree_code, bool *, ! tsubst_flags_t); ! extern tree build_x_array_ref (tree, tree, tsubst_flags_t); ! extern tree build_x_unary_op (enum tree_code, tree, ! tsubst_flags_t); ! extern tree cp_build_unary_op (enum tree_code, tree, int, ! tsubst_flags_t); extern tree unary_complex_lvalue (enum tree_code, tree); ! extern tree build_x_conditional_expr (tree, tree, tree, ! tsubst_flags_t); extern tree build_x_compound_expr_from_list (tree, const char *); ! extern tree build_x_compound_expr (tree, tree, tsubst_flags_t); ! extern tree build_compound_expr (tree, tree); ! extern tree cp_build_compound_expr (tree, tree, tsubst_flags_t); ! extern tree build_static_cast (tree, tree, tsubst_flags_t); ! extern tree build_reinterpret_cast (tree, tree, tsubst_flags_t); ! extern tree build_const_cast (tree, tree, tsubst_flags_t); extern tree build_c_cast (tree, tree); ! extern tree cp_build_c_cast (tree, tree, tsubst_flags_t); ! extern tree build_x_modify_expr (tree, enum tree_code, tree, ! tsubst_flags_t); ! extern tree cp_build_modify_expr (tree, enum tree_code, tree, ! tsubst_flags_t); extern tree convert_for_initialization (tree, tree, tree, int, ! const char *, tree, int, ! tsubst_flags_t); extern int comp_ptr_ttypes (tree, tree); extern bool comp_ptr_ttypes_const (tree, tree); extern int ptr_reasonably_similar (const_tree, const_tree); *************** extern void cp_apply_type_quals_to_decl *** 4814,4844 **** extern tree build_ptrmemfunc1 (tree, tree, tree); extern void expand_ptrmemfunc_cst (tree, tree *, tree *); extern tree type_after_usual_arithmetic_conversions (tree, tree); extern tree composite_pointer_type (tree, tree, tree, tree, ! const char*); extern tree merge_types (tree, tree); extern tree check_return_expr (tree, bool *); ! #define cp_build_binary_op(code, arg1, arg2) \ ! build_binary_op(code, arg1, arg2, 1) #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true) extern tree build_ptrmemfunc_access_expr (tree, tree); extern tree build_address (tree); extern tree build_nop (tree, tree); extern tree non_reference (tree); extern tree lookup_anon_field (tree, tree); ! extern bool invalid_nonstatic_memfn_p (const_tree); extern tree convert_member_func_to_ptr (tree, tree); extern tree convert_ptrmem (tree, tree, bool, bool); ! extern int lvalue_or_else (tree, enum lvalue_use); extern int lvalue_p (tree); /* in typeck2.c */ extern void require_complete_eh_spec_types (tree, tree); ! extern void cxx_incomplete_type_diagnostic (const_tree, const_tree, int); #undef cxx_incomplete_type_error extern void cxx_incomplete_type_error (const_tree, const_tree); #define cxx_incomplete_type_error(V,T) \ ! (cxx_incomplete_type_diagnostic ((V), (T), 0)) extern tree error_not_base_type (tree, tree); extern tree binfo_or_else (tree, tree); extern void readonly_error (tree, const char *); --- 4982,5015 ---- extern tree build_ptrmemfunc1 (tree, tree, tree); extern void expand_ptrmemfunc_cst (tree, tree *, tree *); extern tree type_after_usual_arithmetic_conversions (tree, tree); + extern tree common_pointer_type (tree, tree); extern tree composite_pointer_type (tree, tree, tree, tree, ! const char*, tsubst_flags_t); extern tree merge_types (tree, tree); extern tree check_return_expr (tree, bool *); ! extern tree cp_build_binary_op (location_t, ! enum tree_code, tree, tree, ! tsubst_flags_t); #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true) extern tree build_ptrmemfunc_access_expr (tree, tree); extern tree build_address (tree); extern tree build_nop (tree, tree); extern tree non_reference (tree); extern tree lookup_anon_field (tree, tree); ! extern bool invalid_nonstatic_memfn_p (const_tree, tsubst_flags_t); extern tree convert_member_func_to_ptr (tree, tree); extern tree convert_ptrmem (tree, tree, bool, bool); ! extern int lvalue_or_else (tree, enum lvalue_use, ! tsubst_flags_t); extern int lvalue_p (tree); /* in typeck2.c */ extern void require_complete_eh_spec_types (tree, tree); ! extern void cxx_incomplete_type_diagnostic (const_tree, const_tree, diagnostic_t); #undef cxx_incomplete_type_error extern void cxx_incomplete_type_error (const_tree, const_tree); #define cxx_incomplete_type_error(V,T) \ ! (cxx_incomplete_type_diagnostic ((V), (T), DK_ERROR)) extern tree error_not_base_type (tree, tree); extern tree binfo_or_else (tree, tree); extern void readonly_error (tree, const char *); *************** extern void complete_type_check_abstract *** 4846,4856 **** extern int abstract_virtuals_error (tree, tree); extern tree store_init_value (tree, tree); extern tree digest_init (tree, tree); extern tree build_scoped_ref (tree, tree, tree *); extern tree build_x_arrow (tree); extern tree build_m_component_ref (tree, tree); ! extern tree build_functional_cast (tree, tree); extern tree add_exception_specifier (tree, tree, int); extern tree merge_exception_specifiers (tree, tree); --- 5017,5028 ---- extern int abstract_virtuals_error (tree, tree); extern tree store_init_value (tree, tree); + extern void check_narrowing (tree, tree); extern tree digest_init (tree, tree); extern tree build_scoped_ref (tree, tree, tree *); extern tree build_x_arrow (tree); extern tree build_m_component_ref (tree, tree); ! extern tree build_functional_cast (tree, tree, tsubst_flags_t); extern tree add_exception_specifier (tree, tree, int); extern tree merge_exception_specifiers (tree, tree); *************** extern tree mangle_thunk (tree, int, t *** 4867,4872 **** --- 5039,5045 ---- extern tree mangle_conv_op_name_for_type (tree); extern tree mangle_guard_variable (tree); extern tree mangle_ref_init_variable (tree); + extern tree mangle_compound_literal (void); /* in dump.c */ extern bool cp_dump_tree (void *, tree); *************** extern void init_shadowed_var_for_decl *** 4884,4907 **** extern tree cxx_staticp (tree); /* in cp-gimplify.c */ ! extern int cp_gimplify_expr (tree *, tree *, tree *); extern void cp_genericize (tree); /* -- end of C++ */ - /* In order for the format checking to accept the C++ front end - diagnostic framework extensions, you must include this file before - toplev.h, not after. We override the definition of GCC_DIAG_STYLE - in c-common.h. */ - #undef GCC_DIAG_STYLE - #define GCC_DIAG_STYLE __gcc_cxxdiag__ - #if GCC_VERSION >= 4001 - #define ATTRIBUTE_GCC_CXXDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m) - #else - #define ATTRIBUTE_GCC_CXXDIAG(m, n) ATTRIBUTE_NONNULL(m) - #endif - extern void cp_cpp_error (cpp_reader *, int, - const char *, va_list *) - ATTRIBUTE_GCC_CXXDIAG(3,0); - #endif /* ! GCC_CP_TREE_H */ --- 5057,5066 ---- extern tree cxx_staticp (tree); /* in cp-gimplify.c */ ! extern int cp_gimplify_expr (tree *, gimple_seq *, ! gimple_seq *); extern void cp_genericize (tree); /* -- end of C++ */ #endif /* ! GCC_CP_TREE_H */ diff -Nrcpad gcc-4.3.3/gcc/cp/cvt.c gcc-4.4.0/gcc/cp/cvt.c *** gcc-4.3.3/gcc/cp/cvt.c Wed Feb 6 18:49:03 2008 --- gcc-4.4.0/gcc/cp/cvt.c Mon Aug 18 11:17:52 2008 *************** *** 1,6 **** /* Language-level data type conversion for GNU C++. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,6 ---- /* Language-level data type conversion for GNU C++. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** cp_convert_to_pointer (tree type, tree e *** 82,88 **** if (intype == error_mark_node) return error_mark_node; ! if (IS_AGGR_TYPE (intype)) { intype = complete_type (intype); if (!COMPLETE_TYPE_P (intype)) --- 82,88 ---- if (intype == error_mark_node) return error_mark_node; ! if (MAYBE_CLASS_TYPE_P (intype)) { intype = complete_type (intype); if (!COMPLETE_TYPE_P (intype)) *************** cp_convert_to_pointer (tree type, tree e *** 127,134 **** if (TYPE_MAIN_VARIANT (type) != intype && TREE_CODE (type) == POINTER_TYPE && TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE ! && IS_AGGR_TYPE (TREE_TYPE (type)) ! && IS_AGGR_TYPE (TREE_TYPE (intype)) && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE) { enum tree_code code = PLUS_EXPR; --- 127,134 ---- if (TYPE_MAIN_VARIANT (type) != intype && TREE_CODE (type) == POINTER_TYPE && TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE ! && MAYBE_CLASS_TYPE_P (TREE_TYPE (type)) ! && MAYBE_CLASS_TYPE_P (TREE_TYPE (intype)) && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE) { enum tree_code code = PLUS_EXPR; *************** convert_to_pointer_force (tree type, tre *** 256,263 **** if (TYPE_MAIN_VARIANT (type) != intype && TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE ! && IS_AGGR_TYPE (TREE_TYPE (type)) ! && IS_AGGR_TYPE (TREE_TYPE (intype)) && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE) { enum tree_code code = PLUS_EXPR; --- 256,263 ---- if (TYPE_MAIN_VARIANT (type) != intype && TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE ! && MAYBE_CLASS_TYPE_P (TREE_TYPE (type)) ! && MAYBE_CLASS_TYPE_P (TREE_TYPE (intype)) && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE) { enum tree_code code = PLUS_EXPR; *************** build_up_reference (tree type, tree arg, *** 326,339 **** /* If we had a way to wrap this up, and say, if we ever needed its address, transform all occurrences of the register, into a memory reference we could win better. */ ! rval = build_unary_op (ADDR_EXPR, arg, 1); if (rval == error_mark_node) return error_mark_node; if ((flags & LOOKUP_PROTECT) && TYPE_MAIN_VARIANT (argtype) != TYPE_MAIN_VARIANT (target_type) ! && IS_AGGR_TYPE (argtype) ! && IS_AGGR_TYPE (target_type)) { /* We go through lookup_base for the access control. */ tree binfo = lookup_base (argtype, target_type, ba_check, NULL); --- 326,339 ---- /* If we had a way to wrap this up, and say, if we ever needed its address, transform all occurrences of the register, into a memory reference we could win better. */ ! rval = cp_build_unary_op (ADDR_EXPR, arg, 1, tf_warning_or_error); if (rval == error_mark_node) return error_mark_node; if ((flags & LOOKUP_PROTECT) && TYPE_MAIN_VARIANT (argtype) != TYPE_MAIN_VARIANT (target_type) ! && MAYBE_CLASS_TYPE_P (argtype) ! && MAYBE_CLASS_TYPE_P (target_type)) { /* We go through lookup_base for the access control. */ tree binfo = lookup_base (argtype, target_type, ba_check, NULL); *************** warn_ref_binding (tree reftype, tree int *** 379,385 **** msg = "conversion to non-const reference type %q#T from" " rvalue of type %qT"; ! pedwarn (msg, reftype, intype); } } --- 379,385 ---- msg = "conversion to non-const reference type %q#T from" " rvalue of type %qT"; ! permerror (input_location, msg, reftype, intype); } } *************** convert_to_reference (tree reftype, tree *** 418,424 **** can_convert_intype_to_type = can_convert (type, intype); if (!can_convert_intype_to_type ! && (convtype & CONV_IMPLICIT) && IS_AGGR_TYPE (intype) && ! (flags & LOOKUP_NO_CONVERSION)) { /* Look for a user-defined conversion to lvalue that we can use. */ --- 418,424 ---- can_convert_intype_to_type = can_convert (type, intype); if (!can_convert_intype_to_type ! && (convtype & CONV_IMPLICIT) && MAYBE_CLASS_TYPE_P (intype) && ! (flags & LOOKUP_NO_CONVERSION)) { /* Look for a user-defined conversion to lvalue that we can use. */ *************** convert_to_reference (tree reftype, tree *** 449,456 **** if (! (convtype & CONV_CONST) && !at_least_as_qualified_p (ttl, ttr)) ! pedwarn ("conversion from %qT to %qT discards qualifiers", ! ttr, reftype); } return build_up_reference (reftype, expr, flags, decl); --- 449,456 ---- if (! (convtype & CONV_CONST) && !at_least_as_qualified_p (ttl, ttr)) ! permerror (input_location, "conversion from %qT to %qT discards qualifiers", ! ttr, reftype); } return build_up_reference (reftype, expr, flags, decl); *************** convert_to_reference (tree reftype, tree *** 465,476 **** /* B* bp; A& ar = (A&)bp; is valid, but it's probably not what they meant. */ if (TREE_CODE (intype) == POINTER_TYPE ! && (cp_comptypes (TREE_TYPE (intype), type, ! COMPARE_BASE | COMPARE_DERIVED))) warning (0, "casting %qT to %qT does not dereference pointer", intype, reftype); ! rval = build_unary_op (ADDR_EXPR, expr, 0); if (rval != error_mark_node) rval = convert_force (build_pointer_type (TREE_TYPE (reftype)), rval, 0); --- 465,476 ---- /* B* bp; A& ar = (A&)bp; is valid, but it's probably not what they meant. */ if (TREE_CODE (intype) == POINTER_TYPE ! && (comptypes (TREE_TYPE (intype), type, ! COMPARE_BASE | COMPARE_DERIVED))) warning (0, "casting %qT to %qT does not dereference pointer", intype, reftype); ! rval = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error); if (rval != error_mark_node) rval = convert_force (build_pointer_type (TREE_TYPE (reftype)), rval, 0); *************** convert_to_reference (tree reftype, tree *** 480,486 **** else { rval = convert_for_initialization (NULL_TREE, type, expr, flags, ! "converting", 0, 0); if (rval == NULL_TREE || rval == error_mark_node) return rval; warn_ref_binding (reftype, intype, decl); --- 480,487 ---- else { rval = convert_for_initialization (NULL_TREE, type, expr, flags, ! "converting", 0, 0, ! tf_warning_or_error); if (rval == NULL_TREE || rval == error_mark_node) return rval; warn_ref_binding (reftype, intype, decl); *************** convert_from_reference (tree val) *** 530,536 **** tree force_rvalue (tree expr) { ! if (IS_AGGR_TYPE (TREE_TYPE (expr)) && TREE_CODE (expr) != TARGET_EXPR) expr = ocp_convert (TREE_TYPE (expr), expr, CONV_IMPLICIT|CONV_FORCE_TEMP, LOOKUP_NORMAL); else --- 531,537 ---- tree force_rvalue (tree expr) { ! if (MAYBE_CLASS_TYPE_P (TREE_TYPE (expr)) && TREE_CODE (expr) != TARGET_EXPR) expr = ocp_convert (TREE_TYPE (expr), expr, CONV_IMPLICIT|CONV_FORCE_TEMP, LOOKUP_NORMAL); else *************** ocp_convert (tree type, tree expr, int c *** 596,602 **** e = integral_constant_value (e); ! if (IS_AGGR_TYPE (type) && (convtype & CONV_FORCE_TEMP)) /* We need a new temporary; don't take this shortcut. */; else if (same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (e))) { --- 597,603 ---- e = integral_constant_value (e); ! if (MAYBE_CLASS_TYPE_P (type) && (convtype & CONV_FORCE_TEMP)) /* We need a new temporary; don't take this shortcut. */; else if (same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (e))) { *************** ocp_convert (tree type, tree expr, int c *** 604,610 **** /* The call to fold will not always remove the NOP_EXPR as might be expected, since if one of the types is a typedef; the comparison in fold is just equality of pointers, not a ! call to cp_comptypes. We don't call fold in this case because that can result in infinite recursion; fold will call convert, which will call ocp_convert, etc. */ return e; --- 605,611 ---- /* The call to fold will not always remove the NOP_EXPR as might be expected, since if one of the types is a typedef; the comparison in fold is just equality of pointers, not a ! call to comptypes. We don't call fold in this case because that can result in infinite recursion; fold will call convert, which will call ocp_convert, etc. */ return e; *************** ocp_convert (tree type, tree expr, int c *** 630,657 **** if (code == VOID_TYPE && (convtype & CONV_STATIC)) { ! e = convert_to_void (e, /*implicit=*/NULL); return e; } if (INTEGRAL_CODE_P (code)) { tree intype = TREE_TYPE (e); ! /* enum = enum, enum = int, enum = float, (enum)pointer are all ! errors. */ ! if (TREE_CODE (type) == ENUMERAL_TYPE ! && (((INTEGRAL_OR_ENUMERATION_TYPE_P (intype) || TREE_CODE (intype) == REAL_TYPE) && ! (convtype & CONV_STATIC)) ! || TREE_CODE (intype) == POINTER_TYPE)) ! { ! if (flags & LOOKUP_COMPLAIN) ! pedwarn ("conversion from %q#T to %q#T", intype, type); ! if (flag_pedantic_errors) ! return error_mark_node; } ! if (IS_AGGR_TYPE (intype)) { tree rval; rval = build_type_conversion (type, e); --- 631,674 ---- if (code == VOID_TYPE && (convtype & CONV_STATIC)) { ! e = convert_to_void (e, /*implicit=*/NULL, tf_warning_or_error); return e; } if (INTEGRAL_CODE_P (code)) { tree intype = TREE_TYPE (e); ! ! if (TREE_CODE (type) == ENUMERAL_TYPE) ! { ! /* enum = enum, enum = int, enum = float, (enum)pointer are all ! errors. */ ! if (((INTEGRAL_OR_ENUMERATION_TYPE_P (intype) || TREE_CODE (intype) == REAL_TYPE) && ! (convtype & CONV_STATIC)) ! || TREE_CODE (intype) == POINTER_TYPE) ! { ! if (flags & LOOKUP_COMPLAIN) ! permerror (input_location, "conversion from %q#T to %q#T", intype, type); ! if (!flag_permissive) ! return error_mark_node; ! } ! ! /* [expr.static.cast] ! ! 8. A value of integral or enumeration type can be explicitly ! converted to an enumeration type. The value is unchanged if ! the original value is within the range of the enumeration ! values. Otherwise, the resulting enumeration value is ! unspecified. */ ! if (TREE_CODE (expr) == INTEGER_CST && !int_fits_type_p (expr, type)) ! warning (OPT_Wconversion, ! "the result of the conversion is unspecified because " ! "%qE is outside the range of type %qT", ! expr, type); } ! if (MAYBE_CLASS_TYPE_P (intype)) { tree rval; rval = build_type_conversion (type, e); *************** ocp_convert (tree type, tree expr, int c *** 671,677 **** if (code == VECTOR_TYPE) { tree in_vtype = TREE_TYPE (e); ! if (IS_AGGR_TYPE (in_vtype)) { tree ret_val; ret_val = build_type_conversion (type, e); --- 688,694 ---- if (code == VECTOR_TYPE) { tree in_vtype = TREE_TYPE (e); ! if (MAYBE_CLASS_TYPE_P (in_vtype)) { tree ret_val; ret_val = build_type_conversion (type, e); *************** ocp_convert (tree type, tree expr, int c *** 685,691 **** } if (code == REAL_TYPE || code == COMPLEX_TYPE) { ! if (IS_AGGR_TYPE (TREE_TYPE (e))) { tree rval; rval = build_type_conversion (type, e); --- 702,708 ---- } if (code == REAL_TYPE || code == COMPLEX_TYPE) { ! if (MAYBE_CLASS_TYPE_P (TREE_TYPE (e))) { tree rval; rval = build_type_conversion (type, e); *************** ocp_convert (tree type, tree expr, int c *** 705,711 **** /* New C++ semantics: since assignment is now based on memberwise copying, if the rhs type is derived from the lhs type, then we may still do a conversion. */ ! if (IS_AGGR_TYPE_CODE (code)) { tree dtype = TREE_TYPE (e); tree ctor = NULL_TREE; --- 722,728 ---- /* New C++ semantics: since assignment is now based on memberwise copying, if the rhs type is derived from the lhs type, then we may still do a conversion. */ ! if (RECORD_OR_UNION_CODE_P (code)) { tree dtype = TREE_TYPE (e); tree ctor = NULL_TREE; *************** ocp_convert (tree type, tree expr, int c *** 724,731 **** if (abstract_virtuals_error (NULL_TREE, type)) return error_mark_node; ! if ((flags & LOOKUP_ONLYCONVERTING) ! && ! (IS_AGGR_TYPE (dtype) && DERIVED_FROM_P (type, dtype))) /* For copy-initialization, first we create a temp of the proper type with a user-defined conversion sequence, then we direct-initialize the target with the temp (see [dcl.init]). */ --- 741,750 ---- if (abstract_virtuals_error (NULL_TREE, type)) return error_mark_node; ! if (BRACE_ENCLOSED_INITIALIZER_P (ctor)) ! ctor = perform_implicit_conversion (type, ctor, tf_warning_or_error); ! else if ((flags & LOOKUP_ONLYCONVERTING) ! && ! (CLASS_TYPE_P (dtype) && DERIVED_FROM_P (type, dtype))) /* For copy-initialization, first we create a temp of the proper type with a user-defined conversion sequence, then we direct-initialize the target with the temp (see [dcl.init]). */ *************** ocp_convert (tree type, tree expr, int c *** 734,740 **** ctor = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, ctor), ! type, flags); if (ctor) return build_cplus_new (type, ctor); } --- 753,760 ---- ctor = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, ctor), ! type, flags, ! tf_warning_or_error); if (ctor) return build_cplus_new (type, ctor); } *************** ocp_convert (tree type, tree expr, int c *** 763,780 **** IMPLICIT is tells us the context of an implicit void conversion. */ tree ! convert_to_void (tree expr, const char *implicit) { if (expr == error_mark_node || TREE_TYPE (expr) == error_mark_node) return error_mark_node; if (!TREE_TYPE (expr)) return expr; ! if (invalid_nonstatic_memfn_p (expr)) return error_mark_node; if (TREE_CODE (expr) == PSEUDO_DTOR_EXPR) { ! error ("pseudo-destructor is not called"); return error_mark_node; } if (VOID_TYPE_P (TREE_TYPE (expr))) --- 783,801 ---- IMPLICIT is tells us the context of an implicit void conversion. */ tree ! convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain) { if (expr == error_mark_node || TREE_TYPE (expr) == error_mark_node) return error_mark_node; if (!TREE_TYPE (expr)) return expr; ! if (invalid_nonstatic_memfn_p (expr, complain)) return error_mark_node; if (TREE_CODE (expr) == PSEUDO_DTOR_EXPR) { ! if (complain & tf_error) ! error ("pseudo-destructor is not called"); return error_mark_node; } if (VOID_TYPE_P (TREE_TYPE (expr))) *************** convert_to_void (tree expr, const char * *** 788,797 **** tree op2 = TREE_OPERAND (expr,2); tree new_op1 = convert_to_void (op1, (implicit && !TREE_SIDE_EFFECTS (op2) ! ? "second operand of conditional" : NULL)); tree new_op2 = convert_to_void (op2, (implicit && !TREE_SIDE_EFFECTS (op1) ! ? "third operand of conditional" : NULL)); expr = build3 (COND_EXPR, TREE_TYPE (new_op1), TREE_OPERAND (expr, 0), new_op1, new_op2); --- 809,818 ---- tree op2 = TREE_OPERAND (expr,2); tree new_op1 = convert_to_void (op1, (implicit && !TREE_SIDE_EFFECTS (op2) ! ? "second operand of conditional" : NULL), complain); tree new_op2 = convert_to_void (op2, (implicit && !TREE_SIDE_EFFECTS (op1) ! ? "third operand of conditional" : NULL), complain); expr = build3 (COND_EXPR, TREE_TYPE (new_op1), TREE_OPERAND (expr, 0), new_op1, new_op2); *************** convert_to_void (tree expr, const char * *** 804,810 **** tree op1 = TREE_OPERAND (expr,1); tree new_op1 = convert_to_void (op1, (implicit && !TREE_NO_WARNING (expr) ! ? "right-hand operand of comma" : NULL)); if (new_op1 != op1) { --- 825,831 ---- tree op1 = TREE_OPERAND (expr,1); tree new_op1 = convert_to_void (op1, (implicit && !TREE_NO_WARNING (expr) ! ? "right-hand operand of comma" : NULL), complain); if (new_op1 != op1) { *************** convert_to_void (tree expr, const char * *** 834,847 **** /* Can't load the value if we don't know the type. */ if (is_volatile && !is_complete) ! warning (0, "object of incomplete type %qT will not be accessed in %s", ! type, implicit ? implicit : "void context"); /* Don't load the value if this is an implicit dereference, or if the type needs to be handled by ctors/dtors. */ else if (is_volatile && (is_reference || TREE_ADDRESSABLE (type))) ! warning (0, "object of type %qT will not be accessed in %s", ! TREE_TYPE (TREE_OPERAND (expr, 0)), ! implicit ? implicit : "void context"); if (is_reference || !is_volatile || !is_complete || TREE_ADDRESSABLE (type)) expr = TREE_OPERAND (expr, 0); --- 855,874 ---- /* Can't load the value if we don't know the type. */ if (is_volatile && !is_complete) ! { ! if (complain & tf_warning) ! warning (0, "object of incomplete type %qT will not be accessed in %s", ! type, implicit ? implicit : "void context"); ! } /* Don't load the value if this is an implicit dereference, or if the type needs to be handled by ctors/dtors. */ else if (is_volatile && (is_reference || TREE_ADDRESSABLE (type))) ! { ! if (complain & tf_warning) ! warning (0, "object of type %qT will not be accessed in %s", ! TREE_TYPE (TREE_OPERAND (expr, 0)), ! implicit ? implicit : "void context"); ! } if (is_reference || !is_volatile || !is_complete || TREE_ADDRESSABLE (type)) expr = TREE_OPERAND (expr, 0); *************** convert_to_void (tree expr, const char * *** 854,860 **** tree type = TREE_TYPE (expr); int is_complete = COMPLETE_TYPE_P (complete_type (type)); ! if (TYPE_VOLATILE (type) && !is_complete) warning (0, "object %qE of incomplete type %qT will not be accessed in %s", expr, type, implicit ? implicit : "void context"); break; --- 881,887 ---- tree type = TREE_TYPE (expr); int is_complete = COMPLETE_TYPE_P (complete_type (type)); ! if (TYPE_VOLATILE (type) && !is_complete && (complain & tf_warning)) warning (0, "object %qE of incomplete type %qT will not be accessed in %s", expr, type, implicit ? implicit : "void context"); break; *************** convert_to_void (tree expr, const char * *** 892,906 **** { /* [over.over] enumerates the places where we can take the address of an overloaded function, and this is not one of them. */ ! pedwarn ("%s cannot resolve address of overloaded function", ! implicit ? implicit : "void cast"); expr = void_zero_node; } else if (implicit && probe == expr && is_overloaded_fn (probe)) { /* Only warn when there is no &. */ ! warning (OPT_Waddress, "%s is a reference, not call, to function %qE", ! implicit, expr); if (TREE_CODE (expr) == COMPONENT_REF) expr = TREE_OPERAND (expr, 0); } --- 919,937 ---- { /* [over.over] enumerates the places where we can take the address of an overloaded function, and this is not one of them. */ ! if (complain & tf_error) ! error ("%s cannot resolve address of overloaded function", ! implicit ? implicit : "void cast"); ! else ! return error_mark_node; expr = void_zero_node; } else if (implicit && probe == expr && is_overloaded_fn (probe)) { /* Only warn when there is no &. */ ! if (complain & tf_warning) ! warning (OPT_Waddress, "%s is a reference, not call, to function %qE", ! implicit, expr); if (TREE_CODE (expr) == COMPONENT_REF) expr = TREE_OPERAND (expr, 0); } *************** convert_to_void (tree expr, const char * *** 915,927 **** { /* The middle end does not warn about expressions that have been explicitly cast to void, so we must do so here. */ ! if (!TREE_SIDE_EFFECTS (expr)) ! warning (OPT_Wunused_value, "%s has no effect", implicit); else { tree e; enum tree_code code; ! enum tree_code_class class; e = expr; /* We might like to warn about (say) "(int) f()", as the --- 946,960 ---- { /* The middle end does not warn about expressions that have been explicitly cast to void, so we must do so here. */ ! if (!TREE_SIDE_EFFECTS (expr)) { ! if (complain & tf_warning) ! warning (OPT_Wunused_value, "%s has no effect", implicit); ! } else { tree e; enum tree_code code; ! enum tree_code_class tclass; e = expr; /* We might like to warn about (say) "(int) f()", as the *************** convert_to_void (tree expr, const char * *** 938,953 **** e = TREE_OPERAND (e, 0); code = TREE_CODE (e); ! class = TREE_CODE_CLASS (code); ! if (class == tcc_comparison ! || class == tcc_unary ! || (class == tcc_binary && !(code == MODIFY_EXPR || code == INIT_EXPR || code == PREDECREMENT_EXPR || code == PREINCREMENT_EXPR || code == POSTDECREMENT_EXPR || code == POSTINCREMENT_EXPR))) warning (OPT_Wunused_value, "value computed is not used"); } } --- 971,987 ---- e = TREE_OPERAND (e, 0); code = TREE_CODE (e); ! tclass = TREE_CODE_CLASS (code); ! if ((tclass == tcc_comparison ! || tclass == tcc_unary ! || (tclass == tcc_binary && !(code == MODIFY_EXPR || code == INIT_EXPR || code == PREDECREMENT_EXPR || code == PREINCREMENT_EXPR || code == POSTDECREMENT_EXPR || code == POSTINCREMENT_EXPR))) + && (complain & tf_warning)) warning (OPT_Wunused_value, "value computed is not used"); } } *************** build_expr_type_conversion (int desires, *** 1065,1071 **** if (basetype == error_mark_node) return error_mark_node; ! if (! IS_AGGR_TYPE (basetype)) switch (TREE_CODE (basetype)) { case INTEGER_TYPE: --- 1099,1105 ---- if (basetype == error_mark_node) return error_mark_node; ! if (! MAYBE_CLASS_TYPE_P (basetype)) switch (TREE_CODE (basetype)) { case INTEGER_TYPE: *************** type_promotes_to (tree type) *** 1203,1208 **** --- 1237,1244 ---- /* Normally convert enums to int, but convert wide enums to something wider. */ else if (TREE_CODE (type) == ENUMERAL_TYPE + || type == char16_type_node + || type == char32_type_node || type == wchar_type_node) { int precision = MAX (TYPE_PRECISION (type), diff -Nrcpad gcc-4.3.3/gcc/cp/cxx-pretty-print.c gcc-4.4.0/gcc/cp/cxx-pretty-print.c *** gcc-4.3.3/gcc/cp/cxx-pretty-print.c Thu Nov 1 02:17:02 2007 --- gcc-4.4.0/gcc/cp/cxx-pretty-print.c Mon Jul 21 19:29:07 2008 *************** *** 1,5 **** /* Implementation of subroutines for the GNU C++ pretty-printer. ! Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. --- 1,5 ---- /* Implementation of subroutines for the GNU C++ pretty-printer. ! Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. *************** pp_cxx_primary_expression (cxx_pretty_pr *** 452,458 **** reinterpret_cast < type-id > ( expression ) const_cast < type-id > ( expression ) typeid ( expression ) ! typeif ( type-id ) */ static void pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) --- 452,458 ---- reinterpret_cast < type-id > ( expression ) const_cast < type-id > ( expression ) typeid ( expression ) ! typeid ( type-id ) */ static void pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) *************** static void *** 636,641 **** --- 636,643 ---- pp_cxx_new_expression (cxx_pretty_printer *pp, tree t) { enum tree_code code = TREE_CODE (t); + tree type = TREE_OPERAND (t, 1); + tree init = TREE_OPERAND (t, 2); switch (code) { case NEW_EXPR: *************** pp_cxx_new_expression (cxx_pretty_printe *** 648,665 **** pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0)); pp_space (pp); } ! /* FIXME: array-types are built with one more element. */ ! pp_cxx_type_id (pp, TREE_OPERAND (t, 1)); ! if (TREE_OPERAND (t, 2)) { pp_left_paren (pp); ! t = TREE_OPERAND (t, 2); ! if (TREE_CODE (t) == TREE_LIST) ! pp_c_expression_list (pp_c_base (pp), t); ! else if (t == void_zero_node) ; /* OK, empty initializer list. */ else ! pp_cxx_expression (pp, t); pp_right_paren (pp); } break; --- 650,671 ---- pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0)); pp_space (pp); } ! if (TREE_CODE (type) == ARRAY_REF) ! type = build_cplus_array_type ! (TREE_OPERAND (type, 0), ! build_index_type (fold_build2 (MINUS_EXPR, integer_type_node, ! TREE_OPERAND (type, 1), ! integer_one_node))); ! pp_cxx_type_id (pp, type); ! if (init) { pp_left_paren (pp); ! if (TREE_CODE (init) == TREE_LIST) ! pp_c_expression_list (pp_c_base (pp), init); ! else if (init == void_zero_node) ; /* OK, empty initializer list. */ else ! pp_cxx_expression (pp, init); pp_right_paren (pp); } break; *************** pp_cxx_pm_expression (cxx_pretty_printer *** 804,810 **** { switch (TREE_CODE (t)) { ! /* Handle unfortunate OFFESET_REF overloading here. */ case OFFSET_REF: if (TYPE_P (TREE_OPERAND (t, 0))) { --- 810,816 ---- { switch (TREE_CODE (t)) { ! /* Handle unfortunate OFFSET_REF overloading here. */ case OFFSET_REF: if (TYPE_P (TREE_OPERAND (t, 0))) { *************** pp_cxx_template_parameter (cxx_pretty_pr *** 2010,2016 **** pp_cxx_identifier (pp, "..."); if (DECL_NAME (parameter)) pp_cxx_tree_identifier (pp, DECL_NAME (parameter)); ! /* FIXME: Chech if we should print also default argument. */ break; case PARM_DECL: --- 2016,2022 ---- pp_cxx_identifier (pp, "..."); if (DECL_NAME (parameter)) pp_cxx_tree_identifier (pp, DECL_NAME (parameter)); ! /* FIXME: Check if we should print also default argument. */ break; case PARM_DECL: diff -Nrcpad gcc-4.3.3/gcc/cp/decl.c gcc-4.4.0/gcc/cp/decl.c *** gcc-4.3.3/gcc/cp/decl.c Tue Sep 30 19:56:13 2008 --- gcc-4.4.0/gcc/cp/decl.c Tue Apr 7 04:38:10 2009 *************** *** 1,6 **** /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ! 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) --- 1,6 ---- /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ! 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) *************** along with GCC; see the file COPYING3. *** 54,60 **** #include "tree-flow.h" #include "pointer-set.h" ! static tree grokparms (cp_parameter_declarator *, tree *); static const char *redeclaration_error_message (tree, tree); static int decl_jump_unsafe (tree); --- 54,60 ---- #include "tree-flow.h" #include "pointer-set.h" ! static tree grokparms (tree parmlist, tree *); static const char *redeclaration_error_message (tree, tree); static int decl_jump_unsafe (tree); *************** static tree grok_reference_init (tree, t *** 66,72 **** static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *, int, int, tree); static void record_unknown_type (tree, const char *); ! static tree builtin_function_1 (tree, tree); static tree build_library_fn_1 (tree, enum tree_code, tree); static int member_function_or_else (tree, tree, enum overload_flags); static void bad_specifiers (tree, const char *, int, int, int, int, --- 66,72 ---- static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *, int, int, tree); static void record_unknown_type (tree, const char *); ! static tree builtin_function_1 (tree, tree, bool); static tree build_library_fn_1 (tree, enum tree_code, tree); static int member_function_or_else (tree, tree, enum overload_flags); static void bad_specifiers (tree, const char *, int, int, int, int, *************** static tree lookup_and_check_tag (enum t *** 81,87 **** static int walk_namespaces_r (tree, walk_namespaces_fn, void *); static void maybe_deduce_size_from_array_init (tree, tree); static void layout_var_decl (tree); - static void maybe_commonize_var (tree); static tree check_initializer (tree, tree, int, tree *); static void make_rtl_for_nonlocal_decl (tree, tree, const char *); static void save_function_data (tree); --- 81,86 ---- *************** struct named_label_entry GTY(()) *** 227,243 **** function, two inside the body of a function in a local class, etc.) */ int function_depth; /* States indicating how grokdeclarator() should handle declspecs marked with __attribute__((deprecated)). An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ ! ! enum deprecated_states { ! DEPRECATED_NORMAL, ! DEPRECATED_SUPPRESS ! }; ! ! static enum deprecated_states deprecated_state = DEPRECATED_NORMAL; /* A TREE_LIST of VAR_DECLs. The TREE_PURPOSE is a RECORD_TYPE or --- 226,241 ---- function, two inside the body of a function in a local class, etc.) */ int function_depth; + /* To avoid unwanted recursion, finish_function defers all mark_used calls + encountered during its execution until it finishes. */ + bool defer_mark_used_calls; + VEC(tree, gc) *deferred_mark_used_calls; + /* States indicating how grokdeclarator() should handle declspecs marked with __attribute__((deprecated)). An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ ! enum deprecated_states deprecated_state = DEPRECATED_NORMAL; /* A TREE_LIST of VAR_DECLs. The TREE_PURPOSE is a RECORD_TYPE or *************** current_tmpl_spec_kind (int n_class_scop *** 315,321 **** template void S::f(int); ! The `class T' maches the `S', leaving no template headers corresponding to the `f'. */ return tsk_none; else if (n_template_parm_scopes > n_class_scopes + 1) --- 313,319 ---- template void S::f(int); ! The `class T' matches the `S', leaving no template headers corresponding to the `f'. */ return tsk_none; else if (n_template_parm_scopes > n_class_scopes + 1) *************** pop_label (tree label, tree old_value) *** 357,368 **** location_t location; error ("label %q+D used but not defined", label); - #ifdef USE_MAPPED_LOCATION location = input_location; /* FIXME want (input_filename, (line)0) */ - #else - location.file = input_filename; - location.line = 0; - #endif /* Avoid crashing later. */ define_label (location, DECL_NAME (label)); } --- 355,361 ---- *************** insert_block (tree block) *** 805,816 **** itself, calling F for each. The DATA is passed to F as well. */ static int ! walk_namespaces_r (tree namespace, walk_namespaces_fn f, void* data) { int result = 0; ! tree current = NAMESPACE_LEVEL (namespace)->namespaces; ! result |= (*f) (namespace, data); for (; current; current = TREE_CHAIN (current)) result |= walk_namespaces_r (current, f, data); --- 798,809 ---- itself, calling F for each. The DATA is passed to F as well. */ static int ! walk_namespaces_r (tree name_space, walk_namespaces_fn f, void* data) { int result = 0; ! tree current = NAMESPACE_LEVEL (name_space)->namespaces; ! result |= (*f) (name_space, data); for (; current; current = TREE_CHAIN (current)) result |= walk_namespaces_r (current, f, data); *************** walk_namespaces (walk_namespaces_fn f, v *** 832,840 **** wrapup_global_declarations for this NAMESPACE. */ int ! wrapup_globals_for_namespace (tree namespace, void* data) { ! struct cp_binding_level *level = NAMESPACE_LEVEL (namespace); VEC(tree,gc) *statics = level->static_decls; tree *vec = VEC_address (tree, statics); int len = VEC_length (tree, statics); --- 825,833 ---- wrapup_global_declarations for this NAMESPACE. */ int ! wrapup_globals_for_namespace (tree name_space, void* data) { ! struct cp_binding_level *level = NAMESPACE_LEVEL (name_space); VEC(tree,gc) *statics = level->static_decls; tree *vec = VEC_address (tree, statics); int len = VEC_length (tree, statics); *************** decls_match (tree newdecl, tree olddecl) *** 1015,1023 **** else if (TREE_TYPE (newdecl) == NULL_TREE) types_match = 0; else ! types_match = cp_comptypes (TREE_TYPE (newdecl), ! TREE_TYPE (olddecl), ! COMPARE_REDECLARATION); } return types_match; --- 1008,1016 ---- else if (TREE_TYPE (newdecl) == NULL_TREE) types_match = 0; else ! types_match = comptypes (TREE_TYPE (newdecl), ! TREE_TYPE (olddecl), ! COMPARE_REDECLARATION); } return types_match; *************** warn_extern_redeclared_static (tree newd *** 1060,1067 **** return; name = DECL_ASSEMBLER_NAME (newdecl); ! pedwarn ("%qD was declared % and later %", newdecl); ! pedwarn ("previous declaration of %q+D", olddecl); } /* NEW_DECL is a redeclaration of OLD_DECL; both are functions or --- 1053,1060 ---- return; name = DECL_ASSEMBLER_NAME (newdecl); ! permerror (input_location, "%qD was declared % and later %", newdecl); ! permerror (input_location, "previous declaration of %q+D", olddecl); } /* NEW_DECL is a redeclaration of OLD_DECL; both are functions or *************** duplicate_decls (tree newdecl, tree oldd *** 1465,1471 **** const char *errmsg = redeclaration_error_message (newdecl, olddecl); if (errmsg) { ! error (errmsg, newdecl); if (DECL_NAME (olddecl) != NULL_TREE) error ((DECL_INITIAL (olddecl) && namespace_bindings_p ()) ? "%q+#D previously defined here" --- 1458,1464 ---- const char *errmsg = redeclaration_error_message (newdecl, olddecl); if (errmsg) { ! error_at (DECL_SOURCE_LOCATION (newdecl), errmsg, newdecl); if (DECL_NAME (olddecl) != NULL_TREE) error ((DECL_INITIAL (olddecl) && namespace_bindings_p ()) ? "%q+#D previously defined here" *************** duplicate_decls (tree newdecl, tree oldd *** 1544,1552 **** if (1 == simple_cst_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2))) { ! pedwarn ("default argument given for parameter %d of %q#D", ! i, newdecl); ! pedwarn ("after previous specification in %q+#D", olddecl); } else { --- 1537,1545 ---- if (1 == simple_cst_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2))) { ! permerror (input_location, "default argument given for parameter %d of %q#D", ! i, newdecl); ! permerror (input_location, "after previous specification in %q+#D", olddecl); } else { *************** duplicate_decls (tree newdecl, tree oldd *** 1556,1569 **** olddecl); } } - - if (DECL_DECLARED_INLINE_P (newdecl) - && ! DECL_DECLARED_INLINE_P (olddecl) - && TREE_ADDRESSABLE (olddecl) && warn_inline) - { - warning (0, "%q#D was used before it was declared inline", newdecl); - warning (0, "%Jprevious non-inline declaration here", olddecl); - } } } --- 1549,1554 ---- *************** duplicate_decls (tree newdecl, tree oldd *** 1618,1623 **** --- 1603,1614 ---- warning (OPT_Wredundant_decls, "redundant redeclaration of %qD in same scope", newdecl); warning (OPT_Wredundant_decls, "previous declaration of %q+D", olddecl); } + + if (DECL_DELETED_FN (newdecl)) + { + error ("deleted definition of %qD", newdecl); + error ("after previous declaration %q+D", olddecl); + } } /* Deal with C++: must preserve virtual function table size. */ *************** duplicate_decls (tree newdecl, tree oldd *** 1659,1673 **** && DECL_INITIAL (new_result)) { if (DECL_INITIAL (old_result)) ! { ! DECL_INLINE (old_result) = 0; ! DECL_UNINLINABLE (old_result) = 1; ! } else ! { ! DECL_INLINE (old_result) = DECL_INLINE (new_result); ! DECL_UNINLINABLE (old_result) = DECL_UNINLINABLE (new_result); ! } DECL_EXTERNAL (old_result) = DECL_EXTERNAL (new_result); DECL_NOT_REALLY_EXTERN (old_result) = DECL_NOT_REALLY_EXTERN (new_result); --- 1650,1658 ---- && DECL_INITIAL (new_result)) { if (DECL_INITIAL (old_result)) ! DECL_UNINLINABLE (old_result) = 1; else ! DECL_UNINLINABLE (old_result) = DECL_UNINLINABLE (new_result); DECL_EXTERNAL (old_result) = DECL_EXTERNAL (new_result); DECL_NOT_REALLY_EXTERN (old_result) = DECL_NOT_REALLY_EXTERN (new_result); *************** duplicate_decls (tree newdecl, tree oldd *** 1681,1688 **** } else { - DECL_INLINE (old_result) - |= DECL_INLINE (new_result); DECL_DECLARED_INLINE_P (old_result) |= DECL_DECLARED_INLINE_P (new_result); DECL_DISREGARD_INLINE_LIMITS (old_result) --- 1666,1671 ---- *************** duplicate_decls (tree newdecl, tree oldd *** 1701,1708 **** = DECL_SOURCE_LOCATION (newdecl); DECL_INITIAL (old_result) = DECL_INITIAL (new_result); if (DECL_FUNCTION_TEMPLATE_P (newdecl)) ! DECL_ARGUMENTS (old_result) ! = DECL_ARGUMENTS (new_result); } return olddecl; --- 1684,1697 ---- = DECL_SOURCE_LOCATION (newdecl); DECL_INITIAL (old_result) = DECL_INITIAL (new_result); if (DECL_FUNCTION_TEMPLATE_P (newdecl)) ! { ! tree parm; ! DECL_ARGUMENTS (old_result) ! = DECL_ARGUMENTS (new_result); ! for (parm = DECL_ARGUMENTS (old_result); parm; ! parm = TREE_CHAIN (parm)) ! DECL_CONTEXT (parm) = old_result; ! } } return olddecl; *************** duplicate_decls (tree newdecl, tree oldd *** 1779,1784 **** --- 1768,1787 ---- if (TREE_DEPRECATED (newdecl)) TREE_DEPRECATED (olddecl) = 1; + /* Preserve function specific target and optimization options */ + if (TREE_CODE (newdecl) == FUNCTION_DECL) + { + if (DECL_FUNCTION_SPECIFIC_TARGET (olddecl) + && !DECL_FUNCTION_SPECIFIC_TARGET (newdecl)) + DECL_FUNCTION_SPECIFIC_TARGET (newdecl) + = DECL_FUNCTION_SPECIFIC_TARGET (olddecl); + + if (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (olddecl) + && !DECL_FUNCTION_SPECIFIC_OPTIMIZATION (newdecl)) + DECL_FUNCTION_SPECIFIC_OPTIMIZATION (newdecl) + = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (olddecl); + } + /* Merge the initialization information. */ if (DECL_INITIAL (newdecl) == NULL_TREE && DECL_INITIAL (olddecl) != NULL_TREE) *************** duplicate_decls (tree newdecl, tree oldd *** 1807,1817 **** |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl); DECL_NO_LIMIT_STACK (newdecl) |= DECL_NO_LIMIT_STACK (olddecl); TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl); - TREE_READONLY (newdecl) |= TREE_READONLY (olddecl); TREE_NOTHROW (newdecl) |= TREE_NOTHROW (olddecl); DECL_IS_MALLOC (newdecl) |= DECL_IS_MALLOC (olddecl); DECL_IS_OPERATOR_NEW (newdecl) |= DECL_IS_OPERATOR_NEW (olddecl); ! DECL_IS_PURE (newdecl) |= DECL_IS_PURE (olddecl); /* Keep the old RTL. */ COPY_DECL_RTL (olddecl, newdecl); } --- 1810,1822 ---- |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl); DECL_NO_LIMIT_STACK (newdecl) |= DECL_NO_LIMIT_STACK (olddecl); TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl); TREE_NOTHROW (newdecl) |= TREE_NOTHROW (olddecl); DECL_IS_MALLOC (newdecl) |= DECL_IS_MALLOC (olddecl); DECL_IS_OPERATOR_NEW (newdecl) |= DECL_IS_OPERATOR_NEW (olddecl); ! DECL_PURE_P (newdecl) |= DECL_PURE_P (olddecl); ! TREE_READONLY (newdecl) |= TREE_READONLY (olddecl); ! DECL_LOOPING_CONST_OR_PURE_P (newdecl) ! |= DECL_LOOPING_CONST_OR_PURE_P (olddecl); /* Keep the old RTL. */ COPY_DECL_RTL (olddecl, newdecl); } *************** duplicate_decls (tree newdecl, tree oldd *** 1919,1924 **** --- 1924,1931 ---- if (TREE_CODE (newdecl) == FUNCTION_DECL) { + tree parm; + if (DECL_TEMPLATE_INSTANTIATION (olddecl) && !DECL_TEMPLATE_INSTANTIATION (newdecl)) { *************** duplicate_decls (tree newdecl, tree oldd *** 1951,1959 **** } else if (new_defines_function && DECL_INITIAL (olddecl)) { ! /* C++ is always in in unit-at-a-time mode, so we never ! inline re-defined extern inline functions. */ ! DECL_INLINE (newdecl) = 0; DECL_UNINLINABLE (newdecl) = 1; } else --- 1958,1966 ---- } else if (new_defines_function && DECL_INITIAL (olddecl)) { ! /* Never inline re-defined extern inline functions. ! FIXME: this could be better handled by keeping both ! function as separate declarations. */ DECL_UNINLINABLE (newdecl) = 1; } else *************** duplicate_decls (tree newdecl, tree oldd *** 1963,1974 **** DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl); - /* If either decl says `inline', this fn is inline, unless - its definition was passed already. */ - if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE) - DECL_INLINE (olddecl) = 1; - DECL_INLINE (newdecl) = DECL_INLINE (olddecl); - DECL_UNINLINABLE (newdecl) = DECL_UNINLINABLE (olddecl) = (DECL_UNINLINABLE (newdecl) || DECL_UNINLINABLE (olddecl)); --- 1970,1975 ---- *************** duplicate_decls (tree newdecl, tree oldd *** 1981,1986 **** --- 1982,1992 ---- /* Preserve abstractness on cloned [cd]tors. */ DECL_ABSTRACT (newdecl) = DECL_ABSTRACT (olddecl); + /* Update newdecl's parms to point at olddecl. */ + for (parm = DECL_ARGUMENTS (newdecl); parm; + parm = TREE_CHAIN (parm)) + DECL_CONTEXT (parm) = olddecl; + if (! types_match) { SET_DECL_LANGUAGE (olddecl, DECL_LANGUAGE (newdecl)); *************** duplicate_decls (tree newdecl, tree oldd *** 2013,2019 **** } DECL_RESULT (newdecl) = DECL_RESULT (olddecl); ! /* Don't clear out the arguments if we're redefining a function. */ if (DECL_ARGUMENTS (olddecl)) DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl); } --- 2019,2026 ---- } DECL_RESULT (newdecl) = DECL_RESULT (olddecl); ! /* Don't clear out the arguments if we're just redeclaring a ! function. */ if (DECL_ARGUMENTS (olddecl)) DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl); } *************** duplicate_decls (tree newdecl, tree oldd *** 2060,2065 **** --- 2067,2078 ---- ggc_free (DECL_LANG_SPECIFIC (olddecl)); } + /* Merge the USED information. */ + if (TREE_USED (olddecl)) + TREE_USED (newdecl) = 1; + else if (TREE_USED (newdecl)) + TREE_USED (olddecl) = 1; + if (TREE_CODE (newdecl) == FUNCTION_DECL) { int function_size; *************** static void *** 2461,2471 **** identify_goto (tree decl, const location_t *locus) { if (decl) ! pedwarn ("jump to label %qD", decl); else ! pedwarn ("jump to case label"); if (locus) ! pedwarn ("%H from here", locus); } /* Check that a single previously seen jump to a newly defined label --- 2474,2484 ---- identify_goto (tree decl, const location_t *locus) { if (decl) ! permerror (input_location, "jump to label %qD", decl); else ! permerror (input_location, "jump to case label"); if (locus) ! permerror (input_location, "%H from here", locus); } /* Check that a single previously seen jump to a newly defined label *************** check_previous_goto_1 (tree decl, struct *** 2507,2513 **** if (problem > 1) error (" crosses initialization of %q+#D", new_decls); else ! pedwarn (" enters scope of non-POD %q+#D", new_decls); } if (b == level) --- 2520,2526 ---- if (problem > 1) error (" crosses initialization of %q+#D", new_decls); else ! permerror (input_location, " enters scope of non-POD %q+#D", new_decls); } if (b == level) *************** check_goto (tree decl) *** 2603,2610 **** if (ent->in_try_scope || ent->in_catch_scope || ent->in_omp_scope || ent->bad_decls) { ! pedwarn ("jump to label %q+D", decl); ! pedwarn (" from here"); identified = true; } --- 2616,2623 ---- if (ent->in_try_scope || ent->in_catch_scope || ent->in_omp_scope || ent->bad_decls) { ! permerror (input_location, "jump to label %q+D", decl); ! permerror (input_location, " from here"); identified = true; } *************** check_goto (tree decl) *** 2622,2628 **** else if (u > 1) error (" skips initialization of %q+#D", b); else ! pedwarn (" enters scope of non-POD %q+#D", b); } if (ent->in_try_scope) --- 2635,2641 ---- else if (u > 1) error (" skips initialization of %q+#D", b); else ! permerror (input_location, " enters scope of non-POD %q+#D", b); } if (ent->in_try_scope) *************** check_goto (tree decl) *** 2643,2650 **** { if (!identified) { ! pedwarn ("jump to label %q+D", decl); ! pedwarn (" from here"); identified = true; } error (" exits OpenMP structured block"); --- 2656,2663 ---- { if (!identified) { ! permerror (input_location, "jump to label %q+D", decl); ! permerror (input_location, " from here"); identified = true; } error (" exits OpenMP structured block"); *************** define_label (location_t location, tree *** 2696,2702 **** p->more_cleanups_ok = 0; if (name == get_identifier ("wchar_t")) ! pedwarn ("label named wchar_t"); if (DECL_INITIAL (decl) != NULL_TREE) { --- 2709,2715 ---- p->more_cleanups_ok = 0; if (name == get_identifier ("wchar_t")) ! permerror (input_location, "label named wchar_t"); if (DECL_INITIAL (decl) != NULL_TREE) { *************** finish_case_label (tree low_value, tree *** 2807,2813 **** if (!check_switch_goto (switch_stack->level)) return error_mark_node; ! r = c_add_case_label (switch_stack->cases, cond, TREE_TYPE (cond), low_value, high_value); /* After labels, make any new cleanups in the function go into their --- 2820,2827 ---- if (!check_switch_goto (switch_stack->level)) return error_mark_node; ! r = c_add_case_label (switch_stack->cases, cond, ! SWITCH_STMT_TYPE (switch_stack->switch_stmt), low_value, high_value); /* After labels, make any new cleanups in the function go into their *************** build_typename_type (tree context, tree *** 2896,2902 **** else { /* Build the TYPENAME_TYPE. */ ! t = make_aggr_type (TYPENAME_TYPE); TYPE_CONTEXT (t) = ti.scope; TYPENAME_TYPE_FULLNAME (t) = ti.template_id; TYPENAME_IS_ENUM_P (t) = ti.enum_p; --- 2910,2916 ---- else { /* Build the TYPENAME_TYPE. */ ! t = cxx_make_type (TYPENAME_TYPE); TYPE_CONTEXT (t) = ti.scope; TYPENAME_TYPE_FULLNAME (t) = ti.template_id; TYPENAME_IS_ENUM_P (t) = ti.enum_p; *************** make_typename_type (tree context, tree n *** 2978,3001 **** gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); gcc_assert (TYPE_P (context)); ! /* When the CONTEXT is a dependent type, NAME could refer to a ! dependent base class of CONTEXT. So we cannot peek inside it, ! even if CONTEXT is a currently open scope. */ ! if (dependent_type_p (context)) ! return build_typename_type (context, name, fullname, tag_type); ! ! if (!IS_AGGR_TYPE (context)) { if (complain & tf_error) error ("%q#T is not a class", context); return error_mark_node; } want_template = TREE_CODE (fullname) == TEMPLATE_ID_EXPR; - /* We should only set WANT_TYPE when we're a nested typename type. - Then we can give better diagnostics if we find a non-type. */ - t = lookup_field (context, name, 0, /*want_type=*/true); if (!t) { if (complain & tf_error) --- 2992,3021 ---- gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); gcc_assert (TYPE_P (context)); ! if (!MAYBE_CLASS_TYPE_P (context)) { if (complain & tf_error) error ("%q#T is not a class", context); return error_mark_node; } + /* When the CONTEXT is a dependent type, NAME could refer to a + dependent base class of CONTEXT. But look inside it anyway + if CONTEXT is a currently open scope, in case it refers to a + member of the current instantiation or a non-dependent base; + lookup will stop when we hit a dependent base. */ + if (!dependent_scope_p (context)) + /* We should only set WANT_TYPE when we're a nested typename type. + Then we can give better diagnostics if we find a non-type. */ + t = lookup_field (context, name, 0, /*want_type=*/true); + else + t = NULL_TREE; + + if (!t && dependent_type_p (context)) + return build_typename_type (context, name, fullname, tag_type); + want_template = TREE_CODE (fullname) == TEMPLATE_ID_EXPR; if (!t) { if (complain & tf_error) *************** make_unbound_class_template (tree contex *** 3061,3067 **** { tree tmpl = NULL_TREE; ! if (IS_AGGR_TYPE (context)) tmpl = lookup_field (context, name, 0, false); if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl)) --- 3081,3087 ---- { tree tmpl = NULL_TREE; ! if (MAYBE_CLASS_TYPE_P (context)) tmpl = lookup_field (context, name, 0, false); if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl)) *************** make_unbound_class_template (tree contex *** 3089,3095 **** } /* Build the UNBOUND_CLASS_TEMPLATE. */ ! t = make_aggr_type (UNBOUND_CLASS_TEMPLATE); TYPE_CONTEXT (t) = FROB_CONTEXT (context); TREE_TYPE (t) = NULL_TREE; SET_TYPE_STRUCTURAL_EQUALITY (t); --- 3109,3115 ---- } /* Build the UNBOUND_CLASS_TEMPLATE. */ ! t = cxx_make_type (UNBOUND_CLASS_TEMPLATE); TYPE_CONTEXT (t) = FROB_CONTEXT (context); TREE_TYPE (t) = NULL_TREE; SET_TYPE_STRUCTURAL_EQUALITY (t); *************** record_builtin_java_type (const char* na *** 3163,3172 **** { tree type, decl; if (size > 0) ! type = make_signed_type (size); else if (size > -32) ! { /* "__java_char" or ""__java_boolean". */ ! type = make_unsigned_type (-size); /*if (size == -1) TREE_SET_CODE (type, BOOLEAN_TYPE);*/ } else --- 3183,3200 ---- { tree type, decl; if (size > 0) ! type = build_nonstandard_integer_type (size, 0); else if (size > -32) ! { ! tree stype; ! /* "__java_char" or ""__java_boolean". */ ! type = build_nonstandard_integer_type (-size, 1); ! /* Get the signed type cached and attached to the unsigned type, ! so it doesn't get garbage-collected at "random" times, ! causing potential codegen differences out of different UIDs ! and different alias set numbers. */ ! stype = build_nonstandard_integer_type (-size, 0); ! TREE_CHAIN (type) = stype; /*if (size == -1) TREE_SET_CODE (type, BOOLEAN_TYPE);*/ } else *************** record_unknown_type (tree type, const ch *** 3199,3205 **** TYPE_SIZE (type) = TYPE_SIZE (void_type_node); TYPE_ALIGN (type) = 1; TYPE_USER_ALIGN (type) = 0; ! TYPE_MODE (type) = TYPE_MODE (void_type_node); } /* A string for which we should create an IDENTIFIER_NODE at --- 3227,3233 ---- TYPE_SIZE (type) = TYPE_SIZE (void_type_node); TYPE_ALIGN (type) = 1; TYPE_USER_ALIGN (type) = 0; ! SET_TYPE_MODE (type, TYPE_MODE (void_type_node)); } /* A string for which we should create an IDENTIFIER_NODE at *************** cxx_init_decl_processing (void) *** 3347,3352 **** --- 3375,3383 ---- TYPE_POINTER_TO (unknown_type_node) = unknown_type_node; TYPE_REFERENCE_TO (unknown_type_node) = unknown_type_node; + init_list_type_node = make_node (UNKNOWN_TYPE); + record_unknown_type (init_list_type_node, "init list"); + { /* Make sure we get a unique function type, so we can give its pointer type a name. (This wins for gdb.) */ *************** cxx_init_decl_processing (void) *** 3387,3393 **** push_namespace (std_identifier); bad_alloc_id = get_identifier ("bad_alloc"); ! bad_alloc_type_node = make_aggr_type (RECORD_TYPE); TYPE_CONTEXT (bad_alloc_type_node) = current_namespace; bad_alloc_decl = create_implicit_typedef (bad_alloc_id, bad_alloc_type_node); --- 3418,3424 ---- push_namespace (std_identifier); bad_alloc_id = get_identifier ("bad_alloc"); ! bad_alloc_type_node = make_class_type (RECORD_TYPE); TYPE_CONTEXT (bad_alloc_type_node) = current_namespace; bad_alloc_decl = create_implicit_typedef (bad_alloc_id, bad_alloc_type_node); *************** cp_make_fname_decl (tree id, int type_de *** 3507,3513 **** } static tree ! builtin_function_1 (tree decl, tree context) { tree id = DECL_NAME (decl); const char *name = IDENTIFIER_POINTER (id); --- 3538,3544 ---- } static tree ! builtin_function_1 (tree decl, tree context, bool is_global) { tree id = DECL_NAME (decl); const char *name = IDENTIFIER_POINTER (id); *************** builtin_function_1 (tree decl, tree cont *** 3528,3534 **** DECL_CONTEXT (decl) = context; ! pushdecl (decl); /* A function in the user's namespace should have an explicit declaration before it is used. Mark the built-in function as --- 3559,3568 ---- DECL_CONTEXT (decl) = context; ! if (is_global) ! pushdecl_top_level (decl); ! else ! pushdecl (decl); /* A function in the user's namespace should have an explicit declaration before it is used. Mark the built-in function as *************** cxx_builtin_function (tree decl) *** 3561,3571 **** { tree decl2 = copy_node(decl); push_namespace (std_identifier); ! builtin_function_1 (decl2, std_node); pop_namespace (); } ! return builtin_function_1 (decl, NULL_TREE); } /* Generate a FUNCTION_DECL with the typical flags for a runtime library --- 3595,3630 ---- { tree decl2 = copy_node(decl); push_namespace (std_identifier); ! builtin_function_1 (decl2, std_node, false); pop_namespace (); } ! return builtin_function_1 (decl, NULL_TREE, false); ! } ! ! /* Like cxx_builtin_function, but guarantee the function is added to the global ! scope. This is to allow function specific options to add new machine ! dependent builtins when the target ISA changes via attribute((target(...))) ! which saves space on program startup if the program does not use non-generic ! ISAs. */ ! ! tree ! cxx_builtin_function_ext_scope (tree decl) ! { ! ! tree id = DECL_NAME (decl); ! const char *name = IDENTIFIER_POINTER (id); ! /* All builtins that don't begin with an '_' should additionally ! go in the 'std' namespace. */ ! if (name[0] != '_') ! { ! tree decl2 = copy_node(decl); ! push_namespace (std_identifier); ! builtin_function_1 (decl2, std_node, true); ! pop_namespace (); ! } ! ! return builtin_function_1 (decl, NULL_TREE, true); } /* Generate a FUNCTION_DECL with the typical flags for a runtime library *************** build_library_fn_1 (tree name, enum tree *** 3591,3597 **** We assume that such functions never throw; if this is incorrect, callers should unset TREE_NOTHROW. */ ! tree build_library_fn (tree name, tree type) { tree fn = build_library_fn_1 (name, ERROR_MARK, type); --- 3650,3656 ---- We assume that such functions never throw; if this is incorrect, callers should unset TREE_NOTHROW. */ ! static tree build_library_fn (tree name, tree type) { tree fn = build_library_fn_1 (name, ERROR_MARK, type); *************** build_cp_library_fn_ptr (const char* nam *** 3630,3641 **** } /* Like build_library_fn, but also pushes the function so that we will ! be able to find it via IDENTIFIER_GLOBAL_VALUE. */ tree ! push_library_fn (tree name, tree type) { ! tree fn = build_library_fn (name, type); pushdecl_top_level (fn); return fn; } --- 3689,3706 ---- } /* Like build_library_fn, but also pushes the function so that we will ! be able to find it via IDENTIFIER_GLOBAL_VALUE. Also, the function ! may throw exceptions listed in RAISES. */ tree ! push_library_fn (tree name, tree type, tree raises) { ! tree fn; ! ! if (raises) ! type = build_exception_variant (type, raises); ! ! fn = build_library_fn (name, type); pushdecl_top_level (fn); return fn; } *************** tree *** 3660,3666 **** push_void_library_fn (tree name, tree parmtypes) { tree type = build_function_type (void_type_node, parmtypes); ! return push_library_fn (name, type); } /* Like push_library_fn, but also note that this function throws --- 3725,3731 ---- push_void_library_fn (tree name, tree parmtypes) { tree type = build_function_type (void_type_node, parmtypes); ! return push_library_fn (name, type, NULL_TREE); } /* Like push_library_fn, but also note that this function throws *************** push_void_library_fn (tree name, tree pa *** 3669,3675 **** tree push_throw_library_fn (tree name, tree type) { ! tree fn = push_library_fn (name, type); TREE_THIS_VOLATILE (fn) = 1; TREE_NOTHROW (fn) = 0; return fn; --- 3734,3740 ---- tree push_throw_library_fn (tree name, tree type) { ! tree fn = push_library_fn (name, type, NULL_TREE); TREE_THIS_VOLATILE (fn) = 1; TREE_NOTHROW (fn) = 0; return fn; *************** check_tag_decl (cp_decl_specifier_seq *d *** 3770,3792 **** else if (declspecs->redefined_builtin_type) { if (!in_system_header) ! pedwarn ("redeclaration of C++ built-in type %qT", ! declspecs->redefined_builtin_type); return NULL_TREE; } if (declspecs->type && TYPE_P (declspecs->type) && ((TREE_CODE (declspecs->type) != TYPENAME_TYPE ! && IS_AGGR_TYPE (declspecs->type)) || TREE_CODE (declspecs->type) == ENUMERAL_TYPE)) declared_type = declspecs->type; else if (declspecs->type == error_mark_node) error_p = true; if (declared_type == NULL_TREE && ! saw_friend && !error_p) ! pedwarn ("declaration does not declare anything"); /* Check for an anonymous union. */ ! else if (declared_type && IS_AGGR_TYPE_CODE (TREE_CODE (declared_type)) && TYPE_ANONYMOUS_P (declared_type)) { /* 7/3 In a simple-declaration, the optional init-declarator-list --- 3835,3857 ---- else if (declspecs->redefined_builtin_type) { if (!in_system_header) ! permerror (input_location, "redeclaration of C++ built-in type %qT", ! declspecs->redefined_builtin_type); return NULL_TREE; } if (declspecs->type && TYPE_P (declspecs->type) && ((TREE_CODE (declspecs->type) != TYPENAME_TYPE ! && MAYBE_CLASS_TYPE_P (declspecs->type)) || TREE_CODE (declspecs->type) == ENUMERAL_TYPE)) declared_type = declspecs->type; else if (declspecs->type == error_mark_node) error_p = true; if (declared_type == NULL_TREE && ! saw_friend && !error_p) ! permerror (input_location, "declaration does not declare anything"); /* Check for an anonymous union. */ ! else if (declared_type && RECORD_OR_UNION_CODE_P (TREE_CODE (declared_type)) && TYPE_ANONYMOUS_P (declared_type)) { /* 7/3 In a simple-declaration, the optional init-declarator-list *************** check_tag_decl (cp_decl_specifier_seq *d *** 3813,3821 **** /* Anonymous unions are objects, so they can have specifiers. */; SET_ANON_AGGR_TYPE_P (declared_type); ! if (TREE_CODE (declared_type) != UNION_TYPE && pedantic ! && !in_system_header) ! pedwarn ("ISO C++ prohibits anonymous structs"); } else --- 3878,3885 ---- /* Anonymous unions are objects, so they can have specifiers. */; SET_ANON_AGGR_TYPE_P (declared_type); ! if (TREE_CODE (declared_type) != UNION_TYPE && !in_system_header) ! pedwarn (input_location, OPT_pedantic, "ISO C++ prohibits anonymous structs"); } else *************** shadow_tag (cp_decl_specifier_seq *decls *** 3903,3921 **** tree groktypename (cp_decl_specifier_seq *type_specifiers, ! const cp_declarator *declarator) { tree attrs; tree type; attrs = type_specifiers->attributes; type_specifiers->attributes = NULL_TREE; ! type = grokdeclarator (declarator, type_specifiers, TYPENAME, 0, &attrs); if (attrs && type != error_mark_node) { if (CLASS_TYPE_P (type)) warning (OPT_Wattributes, "ignoring attributes applied to class type %qT " "outside of definition", type); ! else if (IS_AGGR_TYPE (type)) /* A template type parameter or other dependent type. */ warning (OPT_Wattributes, "ignoring attributes applied to dependent " "type %qT without an associated declaration", type); --- 3967,3988 ---- tree groktypename (cp_decl_specifier_seq *type_specifiers, ! const cp_declarator *declarator, ! bool is_template_arg) { tree attrs; tree type; + enum decl_context context + = is_template_arg ? TEMPLATE_TYPE_ARG : TYPENAME; attrs = type_specifiers->attributes; type_specifiers->attributes = NULL_TREE; ! type = grokdeclarator (declarator, type_specifiers, context, 0, &attrs); if (attrs && type != error_mark_node) { if (CLASS_TYPE_P (type)) warning (OPT_Wattributes, "ignoring attributes applied to class type %qT " "outside of definition", type); ! else if (MAYBE_CLASS_TYPE_P (type)) /* A template type parameter or other dependent type. */ warning (OPT_Wattributes, "ignoring attributes applied to dependent " "type %qT without an associated declaration", type); *************** groktypename (cp_decl_specifier_seq *typ *** 3932,3944 **** grokfield.) The DECL corresponding to the DECLARATOR is returned. If an error occurs, the error_mark_node is returned instead. ! DECLSPECS are the decl-specifiers for the declaration. INITIALIZED ! is true if an explicit initializer is present, but false if this is ! a variable implicitly initialized via a default constructor. ! ATTRIBUTES and PREFIX_ATTRIBUTES are GNU attributes associated with ! this declaration. *PUSHED_SCOPE_P is set to the scope entered in ! this function, if any; if set, the caller is responsible for ! calling pop_scope. */ tree start_decl (const cp_declarator *declarator, --- 3999,4012 ---- grokfield.) The DECL corresponding to the DECLARATOR is returned. If an error occurs, the error_mark_node is returned instead. ! DECLSPECS are the decl-specifiers for the declaration. INITIALIZED is ! SD_INITIALIZED if an explicit initializer is present, or SD_DEFAULTED ! for an explicitly defaulted function, or SD_DELETED for an explicitly ! deleted function, but 0 (SD_UNINITIALIZED) if this is a variable ! implicitly initialized via a default constructor. ATTRIBUTES and ! PREFIX_ATTRIBUTES are GNU attributes associated with this declaration. ! *PUSHED_SCOPE_P is set to the scope entered in this function, if any; if ! set, the caller is responsible for calling pop_scope. */ tree start_decl (const cp_declarator *declarator, *************** start_decl (const cp_declarator *declara *** 3952,3957 **** --- 4020,4026 ---- tree type; tree context; bool was_public; + int flags; *pushed_scope_p = NULL_TREE; *************** start_decl (const cp_declarator *declara *** 3991,4002 **** switch (TREE_CODE (decl)) { case TYPE_DECL: ! error ("typedef %qD is initialized (use __typeof__ instead)", decl); return error_mark_node; case FUNCTION_DECL: ! error ("function %q#D is initialized like a variable", decl); ! return error_mark_node; default: break; --- 4060,4074 ---- switch (TREE_CODE (decl)) { case TYPE_DECL: ! error ("typedef %qD is initialized (use decltype instead)", decl); return error_mark_node; case FUNCTION_DECL: ! if (initialized == SD_DELETED) ! /* We'll handle the rest of the semantics later, but we need to ! set this now so it's visible to duplicate_decls. */ ! DECL_DELETED_FN (decl) = 1; ! break; default: break; *************** start_decl (const cp_declarator *declara *** 4013,4020 **** TREE_STATIC (decl) = 1; } /* Set attributes here so if duplicate decl, will have proper attributes. */ ! cplus_decl_attributes (&decl, attributes, 0); /* Dllimported symbols cannot be defined. Static data members (which can be initialized in-class and dllimported) go through grokfield, --- 4085,4101 ---- TREE_STATIC (decl) = 1; } + /* If this is a typedef that names the class for linkage purposes + (7.1.3p8), apply any attributes directly to the type. */ + if (TREE_CODE (decl) == TYPE_DECL + && TAGGED_TYPE_P (TREE_TYPE (decl)) + && decl == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (decl)))) + flags = ATTR_FLAG_TYPE_IN_PLACE; + else + flags = 0; + /* Set attributes here so if duplicate decl, will have proper attributes. */ ! cplus_decl_attributes (&decl, attributes, flags); /* Dllimported symbols cannot be defined. Static data members (which can be initialized in-class and dllimported) go through grokfield, *************** start_decl (const cp_declarator *declara *** 4047,4056 **** if (DECL_CONTEXT (field) != context) { if (!same_type_p (DECL_CONTEXT (field), context)) ! pedwarn ("ISO C++ does not permit %<%T::%D%> " ! "to be defined as %<%T::%D%>", ! DECL_CONTEXT (field), DECL_NAME (decl), ! context, DECL_NAME (decl)); DECL_CONTEXT (decl) = DECL_CONTEXT (field); } if (processing_specialization --- 4128,4137 ---- if (DECL_CONTEXT (field) != context) { if (!same_type_p (DECL_CONTEXT (field), context)) ! permerror (input_location, "ISO C++ does not permit %<%T::%D%> " ! "to be defined as %<%T::%D%>", ! DECL_CONTEXT (field), DECL_NAME (decl), ! context, DECL_NAME (decl)); DECL_CONTEXT (decl) = DECL_CONTEXT (field); } if (processing_specialization *************** start_decl (const cp_declarator *declara *** 4103,4110 **** } if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl)) ! pedwarn ("declaration of %q#D outside of class is not definition", ! decl); } was_public = TREE_PUBLIC (decl); --- 4184,4191 ---- } if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl)) ! permerror (input_location, "declaration of %q#D outside of class is not definition", ! decl); } was_public = TREE_PUBLIC (decl); *************** start_decl_1 (tree decl, bool initialize *** 4169,4175 **** type = TREE_TYPE (decl); complete_p = COMPLETE_TYPE_P (type); ! aggregate_definition_p = IS_AGGR_TYPE (type) && !DECL_EXTERNAL (decl); /* If an explicit initializer is present, or if this is a definition of an aggregate, then we need a complete type at this point. --- 4250,4256 ---- type = TREE_TYPE (decl); complete_p = COMPLETE_TYPE_P (type); ! aggregate_definition_p = MAYBE_CLASS_TYPE_P (type) && !DECL_EXTERNAL (decl); /* If an explicit initializer is present, or if this is a definition of an aggregate, then we need a complete type at this point. *************** start_decl_1 (tree decl, bool initialize *** 4194,4199 **** --- 4275,4282 ---- arrays which might be completed by the initialization. */ if (complete_p) ; /* A complete type is ok. */ + else if (type_uses_auto (type)) + ; /* An auto type is ok. */ else if (TREE_CODE (type) != ARRAY_TYPE) { error ("variable %q#D has initializer but incomplete type", decl); *************** start_decl_1 (tree decl, bool initialize *** 4208,4215 **** } else if (aggregate_definition_p && !complete_p) { ! error ("aggregate %q#D has incomplete type and cannot be defined", ! decl); /* Change the type so that assemble_variable will give DECL an rtl we can live with: (mem (const_int 0)). */ type = TREE_TYPE (decl) = error_mark_node; --- 4291,4301 ---- } else if (aggregate_definition_p && !complete_p) { ! if (type_uses_auto (type)) ! error ("declaration of %q#D has no initializer", decl); ! else ! error ("aggregate %q#D has incomplete type and cannot be defined", ! decl); /* Change the type so that assemble_variable will give DECL an rtl we can live with: (mem (const_int 0)). */ type = TREE_TYPE (decl) = error_mark_node; *************** grok_reference_init (tree decl, tree typ *** 4288,4293 **** --- 4374,4412 ---- return NULL_TREE; } + /* Subroutine of check_initializer. We're initializing a DECL of + std::initializer_list TYPE from a braced-init-list INIT, and need to + extend the lifetime of the underlying array to match that of the decl, + just like for reference initialization. CLEANUP is as for + grok_reference_init. */ + + static tree + build_init_list_var_init (tree decl, tree type, tree init, tree *cleanup) + { + tree aggr_init, array, arrtype; + init = perform_implicit_conversion (type, init, tf_warning_or_error); + aggr_init = TARGET_EXPR_INITIAL (init); + init = build2 (INIT_EXPR, type, decl, init); + + array = AGGR_INIT_EXPR_ARG (aggr_init, 1); + arrtype = TREE_TYPE (array); + STRIP_NOPS (array); + gcc_assert (TREE_CODE (array) == ADDR_EXPR); + array = TREE_OPERAND (array, 0); + /* If the array is constant, finish_compound_literal already made it a + static variable and we don't need to do anything here. */ + if (decl && TREE_CODE (array) == TARGET_EXPR) + { + tree subinit; + tree var = set_up_extended_ref_temp (decl, array, cleanup, &subinit); + var = build_address (var); + var = convert (arrtype, var); + AGGR_INIT_EXPR_ARG (aggr_init, 1) = var; + init = build2 (COMPOUND_EXPR, TREE_TYPE (init), subinit, init); + } + return init; + } + /* Designated initializers in arrays are not supported in GNU C++. The parser cannot detect this error since it does not know whether a given brace-enclosed initializer is for a class type or for an *************** check_array_designated_initializer (cons *** 4302,4311 **** if (ce->index) { /* The parser only allows identifiers as designated ! intializers. */ ! gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE); ! error ("name %qD used in a GNU-style designated " ! "initializer for an array", ce->index); return false; } --- 4421,4436 ---- if (ce->index) { /* The parser only allows identifiers as designated ! initializers. */ ! if (ce->index == error_mark_node) ! error ("name used in a GNU-style designated " ! "initializer for an array"); ! else ! { ! gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE); ! error ("name %qD used in a GNU-style designated " ! "initializer for an array", ce->index); ! } return false; } *************** layout_var_decl (tree decl) *** 4422,4428 **** /* Keep this code around in case we later want to control debug info based on whether a type is "used". (jason 1999-11-11) */ ! else if (!DECL_EXTERNAL (decl) && IS_AGGR_TYPE (ttype)) /* Let debugger know it should output info for this type. */ note_debug_info_needed (ttype); --- 4547,4553 ---- /* Keep this code around in case we later want to control debug info based on whether a type is "used". (jason 1999-11-11) */ ! else if (!DECL_EXTERNAL (decl) && MAYBE_CLASS_TYPE_P (ttype)) /* Let debugger know it should output info for this type. */ note_debug_info_needed (ttype); *************** layout_var_decl (tree decl) *** 4448,4454 **** we have a weak definition, we must endeavor to create only one instance of the variable at link-time. */ ! static void maybe_commonize_var (tree decl) { /* Static data in a function with comdat linkage also has comdat --- 4573,4579 ---- we have a weak definition, we must endeavor to create only one instance of the variable at link-time. */ ! void maybe_commonize_var (tree decl) { /* Static data in a function with comdat linkage also has comdat *************** reshape_init_array_1 (tree elt_type, tre *** 4566,4572 **** unsigned HOST_WIDE_INT index; /* The initializer for an array is always a CONSTRUCTOR. */ ! new_init = build_constructor (NULL_TREE, NULL); if (sized_array_p) { --- 4691,4697 ---- unsigned HOST_WIDE_INT index; /* The initializer for an array is always a CONSTRUCTOR. */ ! new_init = build_constructor (init_list_type_node, NULL); if (sized_array_p) { *************** reshape_init_class (tree type, reshape_i *** 4661,4667 **** gcc_assert (CLASS_TYPE_P (type)); /* The initializer for a class is always a CONSTRUCTOR. */ ! new_init = build_constructor (NULL_TREE, NULL); field = next_initializable_field (TYPE_FIELDS (type)); if (!field) --- 4786,4792 ---- gcc_assert (CLASS_TYPE_P (type)); /* The initializer for a class is always a CONSTRUCTOR. */ ! new_init = build_constructor (init_list_type_node, NULL); field = next_initializable_field (TYPE_FIELDS (type)); if (!field) *************** reshape_init_r (tree type, reshape_iter *** 4730,4749 **** { tree init = d->cur->value; /* A non-aggregate type is always initialized with a single initializer. */ if (!CP_AGGREGATE_TYPE_P (type)) { /* It is invalid to initialize a non-aggregate type with a ! brace-enclosed initializer. We need to check for BRACE_ENCLOSED_INITIALIZER_P here because of g++.old-deja/g++.mike/p7626.C: a pointer-to-member constant is a CONSTRUCTOR (with a record type). */ if (TREE_CODE (init) == CONSTRUCTOR && BRACE_ENCLOSED_INITIALIZER_P (init)) /* p7626.C */ { ! error ("braces around scalar initializer for type %qT", type); ! init = error_mark_node; } d->cur++; --- 4855,4882 ---- { tree init = d->cur->value; + if (error_operand_p (init)) + return error_mark_node; + /* A non-aggregate type is always initialized with a single initializer. */ if (!CP_AGGREGATE_TYPE_P (type)) { /* It is invalid to initialize a non-aggregate type with a ! brace-enclosed initializer before C++0x. We need to check for BRACE_ENCLOSED_INITIALIZER_P here because of g++.old-deja/g++.mike/p7626.C: a pointer-to-member constant is a CONSTRUCTOR (with a record type). */ if (TREE_CODE (init) == CONSTRUCTOR && BRACE_ENCLOSED_INITIALIZER_P (init)) /* p7626.C */ { ! if (SCALAR_TYPE_P (type)) ! { ! error ("braces around scalar initializer for type %qT", type); ! init = error_mark_node; ! } ! else ! maybe_warn_cpp0x ("extended initializer lists"); } d->cur++; *************** check_array_initializer (tree decl, tree *** 4919,4924 **** --- 5052,5077 ---- return false; } + /* Subroutine of check_initializer; args are passed down from that function. + Set stmts_are_full_exprs_p to 1 across a call to build_aggr_init. */ + + static tree + build_aggr_init_full_exprs (tree decl, tree init, int flags) + + { + int saved_stmts_are_full_exprs_p = 0; + if (building_stmt_tree ()) + { + saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p (); + current_stmt_tree ()->stmts_are_full_exprs_p = 1; + } + init = build_aggr_init (decl, init, flags, tf_warning_or_error); + if (building_stmt_tree ()) + current_stmt_tree ()->stmts_are_full_exprs_p = + saved_stmts_are_full_exprs_p; + return init; + } + /* Verify INIT (the initializer for DECL), and record the initialization in DECL_INITIAL, if appropriate. CLEANUP is as for grok_reference_init. *************** check_initializer (tree decl, tree init, *** 4960,4966 **** int init_len = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)); if (SCALAR_TYPE_P (type)) { ! if (init_len != 1) { error ("scalar object %qD requires one element in initializer", decl); --- 5113,5124 ---- int init_len = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)); if (SCALAR_TYPE_P (type)) { ! if (init_len == 0) ! { ! maybe_warn_cpp0x ("extended initializer lists"); ! init = build_zero_init (type, NULL_TREE, false); ! } ! else if (init_len != 1) { error ("scalar object %qD requires one element in initializer", decl); *************** check_initializer (tree decl, tree init, *** 4968,4982 **** return NULL_TREE; } } - else if ((cxx_dialect == cxx98) && !CP_AGGREGATE_TYPE_P (type)) - { - /* A non-aggregate that is not a scalar cannot be initialized - via an initializer-list in C++98. */ - error ("braces around initializer for non-aggregate type %qT", - type); - TREE_TYPE (decl) = error_mark_node; - return NULL_TREE; - } } if (TREE_CODE (decl) == CONST_DECL) --- 5126,5131 ---- *************** check_initializer (tree decl, tree init, *** 4994,5010 **** { /* Do not reshape constructors of vectors (they don't need to be reshaped. */ ! if (TREE_CODE (init) == CONSTRUCTOR ! && !COMPOUND_LITERAL_P (init) ! && !TREE_TYPE (init)) /* ptrmemfunc */ { ! init = reshape_init (type, init); ! ! if ((*targetm.vector_opaque_p) (type)) { error ("opaque vector types cannot be initialized"); init = error_mark_node; } } /* If DECL has an array type without a specific bound, deduce the --- 5143,5168 ---- { /* Do not reshape constructors of vectors (they don't need to be reshaped. */ ! if (BRACE_ENCLOSED_INITIALIZER_P (init)) { ! if (is_std_init_list (type)) ! return build_init_list_var_init (decl, type, init, cleanup); ! else if (TYPE_NON_AGGREGATE_CLASS (type)) ! { ! /* Don't reshape if the class has constructors. */ ! if (cxx_dialect == cxx98) ! error ("in C++98 %qD must be initialized by constructor, " ! "not by %<{...}%>", ! decl); ! init = build_tree_list (NULL_TREE, init); ! } ! else if ((*targetm.vector_opaque_p) (type)) { error ("opaque vector types cannot be initialized"); init = error_mark_node; } + else + init = reshape_init (type, init); } /* If DECL has an array type without a specific bound, deduce the *************** check_initializer (tree decl, tree init, *** 5014,5074 **** if (type == error_mark_node) return NULL_TREE; ! if (TREE_CODE (type) == ARRAY_TYPE && TYPE_NEEDS_CONSTRUCTING (type)) ! goto initialize_aggr; ! else if (CLASS_TYPE_P (type)) ! { ! if (TREE_CODE (init) == CONSTRUCTOR) ! { ! if (TYPE_NON_AGGREGATE_CLASS (type)) ! { ! error ("%qD must be initialized by constructor, " ! "not by %<{...}%>", ! decl); ! init = error_mark_node; ! } ! else ! goto dont_use_constructor; ! } ! else ! { ! int saved_stmts_are_full_exprs_p; ! ! initialize_aggr: ! saved_stmts_are_full_exprs_p = 0; ! if (building_stmt_tree ()) ! { ! saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p (); ! current_stmt_tree ()->stmts_are_full_exprs_p = 1; ! } ! init = build_aggr_init (decl, init, flags); ! if (building_stmt_tree ()) ! current_stmt_tree ()->stmts_are_full_exprs_p = ! saved_stmts_are_full_exprs_p; ! return init; ! } ! } ! else { ! dont_use_constructor: ! if (TREE_CODE (init) != TREE_VEC) ! { ! init_code = store_init_value (decl, init); ! if (pedantic && TREE_CODE (type) == ARRAY_TYPE ! && DECL_INITIAL (decl) ! && TREE_CODE (DECL_INITIAL (decl)) == STRING_CST ! && PAREN_STRING_LITERAL_P (DECL_INITIAL (decl))) ! warning (0, "array %qD initialized by parenthesized string literal %qE", ! decl, DECL_INITIAL (decl)); ! init = NULL; ! } } } else if (DECL_EXTERNAL (decl)) ; else if (TYPE_P (type) && TYPE_NEEDS_CONSTRUCTING (type)) ! goto initialize_aggr; ! else if (IS_AGGR_TYPE (type)) { tree core_type = strip_array_types (type); --- 5172,5198 ---- if (type == error_mark_node) return NULL_TREE; ! if (TYPE_NEEDS_CONSTRUCTING (type) ! || (CLASS_TYPE_P (type) ! && !BRACE_ENCLOSED_INITIALIZER_P (init))) ! return build_aggr_init_full_exprs (decl, init, flags); ! else if (TREE_CODE (init) != TREE_VEC) { ! init_code = store_init_value (decl, init); ! if (pedantic && TREE_CODE (type) == ARRAY_TYPE ! && DECL_INITIAL (decl) ! && TREE_CODE (DECL_INITIAL (decl)) == STRING_CST ! && PAREN_STRING_LITERAL_P (DECL_INITIAL (decl))) ! warning (0, "array %qD initialized by parenthesized string literal %qE", ! decl, DECL_INITIAL (decl)); ! init = NULL; } } else if (DECL_EXTERNAL (decl)) ; else if (TYPE_P (type) && TYPE_NEEDS_CONSTRUCTING (type)) ! return build_aggr_init_full_exprs (decl, init, flags); ! else if (MAYBE_CLASS_TYPE_P (type)) { tree core_type = strip_array_types (type); *************** initialize_artificial_var (tree decl, tr *** 5304,5310 **** { gcc_assert (DECL_ARTIFICIAL (decl)); if (TREE_CODE (init) == TREE_LIST) ! init = build_constructor_from_list (NULL_TREE, init); gcc_assert (TREE_CODE (init) == CONSTRUCTOR); DECL_INITIAL (decl) = init; DECL_INITIALIZED_P (decl) = 1; --- 5428,5434 ---- { gcc_assert (DECL_ARTIFICIAL (decl)); if (TREE_CODE (init) == TREE_LIST) ! init = build_constructor_from_list (TREE_TYPE (decl), init); gcc_assert (TREE_CODE (init) == CONSTRUCTOR); DECL_INITIAL (decl) = init; DECL_INITIALIZED_P (decl) = 1; *************** cp_finish_decl (tree decl, tree init, bo *** 5365,5370 **** --- 5489,5495 ---- int was_readonly = 0; bool var_definition_p = false; int saved_processing_template_decl; + tree auto_node; if (decl == error_mark_node) return; *************** cp_finish_decl (tree decl, tree init, bo *** 5399,5404 **** --- 5524,5568 ---- && (DECL_INITIAL (decl) || init)) DECL_INITIALIZED_IN_CLASS_P (decl) = 1; + auto_node = type_uses_auto (type); + if (auto_node) + { + if (init == NULL_TREE) + { + error ("declaration of %q#D has no initializer", decl); + TREE_TYPE (decl) = error_mark_node; + return; + } + else if (describable_type (init)) + { + type = TREE_TYPE (decl) = do_auto_deduction (type, init, auto_node); + if (type == error_mark_node) + return; + } + } + + if (init && TREE_CODE (decl) == FUNCTION_DECL) + { + if (init == ridpointers[(int)RID_DELETE]) + { + /* FIXME check this is 1st decl. */ + DECL_DELETED_FN (decl) = 1; + DECL_DECLARED_INLINE_P (decl) = 1; + DECL_INITIAL (decl) = error_mark_node; + init = NULL_TREE; + } + else if (init == ridpointers[(int)RID_DEFAULT]) + { + if (!defaultable_fn_p (decl)) + { + error ("%qD cannot be defaulted", decl); + DECL_INITIAL (decl) = NULL_TREE; + } + else + DECL_DEFAULTED_FN (decl) = 1; + } + } + if (processing_template_decl) { bool type_dependent_p; *************** cp_finish_decl (tree decl, tree init, bo *** 5464,5470 **** if (TREE_CODE (decl) == TYPE_DECL) { if (type != error_mark_node ! && IS_AGGR_TYPE (type) && DECL_NAME (decl)) { if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type) warning (0, "shadowing previous type declaration of %q#D", decl); --- 5628,5634 ---- if (TREE_CODE (decl) == TYPE_DECL) { if (type != error_mark_node ! && MAYBE_CLASS_TYPE_P (type) && DECL_NAME (decl)) { if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type) warning (0, "shadowing previous type declaration of %q#D", decl); *************** cp_finish_decl (tree decl, tree init, bo *** 5518,5524 **** is *not* defined. */ && (!DECL_EXTERNAL (decl) || init)) { ! if (TYPE_FOR_JAVA (type) && IS_AGGR_TYPE (type)) { tree jclass = IDENTIFIER_GLOBAL_VALUE (get_identifier ("jclass")); --- 5682,5688 ---- is *not* defined. */ && (!DECL_EXTERNAL (decl) || init)) { ! if (TYPE_FOR_JAVA (type) && MAYBE_CLASS_TYPE_P (type)) { tree jclass = IDENTIFIER_GLOBAL_VALUE (get_identifier ("jclass")); *************** cp_finish_decl (tree decl, tree init, bo *** 5603,5609 **** layout_type (type); } else if (TREE_CODE (decl) == FIELD_DECL ! && TYPE_FOR_JAVA (type) && IS_AGGR_TYPE (type)) error ("non-static data member %qD has Java class type", decl); /* Add this declaration to the statement-tree. This needs to happen --- 5767,5773 ---- layout_type (type); } else if (TREE_CODE (decl) == FIELD_DECL ! && TYPE_FOR_JAVA (type) && MAYBE_CLASS_TYPE_P (type)) error ("non-static data member %qD has Java class type", decl); /* Add this declaration to the statement-tree. This needs to happen *************** cp_finish_decl (tree decl, tree init, bo *** 5653,5662 **** else abstract_virtuals_error (decl, type); ! if (TREE_CODE (decl) == FUNCTION_DECL ! || TREE_TYPE (decl) == error_mark_node) /* No initialization required. */ ; else if (DECL_EXTERNAL (decl) && ! (DECL_LANG_SPECIFIC (decl) && DECL_NOT_REALLY_EXTERN (decl))) --- 5817,5841 ---- else abstract_virtuals_error (decl, type); ! if (TREE_TYPE (decl) == error_mark_node) /* No initialization required. */ ; + else if (TREE_CODE (decl) == FUNCTION_DECL) + { + if (init) + { + if (init == ridpointers[(int)RID_DEFAULT]) + { + /* An out-of-class default definition is defined at + the point where it is explicitly defaulted. */ + if (DECL_INITIAL (decl) == error_mark_node) + synthesize_method (decl); + } + else + error ("function %q#D is initialized like a variable", decl); + } + /* else no initialization required. */ + } else if (DECL_EXTERNAL (decl) && ! (DECL_LANG_SPECIFIC (decl) && DECL_NOT_REALLY_EXTERN (decl))) *************** start_cleanup_fn (void) *** 5882,5888 **** actually needed. It is unlikely that it will be inlined, since it is only called via a function pointer, but we avoid unnecessary emissions this way. */ - DECL_INLINE (fndecl) = 1; DECL_DECLARED_INLINE_P (fndecl) = 1; DECL_INTERFACE_KNOWN (fndecl) = 1; /* Build the parameter. */ --- 6061,6066 ---- *************** register_dtor_fn (tree decl) *** 5992,5998 **** addr = build_address (decl); /* The declared type of the parameter to "__cxa_atexit" is "void *". For plain "T*", we could just let the ! machinery in build_function_call convert it -- but if the type is "cv-qualified T *", then we need to convert it before passing it in, to avoid spurious errors. */ addr = build_nop (ptr_type_node, addr); --- 6170,6176 ---- addr = build_address (decl); /* The declared type of the parameter to "__cxa_atexit" is "void *". For plain "T*", we could just let the ! machinery in cp_build_function_call convert it -- but if the type is "cv-qualified T *", then we need to convert it before passing it in, to avoid spurious errors. */ addr = build_nop (ptr_type_node, addr); *************** register_dtor_fn (tree decl) *** 6004,6010 **** other value. */ addr = null_pointer_node; args = tree_cons (NULL_TREE, ! build_unary_op (ADDR_EXPR, get_dso_handle_node (), 0), NULL_TREE); if (targetm.cxx.use_aeabi_atexit ()) { --- 6182,6189 ---- other value. */ addr = null_pointer_node; args = tree_cons (NULL_TREE, ! cp_build_unary_op (ADDR_EXPR, get_dso_handle_node (), 0, ! tf_warning_or_error), NULL_TREE); if (targetm.cxx.use_aeabi_atexit ()) { *************** register_dtor_fn (tree decl) *** 6019,6025 **** } else args = tree_cons (NULL_TREE, cleanup, NULL_TREE); ! return build_function_call (get_atexit_node (), args); } /* DECL is a VAR_DECL with static storage duration. INIT, if present, --- 6198,6205 ---- } else args = tree_cons (NULL_TREE, cleanup, NULL_TREE); ! return cp_build_function_call (get_atexit_node (), args, ! tf_warning_or_error); } /* DECL is a VAR_DECL with static storage duration. INIT, if present, *************** expand_static_init (tree decl, tree init *** 6105,6113 **** void_list_node); tree vfntype = build_function_type (void_type_node, argtypes); acquire_fn = push_library_fn ! (acquire_fn, build_function_type (integer_type_node, argtypes)); ! release_fn = push_library_fn (release_fn, vfntype); ! abort_fn = push_library_fn (abort_fn, vfntype); } else { --- 6285,6294 ---- void_list_node); tree vfntype = build_function_type (void_type_node, argtypes); acquire_fn = push_library_fn ! (acquire_fn, build_function_type (integer_type_node, argtypes), ! NULL_TREE); ! release_fn = push_library_fn (release_fn, vfntype, NULL_TREE); ! abort_fn = push_library_fn (abort_fn, vfntype, NULL_TREE); } else { *************** check_class_member_definition_namespace *** 6310,6317 **** The definition for a static data member shall appear in a namespace scope enclosing the member's class definition. */ if (!is_ancestor (current_namespace, DECL_CONTEXT (decl))) ! pedwarn ("definition of %qD is not in namespace enclosing %qT", ! decl, DECL_CONTEXT (decl)); } /* Build a PARM_DECL for the "this" parameter. TYPE is the --- 6491,6498 ---- The definition for a static data member shall appear in a namespace scope enclosing the member's class definition. */ if (!is_ancestor (current_namespace, DECL_CONTEXT (decl))) ! permerror (input_location, "definition of %qD is not in namespace enclosing %qT", ! decl, DECL_CONTEXT (decl)); } /* Build a PARM_DECL for the "this" parameter. TYPE is the *************** grokfndecl (tree ctype, *** 6372,6378 **** bool funcdef_flag, int template_count, tree in_namespace, ! tree* attrlist) { tree decl; int staticp = ctype && TREE_CODE (type) == FUNCTION_TYPE; --- 6553,6560 ---- bool funcdef_flag, int template_count, tree in_namespace, ! tree* attrlist, ! location_t location) { tree decl; int staticp = ctype && TREE_CODE (type) == FUNCTION_TYPE; *************** grokfndecl (tree ctype, *** 6382,6387 **** --- 6564,6575 ---- type = build_exception_variant (type, raises); decl = build_lang_decl (FUNCTION_DECL, declarator, type); + + /* If we have an explicit location, use it, otherwise use whatever + build_lang_decl used (probably input_location). */ + if (location != UNKNOWN_LOCATION) + DECL_SOURCE_LOCATION (decl) = location; + if (TREE_CODE (type) == METHOD_TYPE) { tree parm; *************** grokfndecl (tree ctype, *** 6390,6395 **** --- 6578,6585 ---- parms = parm; } DECL_ARGUMENTS (decl) = parms; + for (t = parms; t; t = TREE_CHAIN (t)) + DECL_CONTEXT (t) = decl; /* Propagate volatile out from type to decl. */ if (TYPE_VOLATILE (type)) TREE_THIS_VOLATILE (decl) = 1; *************** grokfndecl (tree ctype, *** 6544,6559 **** /* Allow this; it's pretty common in C. */; else { ! pedwarn ("non-local function %q#D uses anonymous type", decl); if (DECL_ORIGINAL_TYPE (TYPE_NAME (t))) ! pedwarn ("%q+#D does not refer to the unqualified " ! "type, so it is not used for linkage", ! TYPE_NAME (t)); } } else ! pedwarn ("non-local function %q#D uses local type %qT", decl, t); } } --- 6734,6749 ---- /* Allow this; it's pretty common in C. */; else { ! permerror (input_location, "non-local function %q#D uses anonymous type", decl); if (DECL_ORIGINAL_TYPE (TYPE_NAME (t))) ! permerror (input_location, "%q+#D does not refer to the unqualified " ! "type, so it is not used for linkage", ! TYPE_NAME (t)); } } else ! permerror (input_location, "non-local function %q#D uses local type %qT", decl, t); } } *************** grokfndecl (tree ctype, *** 6567,6577 **** /* If the declaration was declared inline, mark it as such. */ if (inlinep) DECL_DECLARED_INLINE_P (decl) = 1; - /* We inline functions that are explicitly declared inline, or, when - the user explicitly asks us to, all functions. */ - if (DECL_DECLARED_INLINE_P (decl) - || (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag)) - DECL_INLINE (decl) = 1; DECL_EXTERNAL (decl) = 1; if (quals && TREE_CODE (type) == FUNCTION_TYPE) --- 6757,6762 ---- *************** grokfndecl (tree ctype, *** 6630,6636 **** newtype = build_function_type (integer_type_node, oldtypeargs); TREE_TYPE (decl) = newtype; } ! check_main_parameter_types (decl); } if (ctype != NULL_TREE --- 6815,6822 ---- newtype = build_function_type (integer_type_node, oldtypeargs); TREE_TYPE (decl) = newtype; } ! if (warn_main) ! check_main_parameter_types (decl); } if (ctype != NULL_TREE *************** build_ptrmemfunc_type (tree type) *** 6868,6880 **** unqualified_variant = build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type)); ! t = make_aggr_type (RECORD_TYPE); xref_basetypes (t, NULL_TREE); /* Let the front end know this is a pointer to member function... */ TYPE_PTRMEMFUNC_FLAG (t) = 1; ! /* ... and not really an aggregate. */ ! SET_IS_AGGR_TYPE (t, 0); field = build_decl (FIELD_DECL, pfn_identifier, type); fields = field; --- 7054,7066 ---- unqualified_variant = build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type)); ! t = make_class_type (RECORD_TYPE); xref_basetypes (t, NULL_TREE); /* Let the front end know this is a pointer to member function... */ TYPE_PTRMEMFUNC_FLAG (t) = 1; ! /* ... and not really a class type. */ ! SET_CLASS_TYPE_P (t, 0); field = build_decl (FIELD_DECL, pfn_identifier, type); fields = field; *************** build_ptrmemfunc_type (tree type) *** 6899,6914 **** TYPE_MAIN_VARIANT (t) = unqualified_variant; TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (unqualified_variant); TYPE_NEXT_VARIANT (unqualified_variant) = t; } /* Cache this pointer-to-member type so that we can find it again later. */ TYPE_SET_PTRMEMFUNC_TYPE (type, t); ! /* Managing canonical types for the RECORD_TYPE behind a ! pointer-to-member function is a nightmare, so use structural ! equality for now. */ ! SET_TYPE_STRUCTURAL_EQUALITY (t); return t; } --- 7085,7101 ---- TYPE_MAIN_VARIANT (t) = unqualified_variant; TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (unqualified_variant); TYPE_NEXT_VARIANT (unqualified_variant) = t; + TREE_TYPE (TYPE_BINFO (t)) = t; } /* Cache this pointer-to-member type so that we can find it again later. */ TYPE_SET_PTRMEMFUNC_TYPE (type, t); ! if (TYPE_STRUCTURAL_EQUALITY_P (type)) ! SET_TYPE_STRUCTURAL_EQUALITY (t); ! else if (TYPE_CANONICAL (type) != type) ! TYPE_CANONICAL (t) = build_ptrmemfunc_type (TYPE_CANONICAL (type)); return t; } *************** check_static_variable_definition (tree d *** 6968,6975 **** error ("ISO C++ forbids in-class initialization of non-const " "static member %qD", decl); ! else if (pedantic && !INTEGRAL_TYPE_P (type)) ! pedwarn ("ISO C++ forbids initialization of member constant " "%qD of non-integral type %qT", decl, type); return 0; --- 7155,7162 ---- error ("ISO C++ forbids in-class initialization of non-const " "static member %qD", decl); ! else if (!INTEGRAL_TYPE_P (type)) ! pedwarn (input_location, OPT_pedantic, "ISO C++ forbids initialization of member constant " "%qD of non-integral type %qT", decl, type); return 0; *************** compute_array_index_type (tree name, tre *** 7001,7020 **** type = TREE_TYPE (size); } ! if (value_dependent_expression_p (size)) { ! /* We cannot do any checking for a value-dependent SIZE. Just ! build the index type and mark that it requires structural ! equality checks. */ itype = build_index_type (build_min (MINUS_EXPR, sizetype, size, integer_one_node)); SET_TYPE_STRUCTURAL_EQUALITY (itype); return itype; } if (!abi_version_at_least (2) && processing_template_decl) /* For abi-1, we handled all instances in templates the same way, ! even when they were non-dependent. This effects the manglings produced. So, we do the normal checking for non-dependent sizes, but at the end we'll return the same type that abi-1 would have, but with TYPE_CANONICAL set to the "right" --- 7188,7216 ---- type = TREE_TYPE (size); } ! /* We can only call value_dependent_expression_p on integral constant ! expressions; the parser adds a dummy NOP_EXPR with TREE_SIDE_EFFECTS ! set if this isn't one. */ ! if (processing_template_decl ! && (TREE_SIDE_EFFECTS (size) || value_dependent_expression_p (size))) { ! /* We cannot do any checking for a SIZE that isn't known to be ! constant. Just build the index type and mark that it requires ! structural equality checks. */ itype = build_index_type (build_min (MINUS_EXPR, sizetype, size, integer_one_node)); + if (!TREE_SIDE_EFFECTS (size)) + { + TYPE_DEPENDENT_P (itype) = 1; + TYPE_DEPENDENT_P_VALID (itype) = 1; + } SET_TYPE_STRUCTURAL_EQUALITY (itype); return itype; } if (!abi_version_at_least (2) && processing_template_decl) /* For abi-1, we handled all instances in templates the same way, ! even when they were non-dependent. This affects the manglings produced. So, we do the normal checking for non-dependent sizes, but at the end we'll return the same type that abi-1 would have, but with TYPE_CANONICAL set to the "right" *************** compute_array_index_type (tree name, tre *** 7033,7044 **** { /* Check to see if the array bound overflowed. Make that an error, no matter how generous we're being. */ ! int old_flag_pedantic_errors = flag_pedantic_errors; ! int old_pedantic = pedantic; ! pedantic = flag_pedantic_errors = 1; ! constant_expression_warning (size); ! pedantic = old_pedantic; ! flag_pedantic_errors = old_flag_pedantic_errors; /* An array must have a positive number of elements. */ if (INT_CST_LT (size, integer_zero_node)) --- 7229,7235 ---- { /* Check to see if the array bound overflowed. Make that an error, no matter how generous we're being. */ ! constant_expression_error (size); /* An array must have a positive number of elements. */ if (INT_CST_LT (size, integer_zero_node)) *************** compute_array_index_type (tree name, tre *** 7051,7062 **** } /* As an extension we allow zero-sized arrays. We always allow them in system headers because glibc uses them. */ ! else if (integer_zerop (size) && pedantic && !in_system_header) { if (name) ! pedwarn ("ISO C++ forbids zero-size array %qD", name); else ! pedwarn ("ISO C++ forbids zero-size array"); } } else if (TREE_CONSTANT (size)) --- 7242,7253 ---- } /* As an extension we allow zero-sized arrays. We always allow them in system headers because glibc uses them. */ ! else if (integer_zerop (size) && !in_system_header) { if (name) ! pedwarn (input_location, OPT_pedantic, "ISO C++ forbids zero-size array %qD", name); else ! pedwarn (input_location, OPT_pedantic, "ISO C++ forbids zero-size array"); } } else if (TREE_CONSTANT (size)) *************** compute_array_index_type (tree name, tre *** 7072,7080 **** else if (pedantic && warn_vla != 0) { if (name) ! pedwarn ("ISO C++ forbids variable length array %qD", name); else ! pedwarn ("ISO C++ forbids variable length array"); } else if (warn_vla > 0) { --- 7263,7271 ---- else if (pedantic && warn_vla != 0) { if (name) ! pedwarn (input_location, OPT_Wvla, "ISO C++ forbids variable length array %qD", name); else ! pedwarn (input_location, OPT_Wvla, "ISO C++ forbids variable length array"); } else if (warn_vla > 0) { *************** compute_array_index_type (tree name, tre *** 7099,7107 **** cp_build_binary_op will be appropriately folded. */ saved_processing_template_decl = processing_template_decl; processing_template_decl = 0; ! itype = cp_build_binary_op (MINUS_EXPR, cp_convert (ssizetype, size), ! cp_convert (ssizetype, integer_one_node)); itype = fold (itype); processing_template_decl = saved_processing_template_decl; --- 7290,7300 ---- cp_build_binary_op will be appropriately folded. */ saved_processing_template_decl = processing_template_decl; processing_template_decl = 0; ! itype = cp_build_binary_op (input_location, ! MINUS_EXPR, cp_convert (ssizetype, size), ! cp_convert (ssizetype, integer_one_node), ! tf_warning_or_error); itype = fold (itype); processing_template_decl = saved_processing_template_decl; *************** check_var_type (tree identifier, tree ty *** 7330,7336 **** Don't make a DECL node; just return the ..._TYPE node. FIELD for a struct or union field; make a FIELD_DECL. BITFIELD for a field with specified width. ! INITIALIZED is 1 if the decl has an initializer. ATTRLIST is a pointer to the list of attributes, which may be NULL if there are none; *ATTRLIST may be modified if attributes from inside --- 7523,7529 ---- Don't make a DECL node; just return the ..._TYPE node. FIELD for a struct or union field; make a FIELD_DECL. BITFIELD for a field with specified width. ! INITIALIZED is as for start_decl. ATTRLIST is a pointer to the list of attributes, which may be NULL if there are none; *ATTRLIST may be modified if attributes from inside *************** grokdeclarator (const cp_declarator *dec *** 7413,7418 **** --- 7606,7612 ---- bool type_was_error_mark_node = false; bool parameter_pack_p = declarator? declarator->parameter_pack_p : false; bool set_no_warning = false; + bool template_type_arg = false; signed_p = declspecs->specs[(int)ds_signed]; unsigned_p = declspecs->specs[(int)ds_unsigned]; *************** grokdeclarator (const cp_declarator *dec *** 7427,7432 **** --- 7621,7631 ---- funcdef_flag = true, decl_context = FIELD; else if (decl_context == BITFIELD) bitfield = 1, decl_context = FIELD; + else if (decl_context == TEMPLATE_TYPE_ARG) + template_type_arg = true, decl_context = TYPENAME; + + if (initialized > 1) + funcdef_flag = true; /* Look inside a declarator for the name being declared and get it as a string, for an error message. */ *************** grokdeclarator (const cp_declarator *dec *** 7512,7518 **** } type = TREE_OPERAND (decl, 0); ! name = IDENTIFIER_POINTER (constructor_name (type)); dname = decl; } break; --- 7711,7719 ---- } type = TREE_OPERAND (decl, 0); ! if (TYPE_P (type)) ! type = constructor_name (type); ! name = IDENTIFIER_POINTER (type); dname = decl; } break; *************** grokdeclarator (const cp_declarator *dec *** 7701,7708 **** /* We've already issued an error, don't complain more. */; else if (in_system_header || flag_ms_extensions) /* Allow it, sigh. */; ! else if (pedantic || ! is_main) ! pedwarn ("ISO C++ forbids declaration of %qs with no type", name); else warning (OPT_Wreturn_type, "ISO C++ forbids declaration of %qs with no type", name); --- 7902,7912 ---- /* We've already issued an error, don't complain more. */; else if (in_system_header || flag_ms_extensions) /* Allow it, sigh. */; ! else if (! is_main) ! permerror (input_location, "ISO C++ forbids declaration of %qs with no type", name); ! else if (pedantic) ! pedwarn (input_location, OPT_pedantic, ! "ISO C++ forbids declaration of %qs with no type", name); else warning (OPT_Wreturn_type, "ISO C++ forbids declaration of %qs with no type", name); *************** grokdeclarator (const cp_declarator *dec *** 7745,7756 **** error ("% or % specified with char for %qs", name); else if (long_p && short_p) error ("% and % specified together for %qs", name); else { ok = 1; if (!explicit_int && !defaulted_int && !explicit_char && pedantic) { ! pedwarn ("long, short, signed or unsigned used invalidly for %qs", name); if (flag_pedantic_errors) ok = 0; --- 7949,7968 ---- error ("% or % specified with char for %qs", name); else if (long_p && short_p) error ("% and % specified together for %qs", name); + else if (type == char16_type_node || type == char32_type_node) + { + if (signed_p || unsigned_p) + error ("% or % invalid for %qs", name); + else if (short_p || long_p) + error ("% or % invalid for %qs", name); + } else { ok = 1; if (!explicit_int && !defaulted_int && !explicit_char && pedantic) { ! pedwarn (input_location, OPT_pedantic, ! "long, short, signed or unsigned used invalidly for %qs", name); if (flag_pedantic_errors) ok = 0; *************** grokdeclarator (const cp_declarator *dec *** 7855,7861 **** if (pedantic) { tree bad_type = build_qualified_type (type, type_quals); ! pedwarn ("ignoring %qV qualifiers added to function type %qT", bad_type, type); } type_quals = TYPE_UNQUALIFIED; --- 8067,8074 ---- if (pedantic) { tree bad_type = build_qualified_type (type, type_quals); ! pedwarn (input_location, OPT_pedantic, ! "ignoring %qV qualifiers added to function type %qT", bad_type, type); } type_quals = TYPE_UNQUALIFIED; *************** grokdeclarator (const cp_declarator *dec *** 7902,7914 **** || storage_class == sc_extern || thread_p) error ("storage class specifiers invalid in parameter declarations"); } /* Give error if `virtual' is used outside of class declaration. */ if (virtualp && (current_class_name == NULL_TREE || decl_context != FIELD)) { ! error ("virtual outside class declaration"); virtualp = 0; } --- 8115,8133 ---- || storage_class == sc_extern || thread_p) error ("storage class specifiers invalid in parameter declarations"); + + if (type_uses_auto (type)) + { + error ("parameter declared %"); + type = error_mark_node; + } } /* Give error if `virtual' is used outside of class declaration. */ if (virtualp && (current_class_name == NULL_TREE || decl_context != FIELD)) { ! error ("% outside class declaration"); virtualp = 0; } *************** grokdeclarator (const cp_declarator *dec *** 7964,7982 **** storage_class = sc_none; } } - else if (storage_class == sc_extern && initialized - && !funcdef_flag) - { - if (toplevel_bindings_p ()) - { - /* It's common practice (and completely valid) to have a const - be initialized and declared extern. */ - if (!(type_quals & TYPE_QUAL_CONST)) - warning (0, "%qs initialized and declared %", name); - } - else - error ("%qs has both % and initializer", name); - } else if (storage_class == sc_extern && funcdef_flag && ! toplevel_bindings_p ()) error ("nested function %qs declared %", name); --- 8183,8188 ---- *************** grokdeclarator (const cp_declarator *dec *** 8009,8016 **** switch (TREE_CODE (unqualified_id)) { case BIT_NOT_EXPR: ! unqualified_id ! = constructor_name (TREE_OPERAND (unqualified_id, 0)); break; case IDENTIFIER_NODE: --- 8215,8223 ---- switch (TREE_CODE (unqualified_id)) { case BIT_NOT_EXPR: ! unqualified_id = TREE_OPERAND (unqualified_id, 0); ! if (TYPE_P (unqualified_id)) ! unqualified_id = constructor_name (unqualified_id); break; case IDENTIFIER_NODE: *************** grokdeclarator (const cp_declarator *dec *** 8080,8096 **** set_no_warning = true; } ! /* Warn about some types functions can't return. */ if (TREE_CODE (type) == FUNCTION_TYPE) { error ("%qs declared as function returning a function", name); ! type = integer_type_node; } if (TREE_CODE (type) == ARRAY_TYPE) { error ("%qs declared as function returning an array", name); ! type = integer_type_node; } /* Pick up type qualifiers which should be applied to `this'. */ --- 8287,8303 ---- set_no_warning = true; } ! /* Error about some types functions can't return. */ if (TREE_CODE (type) == FUNCTION_TYPE) { error ("%qs declared as function returning a function", name); ! return error_mark_node; } if (TREE_CODE (type) == ARRAY_TYPE) { error ("%qs declared as function returning an array", name); ! return error_mark_node; } /* Pick up type qualifiers which should be applied to `this'. */ *************** grokdeclarator (const cp_declarator *dec *** 8103,8108 **** --- 8310,8346 ---- closest to the identifier. */ funcdecl_p = inner_declarator && inner_declarator->kind == cdk_id; + /* Handle a late-specified return type. */ + if (funcdecl_p) + { + if (type_uses_auto (type)) + { + if (!declarator->u.function.late_return_type) + { + error ("%qs function uses % type specifier without" + " late return type", name); + return error_mark_node; + } + else if (!is_auto (type)) + { + error ("%qs function with late return type has" + " %qT as its type rather than plain %", + name, type); + return error_mark_node; + } + } + else if (declarator->u.function.late_return_type) + { + error ("%qs function with late return type not declared" + " with % type specifier", name); + return error_mark_node; + } + } + type = splice_late_return_type + (type, declarator->u.function.late_return_type); + if (type == error_mark_node) + return error_mark_node; + if (ctype == NULL_TREE && decl_context == FIELD && funcdecl_p *************** grokdeclarator (const cp_declarator *dec *** 8149,8155 **** explicitp = 2; if (virtualp) { ! pedwarn ("constructors cannot be declared virtual"); virtualp = 0; } if (decl_context == FIELD --- 8387,8393 ---- explicitp = 2; if (virtualp) { ! permerror (input_location, "constructors cannot be declared virtual"); virtualp = 0; } if (decl_context == FIELD *************** grokdeclarator (const cp_declarator *dec *** 8244,8249 **** --- 8482,8493 ---- memfn_quals = TYPE_UNQUALIFIED; } + if (TREE_CODE (type) == FUNCTION_TYPE + && cp_type_quals (type) != TYPE_UNQUALIFIED) + error ("cannot declare %s to qualified function type %qT", + declarator->kind == cdk_reference ? "reference" : "pointer", + type); + if (declarator->kind == cdk_reference) { /* In C++0x, the type we are creating a reference to might be *************** grokdeclarator (const cp_declarator *dec *** 8372,8383 **** { if (friendp) { ! pedwarn ("member functions are implicitly friends of their class"); friendp = 0; } else ! pedwarn ("extra qualification %<%T::%> on member %qs", ! ctype, name); } else if (/* If the qualifying type is already complete, then we can skip the following checks. */ --- 8616,8628 ---- { if (friendp) { ! permerror (input_location, "member functions are implicitly friends of their class"); friendp = 0; } else ! permerror (declarator->id_loc, ! "extra qualification %<%T::%> on member %qs", ! ctype, name); } else if (/* If the qualifying type is already complete, then we can skip the following checks. */ *************** grokdeclarator (const cp_declarator *dec *** 8563,8571 **** DECL_ABSTRACT (decl) = 1; } else if (constructor_name_p (unqualified_id, current_class_type)) ! pedwarn ("ISO C++ forbids nested type %qD with same name " ! "as enclosing class", ! unqualified_id); /* If the user declares "typedef struct {...} foo" then the struct will have an anonymous name. Fill that name in now. --- 8808,8816 ---- DECL_ABSTRACT (decl) = 1; } else if (constructor_name_p (unqualified_id, current_class_type)) ! permerror (input_location, "ISO C++ forbids nested type %qD with same name " ! "as enclosing class", ! unqualified_id); /* If the user declares "typedef struct {...} foo" then the struct will have an anonymous name. Fill that name in now. *************** grokdeclarator (const cp_declarator *dec *** 8576,8583 **** && TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL && TYPE_ANONYMOUS_P (type) - /* Don't do this if there are attributes. */ - && (!attrlist || !*attrlist) && cp_type_quals (type) == TYPE_UNQUALIFIED) { tree oldname = TYPE_NAME (type); --- 8821,8826 ---- *************** grokdeclarator (const cp_declarator *dec *** 8690,8704 **** { /* Don't allow friend declaration without a class-key. */ if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) ! pedwarn ("template parameters cannot be friends"); else if (TREE_CODE (type) == TYPENAME_TYPE) ! pedwarn ("friend declaration requires class-key, " ! "i.e. %", ! TYPE_CONTEXT (type), TYPENAME_TYPE_FULLNAME (type)); else ! pedwarn ("friend declaration requires class-key, " ! "i.e. %", ! type); } /* Only try to do this stuff if we didn't already give up. */ --- 8933,8947 ---- { /* Don't allow friend declaration without a class-key. */ if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) ! permerror (input_location, "template parameters cannot be friends"); else if (TREE_CODE (type) == TYPENAME_TYPE) ! permerror (input_location, "friend declaration requires class-key, " ! "i.e. %", ! TYPE_CONTEXT (type), TYPENAME_TYPE_FULLNAME (type)); else ! permerror (input_location, "friend declaration requires class-key, " ! "i.e. %", ! type); } /* Only try to do this stuff if we didn't already give up. */ *************** grokdeclarator (const cp_declarator *dec *** 8717,8731 **** } else if (memfn_quals) { ! if (ctype == NULL_TREE) ! { ! if (TREE_CODE (type) != METHOD_TYPE) ! error ("invalid qualifiers on non-member function type"); ! else ! ctype = TYPE_METHOD_BASETYPE (type); ! } if (ctype) type = build_memfn_type (type, ctype, memfn_quals); } return type; --- 8960,8976 ---- } else if (memfn_quals) { ! if (ctype == NULL_TREE ! && TREE_CODE (type) == METHOD_TYPE) ! ctype = TYPE_METHOD_BASETYPE (type); ! if (ctype) type = build_memfn_type (type, ctype, memfn_quals); + /* Core issue #547: need to allow this in template type args. */ + else if (template_type_arg && TREE_CODE (type) == FUNCTION_TYPE) + type = cp_build_qualified_type (type, memfn_quals); + else + error ("invalid qualifiers on non-member function type"); } return type; *************** grokdeclarator (const cp_declarator *dec *** 8856,8876 **** /* Check that the name used for a destructor makes sense. */ if (sfk == sfk_destructor) { if (!ctype) { gcc_assert (friendp); error ("expected qualified name in friend declaration " ! "for destructor %qD", ! id_declarator->u.id.unqualified_name); return error_mark_node; } ! if (!same_type_p (TREE_OPERAND ! (id_declarator->u.id.unqualified_name, 0), ! ctype)) { error ("declaration of %qD as member of %qT", ! id_declarator->u.id.unqualified_name, ctype); return error_mark_node; } } --- 9101,9120 ---- /* Check that the name used for a destructor makes sense. */ if (sfk == sfk_destructor) { + tree uqname = id_declarator->u.id.unqualified_name; + if (!ctype) { gcc_assert (friendp); error ("expected qualified name in friend declaration " ! "for destructor %qD", uqname); return error_mark_node; } ! if (!check_dtor_name (ctype, TREE_OPERAND (uqname, 0))) { error ("declaration of %qD as member of %qT", ! uqname, ctype); return error_mark_node; } } *************** grokdeclarator (const cp_declarator *dec *** 8895,8901 **** virtualp, flags, memfn_quals, raises, friendp ? -1 : 0, friendp, publicp, inlinep, sfk, ! funcdef_flag, template_count, in_namespace, attrlist); if (decl == NULL_TREE) return error_mark_node; #if 0 --- 9139,9146 ---- virtualp, flags, memfn_quals, raises, friendp ? -1 : 0, friendp, publicp, inlinep, sfk, ! funcdef_flag, template_count, in_namespace, ! attrlist, declarator->id_loc); if (decl == NULL_TREE) return error_mark_node; #if 0 *************** grokdeclarator (const cp_declarator *dec *** 8913,8933 **** is called a converting constructor. */ if (explicitp == 2) DECL_NONCONVERTING_P (decl) = 1; - else if (DECL_CONSTRUCTOR_P (decl)) - { - /* The constructor can be called with exactly one - parameter if there is at least one parameter, and - any subsequent parameters have default arguments. - Ignore any compiler-added parms. */ - tree arg_types = FUNCTION_FIRST_USER_PARMTYPE (decl); - - if (arg_types == void_list_node - || (arg_types - && TREE_CHAIN (arg_types) - && TREE_CHAIN (arg_types) != void_list_node - && !TREE_PURPOSE (TREE_CHAIN (arg_types)))) - DECL_NONCONVERTING_P (decl) = 1; - } } else if (TREE_CODE (type) == METHOD_TYPE) { --- 9158,9163 ---- *************** grokdeclarator (const cp_declarator *dec *** 8943,8949 **** virtualp, flags, memfn_quals, raises, friendp ? -1 : 0, friendp, 1, 0, sfk, funcdef_flag, template_count, in_namespace, ! attrlist); if (decl == NULL_TREE) return error_mark_node; } --- 9173,9180 ---- virtualp, flags, memfn_quals, raises, friendp ? -1 : 0, friendp, 1, 0, sfk, funcdef_flag, template_count, in_namespace, ! attrlist, ! declarator->id_loc); if (decl == NULL_TREE) return error_mark_node; } *************** grokdeclarator (const cp_declarator *dec *** 8983,8989 **** { /* Friends are treated specially. */ if (ctype == current_class_type) ! ; /* We already issued a pedwarn. */ else if (decl && DECL_NAME (decl)) { if (template_class_depth (current_class_type) == 0) --- 9214,9220 ---- { /* Friends are treated specially. */ if (ctype == current_class_type) ! ; /* We already issued a permerror. */ else if (decl && DECL_NAME (decl)) { if (template_class_depth (current_class_type) == 0) *************** grokdeclarator (const cp_declarator *dec *** 9024,9032 **** the rest of the compiler does not correctly handle the initialization unless the member is static so we make it static below. */ ! pedwarn ("ISO C++ forbids initialization of member %qD", ! unqualified_id); ! pedwarn ("making %qD static", unqualified_id); staticp = 1; } --- 9255,9263 ---- the rest of the compiler does not correctly handle the initialization unless the member is static so we make it static below. */ ! permerror (input_location, "ISO C++ forbids initialization of member %qD", ! unqualified_id); ! permerror (input_location, "making %qD static", unqualified_id); staticp = 1; } *************** grokdeclarator (const cp_declarator *dec *** 9106,9118 **** && pedantic) { if (storage_class == sc_static) ! pedwarn ("% specified invalid for function %qs " "declared out of global scope", name); else ! pedwarn ("% specifier invalid for function %qs " "declared out of global scope", name); } if (ctype == NULL_TREE) { if (virtualp) --- 9337,9358 ---- && pedantic) { if (storage_class == sc_static) ! pedwarn (input_location, OPT_pedantic, ! "% specified invalid for function %qs " "declared out of global scope", name); else ! pedwarn (input_location, OPT_pedantic, ! "% specifier invalid for function %qs " "declared out of global scope", name); } + if (ctype != NULL_TREE + && TREE_CODE (ctype) != NAMESPACE_DECL && !MAYBE_CLASS_TYPE_P (ctype)) + { + error ("%q#T is not a class or a namespace", ctype); + ctype = NULL_TREE; + } + if (ctype == NULL_TREE) { if (virtualp) *************** grokdeclarator (const cp_declarator *dec *** 9120,9125 **** --- 9360,9373 ---- error ("virtual non-class function %qs", name); virtualp = 0; } + else if (sfk == sfk_constructor + || sfk == sfk_destructor) + { + error (funcdef_flag + ? "%qs defined in a non-class scope" + : "%qs declared in a non-class scope", name); + sfk = sfk_none; + } } else if (TREE_CODE (type) == FUNCTION_TYPE && staticp < 2 && !NEW_DELETE_OPNAME_P (original_name)) *************** grokdeclarator (const cp_declarator *dec *** 9136,9142 **** virtualp, flags, memfn_quals, raises, 1, friendp, publicp, inlinep, sfk, funcdef_flag, ! template_count, in_namespace, attrlist); if (decl == NULL_TREE) return error_mark_node; --- 9384,9391 ---- virtualp, flags, memfn_quals, raises, 1, friendp, publicp, inlinep, sfk, funcdef_flag, ! template_count, in_namespace, attrlist, ! declarator->id_loc); if (decl == NULL_TREE) return error_mark_node; *************** grokdeclarator (const cp_declarator *dec *** 9148,9155 **** declaring main to be static. */ if (TREE_CODE (type) == METHOD_TYPE) { ! pedwarn ("cannot declare member function %qD to have " ! "static linkage", decl); invalid_static = 1; } else if (current_function_decl) --- 9397,9404 ---- declaring main to be static. */ if (TREE_CODE (type) == METHOD_TYPE) { ! permerror (input_location, "cannot declare member function %qD to have " ! "static linkage", decl); invalid_static = 1; } else if (current_function_decl) *************** grokdeclarator (const cp_declarator *dec *** 9185,9192 **** DECL_CONTEXT (decl) = ctype; if (staticp == 1) { ! pedwarn ("% may not be used when defining " ! "(as opposed to declaring) a static data member"); staticp = 0; storage_class = sc_none; } --- 9434,9441 ---- DECL_CONTEXT (decl) = ctype; if (staticp == 1) { ! permerror (input_location, "% may not be used when defining " ! "(as opposed to declaring) a static data member"); staticp = 0; storage_class = sc_none; } *************** grokdeclarator (const cp_declarator *dec *** 9197,9210 **** } if (storage_class == sc_extern && pedantic) { ! pedwarn ("cannot explicitly declare member %q#D to have " ! "extern linkage", ! decl); storage_class = sc_none; } } } /* Record `register' declaration for warnings on & and in case doing stupid register allocation. */ --- 9446,9475 ---- } if (storage_class == sc_extern && pedantic) { ! pedwarn (input_location, OPT_pedantic, ! "cannot explicitly declare member %q#D to have " ! "extern linkage", decl); storage_class = sc_none; } } } + if (storage_class == sc_extern && initialized && !funcdef_flag) + { + if (toplevel_bindings_p ()) + { + /* It's common practice (and completely valid) to have a const + be initialized and declared extern. */ + if (!(type_quals & TYPE_QUAL_CONST)) + warning (0, "%qs initialized and declared %", name); + } + else + { + error ("%qs has both % and initializer", name); + return error_mark_node; + } + } + /* Record `register' declaration for warnings on & and in case doing stupid register allocation. */ *************** check_default_argument (tree decl, tree *** 9353,9358 **** --- 9618,9649 ---- return arg; } + /* Returns a deprecated type used within TYPE, or NULL_TREE if none. */ + + static tree + type_is_deprecated (tree type) + { + enum tree_code code; + if (TREE_DEPRECATED (type)) + return type; + if (TYPE_NAME (type) + && TREE_DEPRECATED (TYPE_NAME (type))) + return type; + + code = TREE_CODE (type); + + if (code == POINTER_TYPE || code == REFERENCE_TYPE + || code == OFFSET_TYPE || code == FUNCTION_TYPE + || code == METHOD_TYPE || code == ARRAY_TYPE) + return type_is_deprecated (TREE_TYPE (type)); + + if (TYPE_PTRMEMFUNC_P (type)) + return type_is_deprecated + (TREE_TYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type)))); + + return NULL_TREE; + } + /* Decode the list of parameter types for a function type. Given the list of things declared inside the parens, return a list of types. *************** check_default_argument (tree decl, tree *** 9363,9403 **** *PARMS is set to the chain of PARM_DECLs created. */ static tree ! grokparms (cp_parameter_declarator *first_parm, tree *parms) { tree result = NULL_TREE; tree decls = NULL_TREE; ! int ellipsis = !first_parm || first_parm->ellipsis_p; ! cp_parameter_declarator *parm; int any_error = 0; - struct pointer_set_t *unique_decls = pointer_set_create (); ! for (parm = first_parm; parm != NULL; parm = parm->next) { tree type = NULL_TREE; ! tree init = parm->default_argument; ! tree attrs; ! tree decl; ! if (parm == no_parameters) break; - attrs = parm->decl_specifiers.attributes; - parm->decl_specifiers.attributes = NULL_TREE; - decl = grokdeclarator (parm->declarator, &parm->decl_specifiers, - PARM, init != NULL_TREE, &attrs); if (! decl || TREE_TYPE (decl) == error_mark_node) continue; - if (attrs) - cplus_decl_attributes (&decl, attrs, 0); - type = TREE_TYPE (decl); if (VOID_TYPE_P (type)) { if (same_type_p (type, void_type_node) && DECL_SELF_REFERENCE_P (type) ! && !DECL_NAME (decl) && !result && !parm->next && !ellipsis) /* this is a parmlist of `(void)', which is ok. */ break; cxx_incomplete_type_error (decl, type); --- 9654,9684 ---- *PARMS is set to the chain of PARM_DECLs created. */ static tree ! grokparms (tree parmlist, tree *parms) { tree result = NULL_TREE; tree decls = NULL_TREE; ! tree parm; int any_error = 0; ! for (parm = parmlist; parm != NULL_TREE; parm = TREE_CHAIN (parm)) { tree type = NULL_TREE; ! tree init = TREE_PURPOSE (parm); ! tree decl = TREE_VALUE (parm); ! if (parm == void_list_node) break; if (! decl || TREE_TYPE (decl) == error_mark_node) continue; type = TREE_TYPE (decl); if (VOID_TYPE_P (type)) { if (same_type_p (type, void_type_node) && DECL_SELF_REFERENCE_P (type) ! && !DECL_NAME (decl) && !result && TREE_CHAIN (parm) == void_list_node) /* this is a parmlist of `(void)', which is ok. */ break; cxx_incomplete_type_error (decl, type); *************** grokparms (cp_parameter_declarator *firs *** 9410,9416 **** if (type != error_mark_node && TYPE_FOR_JAVA (type) ! && IS_AGGR_TYPE (type)) { error ("parameter %qD has Java class type", decl); type = error_mark_node; --- 9691,9697 ---- if (type != error_mark_node && TYPE_FOR_JAVA (type) ! && MAYBE_CLASS_TYPE_P (type)) { error ("parameter %qD has Java class type", decl); type = error_mark_node; *************** grokparms (cp_parameter_declarator *firs *** 9420,9425 **** --- 9701,9713 ---- if (type != error_mark_node) { + if (deprecated_state != DEPRECATED_SUPPRESS) + { + tree deptype = type_is_deprecated (type); + if (deptype) + warn_deprecated_use (deptype); + } + /* Top-level qualifiers on the parameters are ignored for function types. */ type = cp_build_qualified_type (type, 0); *************** grokparms (cp_parameter_declarator *firs *** 9462,9489 **** if (TREE_CODE (decl) == PARM_DECL && FUNCTION_PARAMETER_PACK_P (decl) ! && parm->next) error ("parameter packs must be at the end of the parameter list"); - if (DECL_NAME (decl)) - { - if (pointer_set_contains (unique_decls, DECL_NAME (decl))) - error ("multiple parameters named %qE", DECL_NAME (decl)); - else - pointer_set_insert (unique_decls, DECL_NAME (decl)); - } - TREE_CHAIN (decl) = decls; decls = decl; result = tree_cons (init, type, result); } decls = nreverse (decls); result = nreverse (result); ! if (!ellipsis) result = chainon (result, void_list_node); *parms = decls; - pointer_set_destroy (unique_decls); return result; } --- 9750,9769 ---- if (TREE_CODE (decl) == PARM_DECL && FUNCTION_PARAMETER_PACK_P (decl) ! && TREE_CHAIN (parm) ! && TREE_CHAIN (parm) != void_list_node) error ("parameter packs must be at the end of the parameter list"); TREE_CHAIN (decl) = decls; decls = decl; result = tree_cons (init, type, result); } decls = nreverse (decls); result = nreverse (result); ! if (parm) result = chainon (result, void_list_node); *parms = decls; return result; } *************** grok_special_member_properties (tree dec *** 9635,9645 **** are no other parameters or else all other parameters have default arguments. */ TYPE_HAS_INIT_REF (class_type) = 1; if (ctor > 1) TYPE_HAS_CONST_INIT_REF (class_type) = 1; } else if (sufficient_parms_p (FUNCTION_FIRST_USER_PARMTYPE (decl))) ! TYPE_HAS_DEFAULT_CONSTRUCTOR (class_type) = 1; } else if (DECL_OVERLOADED_OPERATOR_P (decl) == NOP_EXPR) { --- 9915,9933 ---- are no other parameters or else all other parameters have default arguments. */ TYPE_HAS_INIT_REF (class_type) = 1; + if (!DECL_DEFAULTED_FN (decl)) + TYPE_HAS_COMPLEX_INIT_REF (class_type) = 1; if (ctor > 1) TYPE_HAS_CONST_INIT_REF (class_type) = 1; } else if (sufficient_parms_p (FUNCTION_FIRST_USER_PARMTYPE (decl))) ! { ! TYPE_HAS_DEFAULT_CONSTRUCTOR (class_type) = 1; ! if (TREE_CODE (decl) == TEMPLATE_DECL || !DECL_DEFAULTED_FN (decl)) ! TYPE_HAS_COMPLEX_DFLT (class_type) = 1; ! } ! else if (is_list_ctor (decl)) ! TYPE_HAS_LIST_CTOR (class_type) = 1; } else if (DECL_OVERLOADED_OPERATOR_P (decl) == NOP_EXPR) { *************** grok_special_member_properties (tree dec *** 9654,9659 **** --- 9942,9949 ---- if (assop) { TYPE_HAS_ASSIGN_REF (class_type) = 1; + if (!DECL_DEFAULTED_FN (decl)) + TYPE_HAS_COMPLEX_ASSIGN_REF (class_type) = 1; if (assop != 1) TYPE_HAS_CONST_ASSIGN_REF (class_type) = 1; } *************** grok_op_properties (tree decl, bool comp *** 9767,9773 **** gcc_unreachable (); } while (0); ! gcc_assert (operator_code != LAST_CPLUS_TREE_CODE); SET_OVERLOADED_OPERATOR_CODE (decl, operator_code); if (class_type) --- 10057,10063 ---- gcc_unreachable (); } while (0); ! gcc_assert (operator_code != MAX_TREE_CODES); SET_OVERLOADED_OPERATOR_CODE (decl, operator_code); if (class_type) *************** grok_op_properties (tree decl, bool comp *** 9858,9867 **** if (arg == error_mark_node) return false; ! /* IS_AGGR_TYPE, rather than CLASS_TYPE_P, is used because these checks are performed even on template functions. */ ! if (IS_AGGR_TYPE (arg) || TREE_CODE (arg) == ENUMERAL_TYPE) break; } --- 10148,10158 ---- if (arg == error_mark_node) return false; ! /* MAYBE_CLASS_TYPE_P, rather than CLASS_TYPE_P, is used because these checks are performed even on template functions. */ ! if (MAYBE_CLASS_TYPE_P (arg) ! || TREE_CODE (arg) == ENUMERAL_TYPE) break; } *************** grok_op_properties (tree decl, bool comp *** 9902,9908 **** if (t == class_type) what = "the same type"; /* Don't force t to be complete here. */ ! else if (IS_AGGR_TYPE (t) && COMPLETE_TYPE_P (t) && DERIVED_FROM_P (t, class_type)) what = "a base class"; --- 10193,10199 ---- if (t == class_type) what = "the same type"; /* Don't force t to be complete here. */ ! else if (MAYBE_CLASS_TYPE_P (t) && COMPLETE_TYPE_P (t) && DERIVED_FROM_P (t, class_type)) what = "a base class"; *************** grok_op_properties (tree decl, bool comp *** 10070,10077 **** if (operator_code == POSTINCREMENT_EXPR || operator_code == POSTDECREMENT_EXPR) { ! if (pedantic) ! pedwarn ("%qD cannot have default arguments", decl); } else { --- 10361,10368 ---- if (operator_code == POSTINCREMENT_EXPR || operator_code == POSTDECREMENT_EXPR) { ! pedwarn (input_location, OPT_pedantic, "%qD cannot have default arguments", ! decl); } else { *************** xref_tag (enum tag_types tag_code, tree *** 10376,10389 **** } else { ! t = make_aggr_type (code); TYPE_CONTEXT (t) = context; t = pushtag (name, t, scope); } } else { ! if (template_header_p && IS_AGGR_TYPE (t)) { if (!redeclare_class_template (t, current_template_parms)) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); --- 10667,10680 ---- } else { ! t = make_class_type (code); TYPE_CONTEXT (t) = context; t = pushtag (name, t, scope); } } else { ! if (template_header_p && MAYBE_CLASS_TYPE_P (t)) { if (!redeclare_class_template (t, current_template_parms)) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); *************** xref_basetypes (tree ref, tree base_list *** 10542,10551 **** basetype = PACK_EXPANSION_PATTERN (basetype); if (TREE_CODE (basetype) == TYPE_DECL) basetype = TREE_TYPE (basetype); ! if (TREE_CODE (basetype) != RECORD_TYPE ! && TREE_CODE (basetype) != TYPENAME_TYPE ! && TREE_CODE (basetype) != TEMPLATE_TYPE_PARM ! && TREE_CODE (basetype) != BOUND_TEMPLATE_TEMPLATE_PARM) { error ("base type %qT fails to be a struct or class type", basetype); --- 10833,10839 ---- basetype = PACK_EXPANSION_PATTERN (basetype); if (TREE_CODE (basetype) == TYPE_DECL) basetype = TREE_TYPE (basetype); ! if (!MAYBE_CLASS_TYPE_P (basetype) || TREE_CODE (basetype) == UNION_TYPE) { error ("base type %qT fails to be a struct or class type", basetype); *************** xref_basetypes (tree ref, tree base_list *** 10637,10649 **** /* Begin compiling the definition of an enumeration type. ! NAME is its name. Returns the type object, as yet incomplete. Also records info about it so that build_enumerator may be used to declare the individual values as they are read. */ tree ! start_enum (tree name) { tree enumtype; --- 10925,10944 ---- /* Begin compiling the definition of an enumeration type. ! NAME is its name, ! ! UNDERLYING_TYPE is the type that will be used as the storage for ! the enumeration type. This should be NULL_TREE if no storage type ! was specified. ! ! SCOPED_ENUM_P is true if this is a scoped enumeration type. ! Returns the type object, as yet incomplete. Also records info about it so that build_enumerator may be used to declare the individual values as they are read. */ tree ! start_enum (tree name, tree underlying_type, bool scoped_enum_p) { tree enumtype; *************** start_enum (tree name) *** 10675,10680 **** --- 10970,11011 ---- enumtype = pushtag (name, enumtype, /*tag_scope=*/ts_current); } + if (enumtype == error_mark_node) + return enumtype; + + if (scoped_enum_p) + { + SET_SCOPED_ENUM_P (enumtype, 1); + begin_scope (sk_scoped_enum, enumtype); + + /* [C++0x dcl.enum]p5: + + If not explicitly specified, the underlying type of a scoped + enumeration type is int. */ + if (!underlying_type) + underlying_type = integer_type_node; + } + + if (underlying_type) + { + if (CP_INTEGRAL_TYPE_P (underlying_type)) + { + TYPE_MIN_VALUE (enumtype) = TYPE_MIN_VALUE (underlying_type); + TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (underlying_type); + TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type); + TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type); + SET_TYPE_MODE (enumtype, TYPE_MODE (underlying_type)); + TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type); + TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type); + TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type); + TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type); + ENUM_UNDERLYING_TYPE (enumtype) = underlying_type; + } + else + error ("underlying type %<%T%> of %<%T%> must be an integral type", + underlying_type, enumtype); + } + return enumtype; } *************** finish_enum (tree enumtype) *** 10687,10695 **** { tree values; tree decl; - tree value; tree minnode; tree maxnode; tree t; bool unsignedp; bool use_short_enum; --- 11018,11026 ---- { tree values; tree decl; tree minnode; tree maxnode; + tree value; tree t; bool unsignedp; bool use_short_enum; *************** finish_enum (tree enumtype) *** 10698,10703 **** --- 11029,11036 ---- int precision; integer_type_kind itk; tree underlying_type = NULL_TREE; + bool fixed_underlying_type_p + = ENUM_UNDERLYING_TYPE (enumtype) != NULL_TREE; /* We built up the VALUES in reverse order. */ TYPE_VALUES (enumtype) = nreverse (TYPE_VALUES (enumtype)); *************** finish_enum (tree enumtype) *** 10723,10811 **** minnode = maxnode = NULL_TREE; for (values = TYPE_VALUES (enumtype); ! values; ! values = TREE_CHAIN (values)) ! { ! decl = TREE_VALUE (values); ! /* [dcl.enum]: Following the closing brace of an enum-specifier, ! each enumerator has the type of its enumeration. Prior to the ! closing brace, the type of each enumerator is the type of its ! initializing value. */ ! TREE_TYPE (decl) = enumtype; ! /* Update the minimum and maximum values, if appropriate. */ ! value = DECL_INITIAL (decl); ! if (value == error_mark_node) ! value = integer_zero_node; ! /* Figure out what the minimum and maximum values of the ! enumerators are. */ ! if (!minnode) ! minnode = maxnode = value; ! else if (tree_int_cst_lt (maxnode, value)) ! maxnode = value; ! else if (tree_int_cst_lt (value, minnode)) ! minnode = value; ! } } else /* [dcl.enum] ! If the enumerator-list is empty, the underlying type is as if the enumeration had a single enumerator with value 0. */ minnode = maxnode = integer_zero_node; /* Compute the number of bits require to represent all values of the enumeration. We must do this before the type of MINNODE and ! MAXNODE are transformed, since min_precision relies on the ! TREE_TYPE of the value it is passed. */ unsignedp = tree_int_cst_sgn (minnode) >= 0; ! lowprec = min_precision (minnode, unsignedp); ! highprec = min_precision (maxnode, unsignedp); precision = MAX (lowprec, highprec); ! /* Determine the underlying type of the enumeration. ! [dcl.enum] ! The underlying type of an enumeration is an integral type that ! can represent all the enumerator values defined in the ! enumeration. It is implementation-defined which integral type is ! used as the underlying type for an enumeration except that the ! underlying type shall not be larger than int unless the value of ! an enumerator cannot fit in an int or unsigned int. ! We use "int" or an "unsigned int" as the underlying type, even if ! a smaller integral type would work, unless the user has ! explicitly requested that we use the smallest possible type. The ! user can request that for all enumerations with a command line ! flag, or for just one enumeration with an attribute. */ ! use_short_enum = flag_short_enums ! || lookup_attribute ("packed", TYPE_ATTRIBUTES (enumtype)); ! for (itk = (use_short_enum ? itk_char : itk_int); ! itk != itk_none; ! itk++) ! { ! underlying_type = integer_types[itk]; ! if (TYPE_PRECISION (underlying_type) >= precision ! && TYPE_UNSIGNED (underlying_type) == unsignedp) ! break; ! } ! if (itk == itk_none) ! { ! /* DR 377 ! IF no integral type can represent all the enumerator values, the ! enumeration is ill-formed. */ ! error ("no integral type can represent all of the enumerator values " ! "for %qT", enumtype); ! precision = TYPE_PRECISION (long_long_integer_type_node); ! underlying_type = integer_types[itk_unsigned_long_long]; } ! /* Compute the minium and maximum values for the type. [dcl.enum] --- 11056,11168 ---- minnode = maxnode = NULL_TREE; for (values = TYPE_VALUES (enumtype); ! values; ! values = TREE_CHAIN (values)) ! { ! decl = TREE_VALUE (values); ! /* [dcl.enum]: Following the closing brace of an enum-specifier, ! each enumerator has the type of its enumeration. Prior to the ! closing brace, the type of each enumerator is the type of its ! initializing value. */ ! TREE_TYPE (decl) = enumtype; ! /* Update the minimum and maximum values, if appropriate. */ ! value = DECL_INITIAL (decl); ! if (value == error_mark_node) ! value = integer_zero_node; ! /* Figure out what the minimum and maximum values of the ! enumerators are. */ ! if (!minnode) ! minnode = maxnode = value; ! else if (tree_int_cst_lt (maxnode, value)) ! maxnode = value; ! else if (tree_int_cst_lt (value, minnode)) ! minnode = value; ! } } else /* [dcl.enum] ! If the enumerator-list is empty, the underlying type is as if the enumeration had a single enumerator with value 0. */ minnode = maxnode = integer_zero_node; /* Compute the number of bits require to represent all values of the enumeration. We must do this before the type of MINNODE and ! MAXNODE are transformed, since tree_int_cst_min_precision relies ! on the TREE_TYPE of the value it is passed. */ unsignedp = tree_int_cst_sgn (minnode) >= 0; ! lowprec = tree_int_cst_min_precision (minnode, unsignedp); ! highprec = tree_int_cst_min_precision (maxnode, unsignedp); precision = MAX (lowprec, highprec); ! if (!fixed_underlying_type_p) ! { ! /* Determine the underlying type of the enumeration. ! [dcl.enum] ! The underlying type of an enumeration is an integral type that ! can represent all the enumerator values defined in the ! enumeration. It is implementation-defined which integral type is ! used as the underlying type for an enumeration except that the ! underlying type shall not be larger than int unless the value of ! an enumerator cannot fit in an int or unsigned int. ! We use "int" or an "unsigned int" as the underlying type, even if ! a smaller integral type would work, unless the user has ! explicitly requested that we use the smallest possible type. The ! user can request that for all enumerations with a command line ! flag, or for just one enumeration with an attribute. */ ! use_short_enum = flag_short_enums ! || lookup_attribute ("packed", TYPE_ATTRIBUTES (enumtype)); ! for (itk = (use_short_enum ? itk_char : itk_int); ! itk != itk_none; ! itk++) ! { ! underlying_type = integer_types[itk]; ! if (TYPE_PRECISION (underlying_type) >= precision ! && TYPE_UNSIGNED (underlying_type) == unsignedp) ! break; ! } ! if (itk == itk_none) ! { ! /* DR 377 ! IF no integral type can represent all the enumerator values, the ! enumeration is ill-formed. */ ! error ("no integral type can represent all of the enumerator values " ! "for %qT", enumtype); ! precision = TYPE_PRECISION (long_long_integer_type_node); ! underlying_type = integer_types[itk_unsigned_long_long]; ! } ! ! /* [dcl.enum] ! ! The value of sizeof() applied to an enumeration type, an object ! of an enumeration type, or an enumerator, is the value of sizeof() ! applied to the underlying type. */ ! TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type); ! TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type); ! SET_TYPE_MODE (enumtype, TYPE_MODE (underlying_type)); ! TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type); ! TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type); ! TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type); ! ! /* Set the underlying type of the enumeration type to the ! computed enumeration type, restricted to the enumerator ! values. */ ! ENUM_UNDERLYING_TYPE (enumtype) = copy_node (underlying_type); ! set_min_and_max_values_for_integral_type ! (ENUM_UNDERLYING_TYPE (enumtype), precision, unsignedp); } + else + underlying_type = ENUM_UNDERLYING_TYPE (enumtype); ! /* Compute the minimum and maximum values for the type. [dcl.enum] *************** finish_enum (tree enumtype) *** 10814,10841 **** underlying type in the range bmin to bmax, where bmin and bmax are, respectively, the smallest and largest values of the smallest bit- field that can store emin and emax. */ ! /* The middle-end currently assumes that types with TYPE_PRECISION narrower than their underlying type are suitably zero or sign extended to fill their mode. g++ doesn't make these guarantees. Until the middle-end can represent such paradoxical types, we set the TYPE_PRECISION to the width of the underlying type. */ TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type); ! set_min_and_max_values_for_integral_type (enumtype, precision, unsignedp); ! ! /* [dcl.enum] ! ! The value of sizeof() applied to an enumeration type, an object ! of an enumeration type, or an enumerator, is the value of sizeof() ! applied to the underlying type. */ ! TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type); ! TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type); ! TYPE_MODE (enumtype) = TYPE_MODE (underlying_type); ! TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type); ! TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type); ! TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type); ! /* Convert each of the enumerators to the type of the underlying type of the enumeration. */ for (values = TYPE_VALUES (enumtype); values; values = TREE_CHAIN (values)) --- 11171,11186 ---- underlying type in the range bmin to bmax, where bmin and bmax are, respectively, the smallest and largest values of the smallest bit- field that can store emin and emax. */ ! /* The middle-end currently assumes that types with TYPE_PRECISION narrower than their underlying type are suitably zero or sign extended to fill their mode. g++ doesn't make these guarantees. Until the middle-end can represent such paradoxical types, we set the TYPE_PRECISION to the width of the underlying type. */ TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type); ! set_min_and_max_values_for_integral_type (enumtype, precision, unsignedp); ! /* Convert each of the enumerators to the type of the underlying type of the enumeration. */ for (values = TYPE_VALUES (enumtype); values; values = TREE_CHAIN (values)) *************** finish_enum (tree enumtype) *** 10845,10852 **** decl = TREE_VALUE (values); saved_location = input_location; input_location = DECL_SOURCE_LOCATION (decl); ! value = perform_implicit_conversion (underlying_type, ! DECL_INITIAL (decl)); input_location = saved_location; /* Do not clobber shared ints. */ --- 11190,11203 ---- decl = TREE_VALUE (values); saved_location = input_location; input_location = DECL_SOURCE_LOCATION (decl); ! if (fixed_underlying_type_p) ! /* If the enumeration type has a fixed underlying type, we ! already checked all of the enumerator values. */ ! value = DECL_INITIAL (decl); ! else ! value = perform_implicit_conversion (underlying_type, ! DECL_INITIAL (decl), ! tf_warning_or_error); input_location = saved_location; /* Do not clobber shared ints. */ *************** finish_enum (tree enumtype) *** 10854,10860 **** TREE_TYPE (value) = enumtype; DECL_INITIAL (decl) = value; - TREE_VALUE (values) = value; } /* Fix up all variant types of this enum type. */ --- 11205,11210 ---- *************** finish_enum (tree enumtype) *** 10865,10877 **** TYPE_MAX_VALUE (t) = TYPE_MAX_VALUE (enumtype); TYPE_SIZE (t) = TYPE_SIZE (enumtype); TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (enumtype); ! TYPE_MODE (t) = TYPE_MODE (enumtype); TYPE_PRECISION (t) = TYPE_PRECISION (enumtype); TYPE_ALIGN (t) = TYPE_ALIGN (enumtype); TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype); TYPE_UNSIGNED (t) = TYPE_UNSIGNED (enumtype); } /* Finish debugging output for this type. */ rest_of_type_compilation (enumtype, namespace_bindings_p ()); } --- 11215,11232 ---- TYPE_MAX_VALUE (t) = TYPE_MAX_VALUE (enumtype); TYPE_SIZE (t) = TYPE_SIZE (enumtype); TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (enumtype); ! SET_TYPE_MODE (t, TYPE_MODE (enumtype)); TYPE_PRECISION (t) = TYPE_PRECISION (enumtype); TYPE_ALIGN (t) = TYPE_ALIGN (enumtype); TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype); TYPE_UNSIGNED (t) = TYPE_UNSIGNED (enumtype); + ENUM_UNDERLYING_TYPE (t) = ENUM_UNDERLYING_TYPE (enumtype); } + /* Finish up the scope of a scoped enumeration. */ + if (SCOPED_ENUM_P (enumtype)) + finish_scope (); + /* Finish debugging output for this type. */ rest_of_type_compilation (enumtype, namespace_bindings_p ()); } *************** build_enumerator (tree name, tree value, *** 10953,10976 **** /* Remove no-op casts from the value. */ STRIP_TYPE_NOPS (value); } /* C++ associates enums with global, function, or class declarations. */ context = current_scope (); /* Build the actual enumeration constant. Note that the enumeration ! constants have the type of their initializers until the ! enumeration is complete: ! [ dcl.enum ] ! Following the closing brace of an enum-specifier, each enumer- ! ator has the type of its enumeration. Prior to the closing ! brace, the type of each enumerator is the type of its ! initializing value. ! In finish_enum we will reset the type. Of course, if we're ! processing a template, there may be no value. */ type = value ? TREE_TYPE (value) : NULL_TREE; if (context && context == current_class_type) --- 11308,11351 ---- /* Remove no-op casts from the value. */ STRIP_TYPE_NOPS (value); + + /* If the underlying type of the enum is fixed, check whether + the enumerator values fits in the underlying type. If it + does not fit, the program is ill-formed [C++0x dcl.enum]. */ + if (ENUM_UNDERLYING_TYPE (enumtype) + && value + && TREE_CODE (value) == INTEGER_CST + && !int_fits_type_p (value, ENUM_UNDERLYING_TYPE (enumtype))) + { + error ("enumerator value %E is too large for underlying type %<%T%>", + value, ENUM_UNDERLYING_TYPE (enumtype)); + + /* Silently convert the value so that we can continue. */ + value = perform_implicit_conversion (ENUM_UNDERLYING_TYPE (enumtype), + value, tf_none); + } } /* C++ associates enums with global, function, or class declarations. */ context = current_scope (); /* Build the actual enumeration constant. Note that the enumeration ! constants have the underlying type of the enum (if it is fixed) ! or the type of their initializer (if the underlying type of the ! enum is not fixed): ! [ C++0x dcl.enum ] ! If the underlying type is fixed, the type of each enumerator ! prior to the closing brace is the underlying type; if the ! initializing value of an enumerator cannot be represented by ! the underlying type, the program is ill-formed. If the ! underlying type is not fixed, the type of each enumerator is ! the type of its initializing value. ! If the underlying type is not fixed, it will be computed by ! finish_enum and we will reset the type of this enumerator. Of ! course, if we're processing a template, there may be no value. */ type = value ? TREE_TYPE (value) : NULL_TREE; if (context && context == current_class_type) *************** build_enumerator (tree name, tree value, *** 10984,10990 **** DECL_CONTEXT (decl) = FROB_CONTEXT (context); TREE_CONSTANT (decl) = 1; - TREE_INVARIANT (decl) = 1; TREE_READONLY (decl) = 1; DECL_INITIAL (decl) = value; --- 11359,11364 ---- *************** build_enumerator (tree name, tree value, *** 11000,11005 **** --- 11374,11399 ---- TYPE_VALUES (enumtype) = tree_cons (name, decl, TYPE_VALUES (enumtype)); } + /* Look for an enumerator with the given NAME within the enumeration + type ENUMTYPE. This routine is used primarily for qualified name + lookup into an enumerator in C++0x, e.g., + + enum class Color { Red, Green, Blue }; + + Color color = Color::Red; + + Returns the value corresponding to the enumerator, or + NULL_TREE if no such enumerator was found. */ + tree + lookup_enumerator (tree enumtype, tree name) + { + tree e; + gcc_assert (enumtype && TREE_CODE (enumtype) == ENUMERAL_TYPE); + + e = purpose_member (name, TYPE_VALUES (enumtype)); + return e? TREE_VALUE (e) : NULL_TREE; + } + /* We're defining DECL. Make sure that it's type is OK. */ *************** check_function_type (tree decl, tree cur *** 11015,11021 **** if (dependent_type_p (return_type)) return; if (!COMPLETE_OR_VOID_TYPE_P (return_type) ! || (TYPE_FOR_JAVA (return_type) && IS_AGGR_TYPE (return_type))) { tree args = TYPE_ARG_TYPES (fntype); --- 11409,11415 ---- if (dependent_type_p (return_type)) return; if (!COMPLETE_OR_VOID_TYPE_P (return_type) ! || (TYPE_FOR_JAVA (return_type) && MAYBE_CLASS_TYPE_P (return_type))) { tree args = TYPE_ARG_TYPES (fntype); *************** start_preparsed_function (tree decl1, tr *** 11188,11194 **** { tree resdecl; ! resdecl = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (restype)); DECL_ARTIFICIAL (resdecl) = 1; DECL_IGNORED_P (resdecl) = 1; DECL_RESULT (decl1) = resdecl; --- 11582,11588 ---- { tree resdecl; ! resdecl = build_decl (RESULT_DECL, 0, restype); DECL_ARTIFICIAL (resdecl) = 1; DECL_IGNORED_P (resdecl) = 1; DECL_RESULT (decl1) = resdecl; *************** start_preparsed_function (tree decl1, tr *** 11285,11297 **** FIXME factor out the non-RTL stuff. */ bl = current_binding_level; allocate_struct_function (decl1, processing_template_decl); current_binding_level = bl; /* Even though we're inside a function body, we still don't want to call expand_expr to calculate the size of a variable-sized array. We haven't necessarily assigned RTL to all variables yet, so it's not safe to try to expand expressions involving them. */ ! cfun->x_dont_save_pending_sizes_p = 1; /* Start the statement-tree, start the tree now. */ DECL_SAVED_TREE (decl1) = push_stmt_list (); --- 11679,11696 ---- FIXME factor out the non-RTL stuff. */ bl = current_binding_level; allocate_struct_function (decl1, processing_template_decl); + + /* Initialize the language data structures. Whenever we start + a new function, we destroy temporaries in the usual way. */ + cfun->language = GGC_CNEW (struct language_function); + current_stmt_tree ()->stmts_are_full_exprs_p = 1; current_binding_level = bl; /* Even though we're inside a function body, we still don't want to call expand_expr to calculate the size of a variable-sized array. We haven't necessarily assigned RTL to all variables yet, so it's not safe to try to expand expressions involving them. */ ! cfun->dont_save_pending_sizes_p = 1; /* Start the statement-tree, start the tree now. */ DECL_SAVED_TREE (decl1) = push_stmt_list (); *************** start_preparsed_function (tree decl1, tr *** 11313,11319 **** gcc_assert (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE); cp_function_chain->x_current_class_ref ! = build_indirect_ref (t, NULL); cp_function_chain->x_current_class_ptr = t; /* Constructors and destructors need to know whether they're "in --- 11712,11718 ---- gcc_assert (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE); cp_function_chain->x_current_class_ref ! = cp_build_indirect_ref (t, NULL, tf_warning_or_error); cp_function_chain->x_current_class_ptr = t; /* Constructors and destructors need to know whether they're "in *************** start_function (cp_decl_specifier_seq *d *** 11451,11460 **** tree decl1; decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, &attrs); /* If the declarator is not suitable for a function definition, cause a syntax error. */ if (decl1 == NULL_TREE || TREE_CODE (decl1) != FUNCTION_DECL) ! return 0; if (DECL_MAIN_P (decl1)) /* main must return int. grokfndecl should have corrected it --- 11850,11864 ---- tree decl1; decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, &attrs); + if (decl1 == error_mark_node) + return 0; /* If the declarator is not suitable for a function definition, cause a syntax error. */ if (decl1 == NULL_TREE || TREE_CODE (decl1) != FUNCTION_DECL) ! { ! error ("invalid function declaration"); ! return 0; ! } if (DECL_MAIN_P (decl1)) /* main must return int. grokfndecl should have corrected it *************** finish_constructor_body (void) *** 11599,11605 **** tree val; tree exprstmt; ! if (targetm.cxx.cdtor_returns_this ()) { /* Any return from a constructor will end up here. */ add_stmt (build_stmt (LABEL_EXPR, cdtor_label)); --- 12003,12010 ---- tree val; tree exprstmt; ! if (targetm.cxx.cdtor_returns_this () ! && (! TYPE_FOR_JAVA (current_class_type))) { /* Any return from a constructor will end up here. */ add_stmt (build_stmt (LABEL_EXPR, cdtor_label)); *************** finish_function_body (tree compstmt) *** 11754,11760 **** of curly braces, skipping the artificial block created for constructor initializers. */ ! static tree outer_curly_brace_block (tree fndecl) { tree block = BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl)); --- 12159,12165 ---- of curly braces, skipping the artificial block created for constructor initializers. */ ! tree outer_curly_brace_block (tree fndecl) { tree block = BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl)); *************** finish_function (int flags) *** 11787,11792 **** --- 12192,12200 ---- if (fndecl == NULL_TREE) return error_mark_node; + gcc_assert (!defer_mark_used_calls); + defer_mark_used_calls = true; + if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fndecl) && DECL_VIRTUAL_P (fndecl) && !processing_template_decl) *************** finish_function (int flags) *** 11827,11840 **** /* Hack. We don't want the middle-end to warn that this return is unreachable, so put the statement on the special line 0. */ - #ifdef USE_MAPPED_LOCATION { location_t linezero = linemap_line_start (line_table, 0, 1); SET_EXPR_LOCATION (stmt, linezero); } - #else - annotate_with_file_line (stmt, input_filename, 0); - #endif } if (use_eh_spec_block (current_function_decl)) --- 12235,12244 ---- *************** finish_function (int flags) *** 11930,11942 **** /* Don't complain if we abort or throw. */ && !current_function_returns_abnormally && !DECL_NAME (DECL_RESULT (fndecl)) ! /* Normally, with -Wreturn-type, flow will complain. Unless we're an ! inline function, as we might never be compiled separately. */ ! && (DECL_INLINE (fndecl) || processing_template_decl) /* Structor return values (if any) are set by the compiler. */ && !DECL_CONSTRUCTOR_P (fndecl) && !DECL_DESTRUCTOR_P (fndecl)) ! warning (OPT_Wreturn_type, "no return statement in function returning non-void"); /* Store the end of the function, so that we get good line number info for the epilogue. */ --- 12334,12348 ---- /* Don't complain if we abort or throw. */ && !current_function_returns_abnormally && !DECL_NAME (DECL_RESULT (fndecl)) ! && !TREE_NO_WARNING (fndecl) /* Structor return values (if any) are set by the compiler. */ && !DECL_CONSTRUCTOR_P (fndecl) && !DECL_DESTRUCTOR_P (fndecl)) ! { ! warning (OPT_Wreturn_type, ! "no return statement in function returning non-void"); ! TREE_NO_WARNING (fndecl) = 1; ! } /* Store the end of the function, so that we get good line number info for the epilogue. */ *************** finish_function (int flags) *** 11958,11964 **** f->extern_decl_map = NULL; /* Handle attribute((warn_unused_result)). Relies on gimple input. */ ! c_warn_unused_result (&DECL_SAVED_TREE (fndecl)); } /* Clear out the bits we don't need. */ local_names = NULL; --- 12364,12370 ---- f->extern_decl_map = NULL; /* Handle attribute((warn_unused_result)). Relies on gimple input. */ ! c_warn_unused_result (gimple_body (fndecl)); } /* Clear out the bits we don't need. */ local_names = NULL; *************** finish_function (int flags) *** 11988,11993 **** --- 12394,12410 ---- cxx_pop_function_context and then reset via pop_function_context. */ current_function_decl = NULL_TREE; + defer_mark_used_calls = false; + if (deferred_mark_used_calls) + { + unsigned int i; + tree decl; + + for (i = 0; VEC_iterate (tree, deferred_mark_used_calls, i, decl); i++) + mark_used (decl); + VEC_free (tree, gc, deferred_mark_used_calls); + } + return fndecl; } *************** start_method (cp_decl_specifier_seq *dec *** 12047,12054 **** check_template_shadow (fndecl); DECL_DECLARED_INLINE_P (fndecl) = 1; ! if (flag_default_inline) ! DECL_INLINE (fndecl) = 1; /* We process method specializations in finish_struct_1. */ if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl)) --- 12464,12470 ---- check_template_shadow (fndecl); DECL_DECLARED_INLINE_P (fndecl) = 1; ! DECL_NO_INLINE_WARNING_P (fndecl) = 1; /* We process method specializations in finish_struct_1. */ if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl)) *************** maybe_register_incomplete_var (tree var) *** 12164,12170 **** } /* Called when a class type (given by TYPE) is defined. If there are ! any existing VAR_DECLs whose type hsa been completed by this declaration, update them now. */ void --- 12580,12586 ---- } /* Called when a class type (given by TYPE) is defined. If there are ! any existing VAR_DECLs whose type has been completed by this declaration, update them now. */ void *************** cxx_maybe_build_cleanup (tree decl) *** 12229,12241 **** initial checks on the attribute. Note that those checks include ensuring that the function found is not an overloaded function, or an object with an overloaded call operator, ! etc.; we can rely on the fact that the functionfound is an ordinary FUNCTION_DECL. */ fn = lookup_name (id); arg = build_address (decl); mark_used (decl); ! cleanup = build_function_call (fn, build_tree_list (NULL_TREE, ! arg)); } /* Handle ordinary C++ destructors. */ type = TREE_TYPE (decl); --- 12645,12658 ---- initial checks on the attribute. Note that those checks include ensuring that the function found is not an overloaded function, or an object with an overloaded call operator, ! etc.; we can rely on the fact that the function found is an ordinary FUNCTION_DECL. */ fn = lookup_name (id); arg = build_address (decl); mark_used (decl); ! cleanup = cp_build_function_call (fn, build_tree_list (NULL_TREE, ! arg), ! tf_warning_or_error); } /* Handle ordinary C++ destructors. */ type = TREE_TYPE (decl); *************** revert_static_member_fn (tree decl) *** 12299,12345 **** DECL_STATIC_FUNCTION_P (decl) = 1; } - /* Initialize the variables used during compilation of a C++ - function. */ - - void - cxx_push_function_context (struct function * f) - { - struct language_function *p = GGC_CNEW (struct language_function); - f->language = p; - - /* Whenever we start a new function, we destroy temporaries in the - usual way. */ - current_stmt_tree ()->stmts_are_full_exprs_p = 1; - - if (f->decl) - { - tree fn = f->decl; - - if (DECL_SAVED_FUNCTION_DATA (fn)) - { - /* If we already parsed this function, and we're just expanding it - now, restore saved state. */ - *cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn); - - /* We don't need the saved data anymore. Unless this is an inline - function; we need the named return value info for - declare_return_variable. */ - if (! DECL_INLINE (fn)) - DECL_SAVED_FUNCTION_DATA (fn) = NULL; - } - } - } - - /* Free the language-specific parts of F, now that we've finished - compiling the function. */ - - void - cxx_pop_function_context (struct function * f) - { - f->language = 0; - } - /* Return which tree structure is used by T, or TS_CP_GENERIC if T is one of the language-independent trees. */ --- 12716,12721 ---- diff -Nrcpad gcc-4.3.3/gcc/cp/decl.h gcc-4.4.0/gcc/cp/decl.h *** gcc-4.3.3/gcc/cp/decl.h Thu Aug 2 10:36:13 2007 --- gcc-4.4.0/gcc/cp/decl.h Tue Apr 7 04:38:10 2009 *************** *** 1,5 **** /* Variables and structures for declaration processing. ! Copyright (C) 1993, 2000, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. --- 1,5 ---- /* Variables and structures for declaration processing. ! Copyright (C) 1993, 2000, 2002, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. *************** enum decl_context *** 27,32 **** --- 27,33 ---- FIELD, /* Declaration inside struct or union */ BITFIELD, /* Likewise but with specified width */ TYPENAME, /* Typename (inside cast or sizeof) */ + TEMPLATE_TYPE_ARG, /* Almost the same as TYPENAME */ MEMFUNCDEF /* Member function definition */ }; *************** enum decl_context *** 34,36 **** --- 35,50 ---- extern tree grokdeclarator (const cp_declarator *, const cp_decl_specifier_seq *, enum decl_context, int, tree*); + + /* States indicating how grokdeclarator() should handle declspecs marked + with __attribute__((deprecated)). An object declared as + __attribute__((deprecated)) suppresses warnings of uses of other + deprecated items. */ + + enum deprecated_states { + DEPRECATED_NORMAL, + DEPRECATED_SUPPRESS + }; + + extern enum deprecated_states deprecated_state; + diff -Nrcpad gcc-4.3.3/gcc/cp/decl2.c gcc-4.4.0/gcc/cp/decl2.c *** gcc-4.3.3/gcc/cp/decl2.c Wed Jul 30 13:18:31 2008 --- gcc-4.4.0/gcc/cp/decl2.c Thu Mar 26 15:17:26 2009 *************** *** 1,6 **** /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,6 ---- /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** along with GCC; see the file COPYING3. *** 51,56 **** --- 51,57 ---- #include "c-pragma.h" #include "tree-dump.h" #include "intl.h" + #include "gimple.h" extern cpp_reader *parse_in; *************** grok_array_decl (tree array_expr, tree i *** 309,318 **** type = non_reference (type); /* If they have an `operator[]', use that. */ ! if (IS_AGGR_TYPE (type) || IS_AGGR_TYPE (TREE_TYPE (index_exp))) expr = build_new_op (ARRAY_REF, LOOKUP_NORMAL, array_expr, index_exp, NULL_TREE, ! /*overloaded_p=*/NULL); else { tree p1, p2, i1, i2; --- 310,319 ---- type = non_reference (type); /* If they have an `operator[]', use that. */ ! if (MAYBE_CLASS_TYPE_P (type) || MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp))) expr = build_new_op (ARRAY_REF, LOOKUP_NORMAL, array_expr, index_exp, NULL_TREE, ! /*overloaded_p=*/NULL, tf_warning_or_error); else { tree p1, p2, i1, i2; *************** grok_array_decl (tree array_expr, tree i *** 353,359 **** if (array_expr == error_mark_node || index_exp == error_mark_node) error ("ambiguous conversion for array subscript"); ! expr = build_array_ref (array_expr, index_exp); } if (processing_template_decl && expr != error_mark_node) return build_min_non_dep (ARRAY_REF, expr, orig_array_expr, orig_index_exp, --- 354,360 ---- if (array_expr == error_mark_node || index_exp == error_mark_node) error ("ambiguous conversion for array subscript"); ! expr = build_array_ref (array_expr, index_exp, input_location); } if (processing_template_decl && expr != error_mark_node) return build_min_non_dep (ARRAY_REF, expr, orig_array_expr, orig_index_exp, *************** check_member_template (tree tmpl) *** 444,450 **** if (TREE_CODE (decl) == FUNCTION_DECL || (TREE_CODE (decl) == TYPE_DECL ! && IS_AGGR_TYPE (TREE_TYPE (decl)))) { /* The parser rejects template declarations in local classes. */ gcc_assert (!current_function_decl); --- 445,451 ---- if (TREE_CODE (decl) == FUNCTION_DECL || (TREE_CODE (decl) == TYPE_DECL ! && MAYBE_CLASS_TYPE_P (TREE_TYPE (decl)))) { /* The parser rejects template declarations in local classes. */ gcc_assert (!current_function_decl); *************** check_classfn (tree ctype, tree function *** 571,579 **** either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */ if (TREE_CODE (function) == TEMPLATE_DECL) { ! gcc_assert (!template_parms ! || comp_template_parms (template_parms, ! DECL_TEMPLATE_PARMS (function))); template_parms = DECL_TEMPLATE_PARMS (function); } --- 572,585 ---- either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */ if (TREE_CODE (function) == TEMPLATE_DECL) { ! if (template_parms ! && !comp_template_parms (template_parms, ! DECL_TEMPLATE_PARMS (function))) ! { ! error ("template parameter lists provided don't match the " ! "template parameters of %qD", function); ! return error_mark_node; ! } template_parms = DECL_TEMPLATE_PARMS (function); } *************** check_classfn (tree ctype, tree function *** 637,644 **** return OVL_CURRENT (fndecls); } ! error ("prototype for %q#D does not match any in class %qT", ! function, ctype); is_conv_op = DECL_CONV_FN_P (fndecl); if (is_conv_op) --- 643,651 ---- return OVL_CURRENT (fndecls); } ! error_at (DECL_SOURCE_LOCATION (function), ! "prototype for %q#D does not match any in class %qT", ! function, ctype); is_conv_op = DECL_CONV_FN_P (fndecl); if (is_conv_op) *************** finish_static_data_member_decl (tree dec *** 717,724 **** VEC_safe_push (tree, gc, pending_statics, decl); if (LOCAL_CLASS_P (current_class_type)) ! pedwarn ("local class %q#T shall not have static data member %q#D", ! current_class_type, decl); /* Static consts need not be initialized in the class definition. */ if (init != NULL_TREE && TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))) --- 724,731 ---- VEC_safe_push (tree, gc, pending_statics, decl); if (LOCAL_CLASS_P (current_class_type)) ! permerror (input_location, "local class %q#T shall not have static data member %q#D", ! current_class_type, decl); /* Static consts need not be initialized in the class definition. */ if (init != NULL_TREE && TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))) *************** grokfield (const cp_declarator *declarat *** 801,807 **** value = push_template_decl (value); if (attrlist) ! cplus_decl_attributes (&value, attrlist, 0); return value; } --- 808,824 ---- value = push_template_decl (value); if (attrlist) ! { ! int attrflags = 0; ! ! /* If this is a typedef that names the class for linkage purposes ! (7.1.3p8), apply any attributes directly to the type. */ ! if (TAGGED_TYPE_P (TREE_TYPE (value)) ! && value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value)))) ! attrflags = ATTR_FLAG_TYPE_IN_PLACE; ! ! cplus_decl_attributes (&value, attrlist, attrflags); ! } return value; } *************** grokfield (const cp_declarator *declarat *** 821,827 **** { /* Initializers for functions are rejected early in the parser. If we get here, it must be a pure specifier for a method. */ ! if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE) { gcc_assert (error_operand_p (init) || integer_zerop (init)); DECL_PURE_VIRTUAL_P (value) = 1; --- 838,861 ---- { /* Initializers for functions are rejected early in the parser. If we get here, it must be a pure specifier for a method. */ ! if (init == ridpointers[(int)RID_DELETE]) ! { ! DECL_DELETED_FN (value) = 1; ! DECL_DECLARED_INLINE_P (value) = 1; ! DECL_INITIAL (value) = error_mark_node; ! } ! else if (init == ridpointers[(int)RID_DEFAULT]) ! { ! if (!defaultable_fn_p (value)) ! error ("%qD cannot be defaulted", value); ! else ! { ! DECL_DEFAULTED_FN (value) = 1; ! DECL_INITIALIZED_IN_CLASS_P (value) = 1; ! DECL_DECLARED_INLINE_P (value) = 1; ! } ! } ! else if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE) { gcc_assert (error_operand_p (init) || integer_zerop (init)); DECL_PURE_VIRTUAL_P (value) = 1; *************** build_anon_union_vars (tree type, tree o *** 1242,1263 **** continue; if (TREE_CODE (field) != FIELD_DECL) { ! pedwarn ("%q+#D invalid; an anonymous union can only " ! "have non-static data members", field); continue; } if (TREE_PRIVATE (field)) ! pedwarn ("private member %q+#D in anonymous union", field); else if (TREE_PROTECTED (field)) ! pedwarn ("protected member %q+#D in anonymous union", field); if (processing_template_decl) ref = build_min_nt (COMPONENT_REF, object, DECL_NAME (field), NULL_TREE); else ref = build_class_member_access_expr (object, field, NULL_TREE, ! false); if (DECL_NAME (field)) { --- 1276,1297 ---- continue; if (TREE_CODE (field) != FIELD_DECL) { ! permerror (input_location, "%q+#D invalid; an anonymous union can only " ! "have non-static data members", field); continue; } if (TREE_PRIVATE (field)) ! permerror (input_location, "private member %q+#D in anonymous union", field); else if (TREE_PROTECTED (field)) ! permerror (input_location, "protected member %q+#D in anonymous union", field); if (processing_template_decl) ref = build_min_nt (COMPONENT_REF, object, DECL_NAME (field), NULL_TREE); else ref = build_class_member_access_expr (object, field, NULL_TREE, ! false, tf_warning_or_error); if (DECL_NAME (field)) { *************** finish_anon_union (tree anon_union_decl) *** 1330,1335 **** --- 1364,1370 ---- { /* Use main_decl to set the mangled name. */ DECL_NAME (anon_union_decl) = DECL_NAME (main_decl); + maybe_commonize_var (anon_union_decl); mangle_decl (anon_union_decl); DECL_NAME (anon_union_decl) = NULL_TREE; } *************** coerce_new_type (tree type) *** 1385,1392 **** e = 2; if (e == 2) ! pedwarn ("% takes type % (%qT) " ! "as first parameter", size_type_node); switch (e) { --- 1420,1427 ---- e = 2; if (e == 2) ! permerror (input_location, "% takes type % (%qT) " ! "as first parameter", size_type_node); switch (e) { *************** determine_visibility (tree decl) *** 1887,1892 **** --- 1922,1929 ---- { tree class_type = NULL_TREE; bool use_template; + bool orig_visibility_specified; + enum symbol_visibility orig_visibility; /* Remember that all decls get VISIBILITY_DEFAULT when built. */ *************** determine_visibility (tree decl) *** 1899,1904 **** --- 1936,1944 ---- maybe_clone_body. */ gcc_assert (!DECL_CLONED_FUNCTION_P (decl)); + orig_visibility_specified = DECL_VISIBILITY_SPECIFIED (decl); + orig_visibility = DECL_VISIBILITY (decl); + if (TREE_CODE (decl) == TYPE_DECL) { if (CLASS_TYPE_P (TREE_TYPE (decl))) *************** determine_visibility (tree decl) *** 1963,1968 **** --- 2003,2016 ---- /* tinfo visibility is based on the type it's for. */ constrain_visibility (decl, type_visibility (TREE_TYPE (DECL_NAME (decl)))); + + /* Give the target a chance to override the visibility associated + with DECL. */ + if (TREE_PUBLIC (decl) + && !DECL_REALLY_EXTERN (decl) + && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl))) + && !CLASSTYPE_VISIBILITY_SPECIFIED (TREE_TYPE (DECL_NAME (decl)))) + targetm.cxx.determine_class_data_visibility (decl); } else if (use_template) /* Template instantiations and specializations get visibility based *************** determine_visibility (tree decl) *** 2019,2024 **** --- 2067,2081 ---- || ! DECL_VISIBILITY_SPECIFIED (decl)) constrain_visibility (decl, tvis); } + + /* If visibility changed and DECL already has DECL_RTL, ensure + symbol flags are updated. */ + if ((DECL_VISIBILITY (decl) != orig_visibility + || DECL_VISIBILITY_SPECIFIED (decl) != orig_visibility_specified) + && ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)) + || TREE_CODE (decl) == FUNCTION_DECL) + && DECL_RTL_SET_P (decl)) + make_decl_rtl (decl); } /* By default, static data members and function members receive *************** constrain_class_visibility (tree type) *** 2096,2102 **** %qT has a field %qD whose type uses the anonymous namespace", type, t); } ! else if (IS_AGGR_TYPE (ftype) && vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) warning (OPT_Wattributes, "\ --- 2153,2159 ---- %qT has a field %qD whose type uses the anonymous namespace", type, t); } ! else if (MAYBE_CLASS_TYPE_P (ftype) && vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) warning (OPT_Wattributes, "\ *************** get_guard_cond (tree guard) *** 2503,2515 **** guard_value = integer_one_node; if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))) guard_value = convert (TREE_TYPE (guard), guard_value); ! guard = cp_build_binary_op (BIT_AND_EXPR, guard, guard_value); } guard_value = integer_zero_node; if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))) guard_value = convert (TREE_TYPE (guard), guard_value); ! return cp_build_binary_op (EQ_EXPR, guard, guard_value); } /* Return an expression which sets the GUARD variable, indicating that --- 2560,2576 ---- guard_value = integer_one_node; if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))) guard_value = convert (TREE_TYPE (guard), guard_value); ! guard = cp_build_binary_op (input_location, ! BIT_AND_EXPR, guard, guard_value, ! tf_warning_or_error); } guard_value = integer_zero_node; if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))) guard_value = convert (TREE_TYPE (guard), guard_value); ! return cp_build_binary_op (input_location, ! EQ_EXPR, guard, guard_value, ! tf_warning_or_error); } /* Return an expression which sets the GUARD variable, indicating that *************** set_guard (tree guard) *** 2525,2531 **** guard_init = integer_one_node; if (!same_type_p (TREE_TYPE (guard_init), TREE_TYPE (guard))) guard_init = convert (TREE_TYPE (guard), guard_init); ! return build_modify_expr (guard, NOP_EXPR, guard_init); } /* Start the process of running a particular set of global constructors --- 2586,2593 ---- guard_init = integer_one_node; if (!same_type_p (TREE_TYPE (guard_init), TREE_TYPE (guard))) guard_init = convert (TREE_TYPE (guard), guard_init); ! return cp_build_modify_expr (guard, NOP_EXPR, guard_init, ! tf_warning_or_error); } /* Start the process of running a particular set of global constructors *************** start_static_storage_duration_function ( *** 2672,2678 **** type); TREE_PUBLIC (ssdf_decl) = 0; DECL_ARTIFICIAL (ssdf_decl) = 1; - DECL_INLINE (ssdf_decl) = 1; /* Put this function in the list of functions to be called from the static constructors and destructors. */ --- 2734,2739 ---- *************** one_static_initialization_or_destruction *** 2898,2915 **** last to destroy the variable. */ else if (initp) guard_cond ! = cp_build_binary_op (EQ_EXPR, ! build_unary_op (PREINCREMENT_EXPR, ! guard, ! /*noconvert=*/1), ! integer_one_node); else guard_cond ! = cp_build_binary_op (EQ_EXPR, ! build_unary_op (PREDECREMENT_EXPR, ! guard, ! /*noconvert=*/1), ! integer_zero_node); guard_if_stmt = begin_if_stmt (); finish_if_stmt_cond (guard_cond, guard_if_stmt); --- 2959,2982 ---- last to destroy the variable. */ else if (initp) guard_cond ! = cp_build_binary_op (input_location, ! EQ_EXPR, ! cp_build_unary_op (PREINCREMENT_EXPR, ! guard, ! /*noconvert=*/1, ! tf_warning_or_error), ! integer_one_node, ! tf_warning_or_error); else guard_cond ! = cp_build_binary_op (input_location, ! EQ_EXPR, ! cp_build_unary_op (PREDECREMENT_EXPR, ! guard, ! /*noconvert=*/1, ! tf_warning_or_error), ! integer_zero_node, ! tf_warning_or_error); guard_if_stmt = begin_if_stmt (); finish_if_stmt_cond (guard_cond, guard_if_stmt); *************** do_static_initialization_or_destruction *** 2960,2968 **** /* Build the outer if-stmt to check for initialization or destruction. */ init_if_stmt = begin_if_stmt (); cond = initp ? integer_one_node : integer_zero_node; ! cond = cp_build_binary_op (EQ_EXPR, ! initialize_p_decl, ! cond); finish_if_stmt_cond (cond, init_if_stmt); node = vars; --- 3027,3037 ---- /* Build the outer if-stmt to check for initialization or destruction. */ init_if_stmt = begin_if_stmt (); cond = initp ? integer_one_node : integer_zero_node; ! cond = cp_build_binary_op (input_location, ! EQ_EXPR, ! initialize_p_decl, ! cond, ! tf_warning_or_error); finish_if_stmt_cond (cond, init_if_stmt); node = vars; *************** do_static_initialization_or_destruction *** 2992,3000 **** /* Conditionalize this initialization on being in the right priority and being initializing/finalizing appropriately. */ priority_if_stmt = begin_if_stmt (); ! cond = cp_build_binary_op (EQ_EXPR, priority_decl, ! build_int_cst (NULL_TREE, priority)); finish_if_stmt_cond (cond, priority_if_stmt); /* Process initializers with same priority. */ --- 3061,3071 ---- /* Conditionalize this initialization on being in the right priority and being initializing/finalizing appropriately. */ priority_if_stmt = begin_if_stmt (); ! cond = cp_build_binary_op (input_location, ! EQ_EXPR, priority_decl, ! build_int_cst (NULL_TREE, priority), ! tf_warning_or_error); finish_if_stmt_cond (cond, priority_if_stmt); /* Process initializers with same priority. */ *************** generate_ctor_or_dtor_function (bool con *** 3107,3117 **** size_t i; input_location = *locus; - #ifdef USE_MAPPED_LOCATION /* ??? */ ! #else ! locus->line++; ! #endif /* We use `I' to indicate initialization and `D' to indicate destruction. */ --- 3178,3185 ---- size_t i; input_location = *locus; /* ??? */ ! /* Was: locus->line++; */ /* We use `I' to indicate initialization and `D' to indicate destruction. */ *************** generate_ctor_or_dtor_function (bool con *** 3146,3152 **** arguments = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, constructor_p), arguments); ! finish_expr_stmt (build_function_call (fndecl, arguments)); } } --- 3214,3221 ---- arguments = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, constructor_p), arguments); ! finish_expr_stmt (cp_build_function_call (fndecl, arguments, ! tf_warning_or_error)); } } *************** cp_write_global_declarations (void) *** 3291,3303 **** if (pch_file) c_common_write_pch (); ! #ifdef USE_MAPPED_LOCATION ! /* FIXME - huh? */ ! #else ! /* Otherwise, GDB can get confused, because in only knows ! about source for LINENO-1 lines. */ ! input_line -= 1; ! #endif /* We now have to write out all the stuff we put off writing out. These include: --- 3360,3366 ---- if (pch_file) c_common_write_pch (); ! /* FIXME - huh? was input_line -= 1;*/ /* We now have to write out all the stuff we put off writing out. These include: *************** cp_write_global_declarations (void) *** 3430,3440 **** instantiations, etc. */ reconsider = true; ssdf_count++; ! #ifdef USE_MAPPED_LOCATION ! /* ??? */ ! #else ! locus.line++; ! #endif } /* Go through the set of inline functions whose bodies have not --- 3493,3499 ---- instantiations, etc. */ reconsider = true; ssdf_count++; ! /* ??? was: locus.line++; */ } /* Go through the set of inline functions whose bodies have not *************** cp_write_global_declarations (void) *** 3443,3450 **** for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i) { /* Does it need synthesizing? */ ! if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl) ! && (! DECL_REALLY_EXTERN (decl) || DECL_INLINE (decl))) { /* Even though we're already at the top-level, we push there again. That way, when we pop back a few lines --- 3502,3509 ---- for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i) { /* Does it need synthesizing? */ ! if (DECL_DEFAULTED_FN (decl) && ! DECL_INITIAL (decl) ! && (! DECL_REALLY_EXTERN (decl) || possibly_inlined_p (decl))) { /* Even though we're already at the top-level, we push there again. That way, when we pop back a few lines *************** cp_write_global_declarations (void) *** 3461,3467 **** reconsider = true; } ! if (!DECL_SAVED_TREE (decl)) continue; /* We lie to the back end, pretending that some functions --- 3520,3526 ---- reconsider = true; } ! if (!gimple_body (decl)) continue; /* We lie to the back end, pretending that some functions *************** build_offset_ref_call_from_tree (tree fn *** 3659,3665 **** args = build_non_dependent_args (args); object = build_non_dependent_expr (object); if (TREE_CODE (fn) == DOTSTAR_EXPR) ! object = build_unary_op (ADDR_EXPR, object, 0); args = tree_cons (NULL_TREE, object, args); /* Now that the arguments are done, transform FN. */ fn = build_non_dependent_expr (fn); --- 3718,3724 ---- args = build_non_dependent_args (args); object = build_non_dependent_expr (object); if (TREE_CODE (fn) == DOTSTAR_EXPR) ! object = cp_build_unary_op (ADDR_EXPR, object, 0, tf_warning_or_error); args = tree_cons (NULL_TREE, object, args); /* Now that the arguments are done, transform FN. */ fn = build_non_dependent_expr (fn); *************** build_offset_ref_call_from_tree (tree fn *** 3673,3685 **** void B::g() { (this->*p)(); } */ if (TREE_CODE (fn) == OFFSET_REF) { ! tree object_addr = build_unary_op (ADDR_EXPR, object, 0); fn = TREE_OPERAND (fn, 1); fn = get_member_function_from_ptrfunc (&object_addr, fn); args = tree_cons (NULL_TREE, object_addr, args); } ! expr = build_function_call (fn, args); if (processing_template_decl && expr != error_mark_node) return build_min_non_dep_call_list (expr, orig_fn, orig_args); return expr; --- 3732,3745 ---- void B::g() { (this->*p)(); } */ if (TREE_CODE (fn) == OFFSET_REF) { ! tree object_addr = cp_build_unary_op (ADDR_EXPR, object, 0, ! tf_warning_or_error); fn = TREE_OPERAND (fn, 1); fn = get_member_function_from_ptrfunc (&object_addr, fn); args = tree_cons (NULL_TREE, object_addr, args); } ! expr = cp_build_function_call (fn, args, tf_warning_or_error); if (processing_template_decl && expr != error_mark_node) return build_min_non_dep_call_list (expr, orig_fn, orig_args); return expr; *************** check_default_args (tree x) *** 3704,3709 **** --- 3764,3785 ---- } } + /* Return true if function DECL can be inlined. This is used to force + instantiation of methods that might be interesting for inlining. */ + bool + possibly_inlined_p (tree decl) + { + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); + if (DECL_UNINLINABLE (decl)) + return false; + if (!optimize || pragma_java_exceptions) + return DECL_DECLARED_INLINE_P (decl); + /* When optimizing, we might inline everything when flatten + attribute or heuristics inlining for size or autoinlining + is used. */ + return true; + } + /* Mark DECL (either a _DECL or a BASELINK) as "used" in the program. If DECL is a specialization or implicitly declared class member, generate the actual definition. */ *************** mark_used (tree decl) *** 3728,3736 **** --- 3804,3827 ---- TREE_USED (decl) = 1; if (DECL_CLONED_FUNCTION_P (decl)) TREE_USED (DECL_CLONED_FUNCTION (decl)) = 1; + if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_DELETED_FN (decl)) + { + error ("deleted function %q+D", decl); + error ("used here"); + } /* If we don't need a value, then we don't need to synthesize DECL. */ if (skip_evaluation) return; + + /* If within finish_function, defer the rest until that function + finishes, otherwise it might recurse. */ + if (defer_mark_used_calls) + { + VEC_safe_push (tree, gc, deferred_mark_used_calls, decl); + return; + } + /* Normally, we can wait until instantiation-time to synthesize DECL. However, if DECL is a static data member initialized with a constant, we need the value right now because a reference to *************** mark_used (tree decl) *** 3773,3784 **** note_vague_linkage_fn (decl); } - assemble_external (decl); - /* Is it a synthesized method that needs to be synthesized? */ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl) ! && DECL_ARTIFICIAL (decl) && !DECL_THUNK_P (decl) && ! DECL_INITIAL (decl) /* Kludge: don't synthesize for default args. Unfortunately this --- 3864,3873 ---- note_vague_linkage_fn (decl); } /* Is it a synthesized method that needs to be synthesized? */ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl) ! && DECL_DEFAULTED_FN (decl) && !DECL_THUNK_P (decl) && ! DECL_INITIAL (decl) /* Kludge: don't synthesize for default args. Unfortunately this *************** mark_used (tree decl) *** 3795,3802 **** && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl) && (!DECL_EXPLICIT_INSTANTIATION (decl) || (TREE_CODE (decl) == FUNCTION_DECL ! && DECL_INLINE (DECL_TEMPLATE_RESULT ! (template_for_substitution (decl)))) /* We need to instantiate static data members so that there initializers are available in integral constant expressions. */ --- 3884,3892 ---- && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl) && (!DECL_EXPLICIT_INSTANTIATION (decl) || (TREE_CODE (decl) == FUNCTION_DECL ! && possibly_inlined_p ! (DECL_TEMPLATE_RESULT ( ! template_for_substitution (decl)))) /* We need to instantiate static data members so that there initializers are available in integral constant expressions. */ *************** mark_used (tree decl) *** 3817,3820 **** --- 3907,3933 ---- processing_template_decl = saved_processing_template_decl; } + /* Given function PARM_DECL PARM, return its index in the function's list + of parameters, beginning with 1. */ + + int + parm_index (tree parm) + { + int index; + tree arg; + + for (index = 1, arg = DECL_ARGUMENTS (DECL_CONTEXT (parm)); + arg; + ++index, arg = TREE_CHAIN (arg)) + { + if (DECL_NAME (parm) == DECL_NAME (arg)) + break; + if (DECL_ARTIFICIAL (arg)) + --index; + } + + gcc_assert (arg); + return index; + } + #include "gt-cp-decl2.h" diff -Nrcpad gcc-4.3.3/gcc/cp/dump.c gcc-4.4.0/gcc/cp/dump.c *** gcc-4.3.3/gcc/cp/dump.c Thu Aug 2 10:36:13 2007 --- gcc-4.4.0/gcc/cp/dump.c Fri Mar 21 18:56:51 2008 *************** *** 1,5 **** /* Tree-dumping functionality for intermediate representation. ! Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Mark Mitchell --- 1,5 ---- /* Tree-dumping functionality for intermediate representation. ! Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Written by Mark Mitchell *************** cp_dump_tree (void* dump_info, tree t) *** 257,263 **** return true; } ! if (! IS_AGGR_TYPE (t)) break; dump_child ("vfld", TYPE_VFIELD (t)); --- 257,263 ---- return true; } ! if (! MAYBE_CLASS_TYPE_P (t)) break; dump_child ("vfld", TYPE_VFIELD (t)); diff -Nrcpad gcc-4.3.3/gcc/cp/error.c gcc-4.4.0/gcc/cp/error.c *** gcc-4.3.3/gcc/cp/error.c Wed Nov 19 22:36:31 2008 --- gcc-4.4.0/gcc/cp/error.c Tue Apr 7 04:38:10 2009 *************** *** 1,7 **** /* Call-backs for C++ error reporting. This code is non-reentrant. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, ! 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify --- 1,7 ---- /* Call-backs for C++ error reporting. This code is non-reentrant. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, ! 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify *************** dump_type (tree t, int flags) *** 284,290 **** switch (TREE_CODE (t)) { case UNKNOWN_TYPE: ! pp_identifier (cxx_pp, ""); break; case TREE_LIST: --- 284,293 ---- switch (TREE_CODE (t)) { case UNKNOWN_TYPE: ! if (t == init_list_type_node) ! pp_identifier (cxx_pp, ""); ! else ! pp_identifier (cxx_pp, ""); break; case TREE_LIST: *************** dump_typename (tree t, int flags) *** 444,451 **** const char * class_key_or_enum_as_string (tree t) { ! if (TREE_CODE (t) == ENUMERAL_TYPE) ! return "enum"; else if (TREE_CODE (t) == UNION_TYPE) return "union"; else if (TYPE_LANG_SPECIFIC (t) && CLASSTYPE_DECLARED_CLASS (t)) --- 447,459 ---- const char * class_key_or_enum_as_string (tree t) { ! if (TREE_CODE (t) == ENUMERAL_TYPE) ! { ! if (SCOPED_ENUM_P (t)) ! return "enum class"; ! else ! return "enum"; ! } else if (TREE_CODE (t) == UNION_TYPE) return "union"; else if (TYPE_LANG_SPECIFIC (t) && CLASSTYPE_DECLARED_CLASS (t)) *************** dump_type_prefix (tree t, int flags) *** 542,548 **** tree sub = TREE_TYPE (t); dump_type_prefix (sub, flags); ! if (TREE_CODE (sub) == ARRAY_TYPE) { pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); --- 550,557 ---- tree sub = TREE_TYPE (t); dump_type_prefix (sub, flags); ! if (TREE_CODE (sub) == ARRAY_TYPE ! || TREE_CODE (sub) == FUNCTION_TYPE) { pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); *************** dump_type_prefix (tree t, int flags) *** 577,588 **** pp_base (cxx_pp)->padding = pp_before; break; ! /* Can only be reached through function pointer -- this would not be ! correct if FUNCTION_DECLs used it. */ case FUNCTION_TYPE: dump_type_prefix (TREE_TYPE (t), flags); - pp_maybe_space (cxx_pp); - pp_cxx_left_paren (cxx_pp); break; case METHOD_TYPE: --- 586,595 ---- pp_base (cxx_pp)->padding = pp_before; break; ! /* This can be reached without a pointer when dealing with ! templates, e.g. std::is_function. */ case FUNCTION_TYPE: dump_type_prefix (TREE_TYPE (t), flags); break; case METHOD_TYPE: *************** dump_type_prefix (tree t, int flags) *** 618,623 **** --- 625,631 ---- case TYPEOF_TYPE: case DECLTYPE_TYPE: case TYPE_PACK_EXPANSION: + case FIXED_POINT_TYPE: dump_type (t, flags); pp_base (cxx_pp)->padding = pp_before; break; *************** dump_type_suffix (tree t, int flags) *** 645,661 **** case POINTER_TYPE: case REFERENCE_TYPE: case OFFSET_TYPE: ! if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) pp_cxx_right_paren (cxx_pp); dump_type_suffix (TREE_TYPE (t), flags); break; - /* Can only be reached through function pointer. */ case FUNCTION_TYPE: case METHOD_TYPE: { tree arg; ! pp_cxx_right_paren (cxx_pp); arg = TYPE_ARG_TYPES (t); if (TREE_CODE (t) == METHOD_TYPE) arg = TREE_CHAIN (arg); --- 653,671 ---- case POINTER_TYPE: case REFERENCE_TYPE: case OFFSET_TYPE: ! if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE ! || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) pp_cxx_right_paren (cxx_pp); dump_type_suffix (TREE_TYPE (t), flags); break; case FUNCTION_TYPE: case METHOD_TYPE: { tree arg; ! if (TREE_CODE (t) == METHOD_TYPE) ! /* Can only be reached through a pointer. */ ! pp_cxx_right_paren (cxx_pp); arg = TYPE_ARG_TYPES (t); if (TREE_CODE (t) == METHOD_TYPE) arg = TREE_CHAIN (arg); *************** dump_type_suffix (tree t, int flags) *** 668,674 **** pp_cxx_cv_qualifier_seq (cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); else ! pp_cxx_cv_qualifier_seq(cxx_pp, t); dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags); dump_type_suffix (TREE_TYPE (t), flags); break; --- 678,684 ---- pp_cxx_cv_qualifier_seq (cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); else ! pp_cxx_cv_qualifier_seq (cxx_pp, t); dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags); dump_type_suffix (TREE_TYPE (t), flags); break; *************** dump_type_suffix (tree t, int flags) *** 716,721 **** --- 726,732 ---- case TYPEOF_TYPE: case DECLTYPE_TYPE: case TYPE_PACK_EXPANSION: + case FIXED_POINT_TYPE: break; default: *************** dump_function_decl (tree t, int flags) *** 1078,1088 **** --- 1089,1104 ---- tree template_parms = NULL_TREE; int show_return = flags & TFF_RETURN_TYPE || flags & TFF_DECL_SPECIFIERS; int do_outer_scope = ! (flags & TFF_UNQUALIFIED_NAME); + tree exceptions; flags &= ~TFF_UNQUALIFIED_NAME; if (TREE_CODE (t) == TEMPLATE_DECL) t = DECL_TEMPLATE_RESULT (t); + /* Save the exceptions, in case t is a specialization and we are + emitting an error about incompatible specifications. */ + exceptions = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (t)); + /* Pretty print template instantiations only. */ if (DECL_USE_TEMPLATE (t) && DECL_TEMPLATE_INFO (t)) { *************** dump_function_decl (tree t, int flags) *** 1147,1153 **** if (flags & TFF_EXCEPTION_SPECIFICATION) { pp_base (cxx_pp)->padding = pp_before; ! dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype), flags); } if (show_return) --- 1163,1169 ---- if (flags & TFF_EXCEPTION_SPECIFICATION) { pp_base (cxx_pp)->padding = pp_before; ! dump_exception_spec (exceptions, flags); } if (show_return) *************** dump_expr (tree t, int flags) *** 1493,1500 **** break; case THROW_EXPR: ! pp_cxx_identifier (cxx_pp, "throw"); ! dump_expr (TREE_OPERAND (t, 0), flags); break; case PTRMEM_CST: --- 1509,1517 ---- break; case THROW_EXPR: ! /* While waiting for caret diagnostics, avoid printing ! __cxa_allocate_exception, __cxa_throw, and the like. */ ! pp_cxx_identifier (cxx_pp, ""); break; case PTRMEM_CST: *************** dump_expr (tree t, int flags) *** 1586,1628 **** } break; - case NEW_EXPR: - { - tree type = TREE_OPERAND (t, 1); - tree init = TREE_OPERAND (t, 2); - if (NEW_EXPR_USE_GLOBAL (t)) - pp_cxx_colon_colon (cxx_pp); - pp_cxx_identifier (cxx_pp, "new"); - if (TREE_OPERAND (t, 0)) - { - pp_cxx_left_paren (cxx_pp); - dump_expr_list (TREE_OPERAND (t, 0), flags); - pp_cxx_right_paren (cxx_pp); - pp_cxx_whitespace (cxx_pp); - } - if (TREE_CODE (type) == ARRAY_REF) - type = build_cplus_array_type - (TREE_OPERAND (type, 0), - build_index_type (fold_build2 (MINUS_EXPR, integer_type_node, - TREE_OPERAND (type, 1), - integer_one_node))); - dump_type (type, flags); - if (init) - { - pp_cxx_left_paren (cxx_pp); - if (TREE_CODE (init) == TREE_LIST) - dump_expr_list (init, flags); - else if (init == void_zero_node) - /* This representation indicates an empty initializer, - e.g.: "new int()". */ - ; - else - dump_expr (init, flags); - pp_cxx_right_paren (cxx_pp); - } - } - break; - case TARGET_EXPR: /* Note that this only works for G++ target exprs. If somebody builds a general TARGET_EXPR, there's no way to represent that --- 1603,1608 ---- *************** dump_expr (tree t, int flags) *** 1786,1793 **** dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS); break; ! case NOP_EXPR: ! case CONVERT_EXPR: case VIEW_CONVERT_EXPR: { tree op = TREE_OPERAND (t, 0); --- 1766,1772 ---- dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS); break; ! CASE_CONVERT: case VIEW_CONVERT_EXPR: { tree op = TREE_OPERAND (t, 0); *************** dump_expr (tree t, int flags) *** 2002,2007 **** --- 1981,1987 ---- case BIND_EXPR: case STMT_EXPR: + case EXPR_STMT: case STATEMENT_LIST: /* We don't yet have a way of dumping statements in a human-readable format. */ *************** dump_expr (tree t, int flags) *** 2078,2083 **** --- 2058,2065 ---- case TYPEID_EXPR: case MEMBER_REF: case DOTSTAR_EXPR: + case NEW_EXPR: + case VEC_NEW_EXPR: case DELETE_EXPR: case VEC_DELETE_EXPR: case MODOP_EXPR: *************** dump_expr (tree t, int flags) *** 2093,2098 **** --- 2075,2084 ---- case UNGE_EXPR: case UNEQ_EXPR: case LTGT_EXPR: + case COMPLEX_EXPR: + case BIT_FIELD_REF: + case FIX_TRUNC_EXPR: + case FLOAT_EXPR: pp_expression (cxx_pp, t); break; *************** cp_print_error_function (diagnostic_cont *** 2483,2496 **** pp_base_newline (context->printer); if (s.file != NULL) { - #ifdef USE_MAPPED_LOCATION if (flag_show_column && s.column != 0) pp_printf (context->printer, " inlined from %qs at %s:%d:%d", cxx_printable_name (fndecl, 2), s.file, s.line, s.column); else - #endif pp_printf (context->printer, " inlined from %qs at %s:%d", cxx_printable_name (fndecl, 2), --- 2469,2480 ---- *************** cp_cpp_error (cpp_reader *pfile ATTRIBUT *** 2700,2706 **** dlevel = DK_WARNING; break; case CPP_DL_PEDWARN: ! dlevel = pedantic_error_kind (); break; case CPP_DL_ERROR: dlevel = DK_ERROR; --- 2684,2690 ---- dlevel = DK_WARNING; break; case CPP_DL_PEDWARN: ! dlevel = DK_PEDWARN; break; case CPP_DL_ERROR: dlevel = DK_ERROR; *************** cp_cpp_error (cpp_reader *pfile ATTRIBUT *** 2716,2728 **** report_diagnostic (&diagnostic); } ! /* Warn about the use of variadic templates when appropriate. */ void ! maybe_warn_variadic_templates (void) { if ((cxx_dialect == cxx98) && !in_system_header) /* We really want to suppress this warning in system headers, because libstdc++ uses variadic templates even when we aren't in C++0x mode. */ ! pedwarn ("ISO C++ does not include variadic templates"); } --- 2700,2719 ---- report_diagnostic (&diagnostic); } ! /* Warn about the use of C++0x features when appropriate. */ void ! maybe_warn_cpp0x (const char* str) { if ((cxx_dialect == cxx98) && !in_system_header) /* We really want to suppress this warning in system headers, because libstdc++ uses variadic templates even when we aren't in C++0x mode. */ ! pedwarn (input_location, 0, "%s only available with -std=c++0x or -std=gnu++0x", str); ! } ! ! /* Warn about the use of variadic templates when appropriate. */ ! void ! maybe_warn_variadic_templates (void) ! { ! maybe_warn_cpp0x ("variadic templates"); } diff -Nrcpad gcc-4.3.3/gcc/cp/except.c gcc-4.4.0/gcc/cp/except.c *** gcc-4.3.3/gcc/cp/except.c Thu Sep 6 03:33:46 2007 --- gcc-4.4.0/gcc/cp/except.c Mon Aug 18 11:17:52 2008 *************** *** 1,6 **** /* Handle exceptional things in C++. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann Rewritten by Mike Stump , based upon an initial re-implementation courtesy Tad Hunt. --- 1,7 ---- /* Handle exceptional things in C++. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 ! Free Software Foundation, Inc. Contributed by Michael Tiemann Rewritten by Mike Stump , based upon an initial re-implementation courtesy Tad Hunt. *************** along with GCC; see the file COPYING3. *** 38,43 **** --- 39,45 ---- #include "tree-inline.h" #include "tree-iterator.h" #include "target.h" + #include "gimple.h" static void push_eh_cleanup (tree); static tree prepare_eh_type (tree); *************** static tree wrap_cleanups_r (tree *, int *** 52,58 **** static int complete_ptr_ref_or_void_ptr_p (tree, tree); static bool is_admissible_throw_operand (tree); static int can_convert_eh (tree, tree); ! static tree cp_protect_cleanup_actions (void); /* Sets up all the global eh stuff that needs to be initialized at the start of compilation. */ --- 54,60 ---- static int complete_ptr_ref_or_void_ptr_p (tree, tree); static bool is_admissible_throw_operand (tree); static int can_convert_eh (tree, tree); ! static gimple cp_protect_cleanup_actions (void); /* Sets up all the global eh stuff that needs to be initialized at the start of compilation. */ *************** init_exception_processing (void) *** 91,104 **** /* Returns an expression to be executed if an unhandled exception is propagated out of a cleanup region. */ ! static tree cp_protect_cleanup_actions (void) { /* [except.terminate] When the destruction of an object during stack unwinding exits using an exception ... void terminate(); is called. */ ! return build_call_n (terminate_node, 0); } static tree --- 93,106 ---- /* Returns an expression to be executed if an unhandled exception is propagated out of a cleanup region. */ ! static gimple cp_protect_cleanup_actions (void) { /* [except.terminate] When the destruction of an object during stack unwinding exits using an exception ... void terminate(); is called. */ ! return gimple_build_call (terminate_node, 0); } static tree *************** build_exc_ptr (void) *** 160,165 **** --- 162,182 ---- return build0 (EXC_PTR_EXPR, ptr_type_node); } + /* Declare a function NAME, returning RETURN_TYPE, taking a single + parameter PARM_TYPE, with an empty exception specification. + + Note that the C++ ABI document does not have a throw-specifier on + the routines declared below via this function. The declarations + are consistent with the actual implementations in libsupc++. */ + + static tree + declare_nothrow_library_fn (tree name, tree return_type, tree parm_type) + { + tree tmp = tree_cons (NULL_TREE, parm_type, void_list_node); + return push_library_fn (name, build_function_type (return_type, tmp), + empty_except_spec); + } + /* Build up a call to __cxa_get_exception_ptr so that we can build a copy constructor for the thrown object. */ *************** do_get_exception_ptr (void) *** 171,183 **** fn = get_identifier ("__cxa_get_exception_ptr"); if (!get_global_value_if_present (fn, &fn)) { ! /* Declare void* __cxa_get_exception_ptr (void *). */ ! tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ! fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } ! return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), ! NULL_TREE)); } /* Build up a call to __cxa_begin_catch, to tell the runtime that the --- 188,200 ---- fn = get_identifier ("__cxa_get_exception_ptr"); if (!get_global_value_if_present (fn, &fn)) { ! /* Declare void* __cxa_get_exception_ptr (void *) throw(). */ ! fn = declare_nothrow_library_fn (fn, ptr_type_node, ptr_type_node); } ! return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), ! NULL_TREE), ! tf_warning_or_error); } /* Build up a call to __cxa_begin_catch, to tell the runtime that the *************** do_begin_catch (void) *** 191,203 **** fn = get_identifier ("__cxa_begin_catch"); if (!get_global_value_if_present (fn, &fn)) { ! /* Declare void* __cxa_begin_catch (void *). */ ! tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node); ! fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } ! return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), ! NULL_TREE)); } /* Returns nonzero if cleaning up an exception of type TYPE (which can be --- 208,220 ---- fn = get_identifier ("__cxa_begin_catch"); if (!get_global_value_if_present (fn, &fn)) { ! /* Declare void* __cxa_begin_catch (void *) throw(). */ ! fn = declare_nothrow_library_fn (fn, ptr_type_node, ptr_type_node); } ! return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (), ! NULL_TREE), ! tf_warning_or_error); } /* Returns nonzero if cleaning up an exception of type TYPE (which can be *************** do_end_catch (tree type) *** 235,241 **** TREE_NOTHROW (fn) = 0; } ! cleanup = build_function_call (fn, NULL_TREE); TREE_NOTHROW (cleanup) = dtor_nothrow (type); return cleanup; --- 252,258 ---- TREE_NOTHROW (fn) = 0; } ! cleanup = cp_build_function_call (fn, NULL_TREE, tf_warning_or_error); TREE_NOTHROW (cleanup) = dtor_nothrow (type); return cleanup; *************** initialize_handler_parm (tree decl, tree *** 377,383 **** pointer catch parm with the address of the temporary. */ if (TREE_CODE (init_type) == REFERENCE_TYPE && TYPE_PTR_P (TREE_TYPE (init_type))) ! exp = build_unary_op (ADDR_EXPR, exp, 1); exp = ocp_convert (init_type, exp, CONV_IMPLICIT|CONV_FORCE_TEMP, 0); --- 394,400 ---- pointer catch parm with the address of the temporary. */ if (TREE_CODE (init_type) == REFERENCE_TYPE && TYPE_PTR_P (TREE_TYPE (init_type))) ! exp = cp_build_unary_op (ADDR_EXPR, exp, 1, tf_warning_or_error); exp = ocp_convert (init_type, exp, CONV_IMPLICIT|CONV_FORCE_TEMP, 0); *************** expand_start_catch_block (tree decl) *** 434,440 **** exp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (exp), exp, fold_build1 (NEGATE_EXPR, sizetype, TYPE_SIZE_UNIT (TREE_TYPE (exp)))); ! exp = build_indirect_ref (exp, NULL); initialize_handler_parm (decl, exp); return type; } --- 451,457 ---- exp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (exp), exp, fold_build1 (NEGATE_EXPR, sizetype, TYPE_SIZE_UNIT (TREE_TYPE (exp)))); ! exp = cp_build_indirect_ref (exp, NULL, tf_warning_or_error); initialize_handler_parm (decl, exp); return type; } *************** do_allocate_exception (tree type) *** 541,553 **** fn = get_identifier ("__cxa_allocate_exception"); if (!get_global_value_if_present (fn, &fn)) { ! /* Declare void *__cxa_allocate_exception(size_t). */ ! tree tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); ! fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp)); } ! return build_function_call (fn, tree_cons (NULL_TREE, size_in_bytes (type), ! NULL_TREE)); } /* Call __cxa_free_exception from a cleanup. This is never invoked --- 558,571 ---- fn = get_identifier ("__cxa_allocate_exception"); if (!get_global_value_if_present (fn, &fn)) { ! /* Declare void *__cxa_allocate_exception(size_t) throw(). */ ! fn = declare_nothrow_library_fn (fn, ptr_type_node, size_type_node); } ! return cp_build_function_call (fn, ! tree_cons (NULL_TREE, size_in_bytes (type), ! NULL_TREE), ! tf_warning_or_error); } /* Call __cxa_free_exception from a cleanup. This is never invoked *************** do_free_exception (tree ptr) *** 561,572 **** fn = get_identifier ("__cxa_free_exception"); if (!get_global_value_if_present (fn, &fn)) { ! /* Declare void __cxa_free_exception (void *). */ ! fn = push_void_library_fn (fn, tree_cons (NULL_TREE, ptr_type_node, ! void_list_node)); } ! return build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE)); } /* Wrap all cleanups for TARGET_EXPRs in MUST_NOT_THROW_EXPR. --- 579,590 ---- fn = get_identifier ("__cxa_free_exception"); if (!get_global_value_if_present (fn, &fn)) { ! /* Declare void __cxa_free_exception (void *) throw(). */ ! fn = declare_nothrow_library_fn (fn, void_type_node, ptr_type_node); } ! return cp_build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE), ! tf_warning_or_error); } /* Wrap all cleanups for TARGET_EXPRs in MUST_NOT_THROW_EXPR. *************** build_throw (tree exp) *** 644,650 **** return error_mark_node; } fn = OVL_CURRENT (fn); ! exp = build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE)); } else if (exp) { --- 662,669 ---- return error_mark_node; } fn = OVL_CURRENT (fn); ! exp = cp_build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE), ! tf_warning_or_error); } else if (exp) { *************** build_throw (tree exp) *** 708,714 **** allocate_expr = get_target_expr (allocate_expr); ptr = TARGET_EXPR_SLOT (allocate_expr); object = build_nop (build_pointer_type (temp_type), ptr); ! object = build_indirect_ref (object, NULL); elided = (TREE_CODE (exp) == TARGET_EXPR); --- 727,733 ---- allocate_expr = get_target_expr (allocate_expr); ptr = TARGET_EXPR_SLOT (allocate_expr); object = build_nop (build_pointer_type (temp_type), ptr); ! object = cp_build_indirect_ref (object, NULL, tf_warning_or_error); elided = (TREE_CODE (exp) == TARGET_EXPR); *************** build_throw (tree exp) *** 733,739 **** (object, complete_ctor_identifier, build_tree_list (NULL_TREE, exp), TREE_TYPE (object), ! flags)); if (exp == error_mark_node) { error (" in thrown expression"); --- 752,758 ---- (object, complete_ctor_identifier, build_tree_list (NULL_TREE, exp), TREE_TYPE (object), ! flags, tf_warning_or_error)); if (exp == error_mark_node) { error (" in thrown expression"); *************** build_throw (tree exp) *** 812,818 **** tmp = tree_cons (NULL_TREE, throw_type, tmp); tmp = tree_cons (NULL_TREE, ptr, tmp); /* ??? Indicate that this function call throws throw_type. */ ! tmp = build_function_call (fn, tmp); /* Tack on the initialization stuff. */ exp = build2 (COMPOUND_EXPR, TREE_TYPE (tmp), exp, tmp); --- 831,837 ---- tmp = tree_cons (NULL_TREE, throw_type, tmp); tmp = tree_cons (NULL_TREE, ptr, tmp); /* ??? Indicate that this function call throws throw_type. */ ! tmp = cp_build_function_call (fn, tmp, tf_warning_or_error); /* Tack on the initialization stuff. */ exp = build2 (COMPOUND_EXPR, TREE_TYPE (tmp), exp, tmp); *************** build_throw (tree exp) *** 831,837 **** /* ??? Indicate that this function call allows exceptions of the type of the enclosing catch block (if known). */ ! exp = build_function_call (fn, NULL_TREE); } exp = build1 (THROW_EXPR, void_type_node, exp); --- 850,856 ---- /* ??? Indicate that this function call allows exceptions of the type of the enclosing catch block (if known). */ ! exp = cp_build_function_call (fn, NULL_TREE, tf_warning_or_error); } exp = build1 (THROW_EXPR, void_type_node, exp); *************** check_handlers (tree handlers) *** 1009,1016 **** if (tsi_end_p (i)) break; if (TREE_TYPE (handler) == NULL_TREE) ! pedwarn ("%H%<...%> handler must be the last handler for" ! " its try block", EXPR_LOCUS (handler)); else check_handlers_1 (handler, i); } --- 1028,1035 ---- if (tsi_end_p (i)) break; if (TREE_TYPE (handler) == NULL_TREE) ! permerror (input_location, "%H%<...%> handler must be the last handler for" ! " its try block", EXPR_LOCUS (handler)); else check_handlers_1 (handler, i); } diff -Nrcpad gcc-4.3.3/gcc/cp/friend.c gcc-4.4.0/gcc/cp/friend.c *** gcc-4.3.3/gcc/cp/friend.c Tue Jan 22 19:50:37 2008 --- gcc-4.4.0/gcc/cp/friend.c Wed Aug 20 13:35:00 2008 *************** *** 1,6 **** /* Help friends in C++. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ! 2007 Free Software Foundation, Inc. This file is part of GCC. --- 1,6 ---- /* Help friends in C++. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ! 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. *************** is_friend (tree type, tree supplicant) *** 59,73 **** tree friends = FRIEND_DECLS (list); for (; friends ; friends = TREE_CHAIN (friends)) { ! tree friend = TREE_VALUE (friends); ! if (friend == NULL_TREE) continue; ! if (supplicant == friend) return 1; ! if (is_specialization_of_friend (supplicant, friend)) return 1; } break; --- 59,73 ---- tree friends = FRIEND_DECLS (list); for (; friends ; friends = TREE_CHAIN (friends)) { ! tree this_friend = TREE_VALUE (friends); ! if (this_friend == NULL_TREE) continue; ! if (supplicant == this_friend) return 1; ! if (is_specialization_of_friend (supplicant, this_friend)) return 1; } break; *************** make_friend_class (tree type, tree frien *** 227,233 **** int class_template_depth = template_class_depth (type); int friend_depth = processing_template_decl - class_template_depth; ! if (! IS_AGGR_TYPE (friend_type)) { error ("invalid type %qT declared %", friend_type); return; --- 227,233 ---- int class_template_depth = template_class_depth (type); int friend_depth = processing_template_decl - class_template_depth; ! if (! MAYBE_CLASS_TYPE_P (friend_type)) { error ("invalid type %qT declared %", friend_type); return; *************** make_friend_class (tree type, tree frien *** 253,259 **** else if (same_type_p (type, friend_type)) { if (complain) ! pedwarn ("class %qT is implicitly friends with itself", type); return; } --- 253,259 ---- else if (same_type_p (type, friend_type)) { if (complain) ! warning (0, "class %qT is implicitly friends with itself", type); return; } *************** do_friend (tree ctype, tree declarator, *** 408,418 **** bool funcdef_flag) { gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); ! gcc_assert (!ctype || IS_AGGR_TYPE (ctype)); /* Every decl that gets here is a friend of something. */ DECL_FRIEND_P (decl) = 1; if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR) { declarator = TREE_OPERAND (declarator, 0); --- 408,425 ---- bool funcdef_flag) { gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); ! gcc_assert (!ctype || MAYBE_CLASS_TYPE_P (ctype)); /* Every decl that gets here is a friend of something. */ DECL_FRIEND_P (decl) = 1; + /* Unfortunately, we have to handle attributes here. Normally we would + handle them in start_decl_1, but since this is a friend decl start_decl_1 + never gets to see it. */ + + /* Set attributes here so if duplicate decl, will have proper attributes. */ + cplus_decl_attributes (&decl, attrlist, 0); + if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR) { declarator = TREE_OPERAND (declarator, 0); *************** do_friend (tree ctype, tree declarator, *** 561,571 **** if (warn) { static int explained; ! warning (OPT_Wnon_template_friend, "friend declaration " ! "%q#D declares a non-template function", decl); ! if (! explained) { ! inform ("(if this is not what you intended, make sure " "the function template has already been declared " "and add <> after the function name here) "); explained = 1; --- 568,580 ---- if (warn) { static int explained; ! bool warned; ! ! warned = warning (OPT_Wnon_template_friend, "friend declaration " ! "%q#D declares a non-template function", decl); ! if (! explained && warned) { ! inform (input_location, "(if this is not what you intended, make sure " "the function template has already been declared " "and add <> after the function name here) "); explained = 1; *************** do_friend (tree ctype, tree declarator, *** 582,593 **** DECL_FRIEND_P (decl) = 1; } - /* Unfortunately, we have to handle attributes here. Normally we would - handle them in start_decl_1, but since this is a friend decl start_decl_1 - never gets to see it. */ - - /* Set attributes here so if duplicate decl, will have proper attributes. */ - cplus_decl_attributes (&decl, attrlist, 0); - return decl; } --- 591,595 ---- diff -Nrcpad gcc-4.3.3/gcc/cp/g++spec.c gcc-4.4.0/gcc/cp/g++spec.c *** gcc-4.3.3/gcc/cp/g++spec.c Mon Aug 6 11:10:19 2007 --- gcc-4.4.0/gcc/cp/g++spec.c Fri Feb 20 15:20:38 2009 *************** *** 1,6 **** /* Specific flags and argument handling of the C++ front end. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ! 2007 Free Software Foundation, Inc. This file is part of GCC. --- 1,6 ---- /* Specific flags and argument handling of the C++ front end. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ! 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. *************** along with GCC; see the file COPYING3. *** 44,49 **** --- 44,52 ---- #ifndef LIBSTDCXX_PROFILE #define LIBSTDCXX_PROFILE LIBSTDCXX #endif + #ifndef LIBSTDCXX_STATIC + #define LIBSTDCXX_STATIC LIBSTDCXX + #endif void lang_specific_driver (int *in_argc, const char *const **in_argv, *************** lang_specific_driver (int *in_argc, cons *** 315,321 **** /* Add `-lstdc++' if we haven't already done so. */ if (library > 0) { ! arglist[j] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX; if (arglist[j][0] != '-' || arglist[j][1] == 'l') added_libraries++; j++; --- 318,325 ---- /* Add `-lstdc++' if we haven't already done so. */ if (library > 0) { ! arglist[j] = shared_libgcc == 0 ? LIBSTDCXX_STATIC ! : saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX; if (arglist[j][0] != '-' || arglist[j][1] == 'l') added_libraries++; j++; diff -Nrcpad gcc-4.3.3/gcc/cp/init.c gcc-4.4.0/gcc/cp/init.c *** gcc-4.3.3/gcc/cp/init.c Thu Feb 14 23:11:04 2008 --- gcc-4.4.0/gcc/cp/init.c Sat Mar 7 16:21:05 2009 *************** *** 1,6 **** /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) --- 1,6 ---- /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) *************** along with GCC; see the file COPYING3. *** 39,46 **** static bool begin_init_stmts (tree *, tree *); static tree finish_init_stmts (bool, tree, tree); static void construct_virtual_base (tree, tree); ! static void expand_aggr_init_1 (tree, tree, tree, tree, int); ! static void expand_default_init (tree, tree, tree, tree, int); static tree build_vec_delete_1 (tree, tree, tree, special_function_kind, int); static void perform_member_init (tree, tree); static tree build_builtin_delete_call (tree); --- 39,46 ---- static bool begin_init_stmts (tree *, tree *); static tree finish_init_stmts (bool, tree, tree); static void construct_virtual_base (tree, tree); ! static void expand_aggr_init_1 (tree, tree, tree, tree, int, tsubst_flags_t); ! static void expand_default_init (tree, tree, tree, tree, int, tsubst_flags_t); static tree build_vec_delete_1 (tree, tree, tree, special_function_kind, int); static void perform_member_init (tree, tree); static tree build_builtin_delete_call (tree); *************** build_zero_init (tree type, tree nelts, *** 261,327 **** /* In all cases, the initializer is a constant. */ if (init) ! { ! TREE_CONSTANT (init) = 1; ! TREE_INVARIANT (init) = 1; ! } return init; } - /* Build an expression for the default-initialization of an object of - the indicated TYPE. If NELTS is non-NULL, and TYPE is an - ARRAY_TYPE, NELTS is the number of elements in the array. If - initialization of TYPE requires calling constructors, this function - returns NULL_TREE; the caller is responsible for arranging for the - constructors to be called. */ - - tree - build_default_init (tree type, tree nelts) - { - /* [dcl.init]: - - To default-initialize an object of type T means: - - --if T is a non-POD class type (clause _class_), the default construc- - tor for T is called (and the initialization is ill-formed if T has - no accessible default constructor); - - --if T is an array type, each element is default-initialized; - - --otherwise, the storage for the object is zero-initialized. - - A program that calls for default-initialization of an entity of refer- - ence type is ill-formed. */ - - /* If TYPE_NEEDS_CONSTRUCTING is true, the caller is responsible for - performing the initialization. This is confusing in that some - non-PODs do not have TYPE_NEEDS_CONSTRUCTING set. (For example, - a class with a pointer-to-data member as a non-static data member - does not have TYPE_NEEDS_CONSTRUCTING set.) Therefore, we end up - passing non-PODs to build_zero_init below, which is contrary to - the semantics quoted above from [dcl.init]. - - It happens, however, that the behavior of the constructor the - standard says we should have generated would be precisely the - same as that obtained by calling build_zero_init below, so things - work out OK. */ - if (TYPE_NEEDS_CONSTRUCTING (type) - || (nelts && TREE_CODE (nelts) != INTEGER_CST)) - return NULL_TREE; - - /* At this point, TYPE is either a POD class type, an array of POD - classes, or something even more innocuous. */ - return build_zero_init (type, nelts, /*static_storage_p=*/false); - } - /* Return a suitable initializer for value-initializing an object of type ! TYPE, as described in [dcl.init]. If HAVE_CTOR is true, the initializer ! for an enclosing object is already calling the constructor for this ! object. */ ! static tree ! build_value_init_1 (tree type, bool have_ctor) { /* [dcl.init] --- 261,276 ---- /* In all cases, the initializer is a constant. */ if (init) ! TREE_CONSTANT (init) = 1; return init; } /* Return a suitable initializer for value-initializing an object of type ! TYPE, as described in [dcl.init]. */ ! tree ! build_value_init (tree type) { /* [dcl.init] *************** build_value_init_1 (tree type, bool have *** 349,364 **** if (CLASS_TYPE_P (type)) { ! if (TYPE_HAS_USER_CONSTRUCTOR (type) && !have_ctor) ! return build_cplus_new (type, build_special_member_call (NULL_TREE, complete_ctor_identifier, ! NULL_TREE, type, LOOKUP_NORMAL)); ! else if (TREE_CODE (type) != UNION_TYPE) { ! tree field, init; VEC(constructor_elt,gc) *v = NULL; - bool call_ctor = !have_ctor && TYPE_NEEDS_CONSTRUCTING (type); /* Iterate over the fields, building initializations. */ for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) --- 298,341 ---- if (CLASS_TYPE_P (type)) { ! if (type_has_user_provided_constructor (type)) ! return build_aggr_init_expr (type, build_special_member_call (NULL_TREE, complete_ctor_identifier, ! NULL_TREE, type, LOOKUP_NORMAL, ! tf_warning_or_error)); ! else if (TREE_CODE (type) != UNION_TYPE && TYPE_NEEDS_CONSTRUCTING (type)) { ! /* This is a class that needs constructing, but doesn't have ! a user-provided constructor. So we need to zero-initialize ! the object and then call the implicitly defined ctor. ! This will be handled in simplify_aggr_init_expr. */ ! tree ctor = build_special_member_call ! (NULL_TREE, complete_ctor_identifier, ! NULL_TREE, type, LOOKUP_NORMAL, tf_warning_or_error); ! ! ctor = build_aggr_init_expr (type, ctor); ! AGGR_INIT_ZERO_FIRST (ctor) = 1; ! return ctor; ! } ! } ! return build_value_init_noctor (type); ! } ! ! /* Like build_value_init, but don't call the constructor for TYPE. Used ! for base initializers. */ ! ! tree ! build_value_init_noctor (tree type) ! { ! if (CLASS_TYPE_P (type)) ! { ! gcc_assert (!TYPE_NEEDS_CONSTRUCTING (type)); ! ! if (TREE_CODE (type) != UNION_TYPE) ! { ! tree field; VEC(constructor_elt,gc) *v = NULL; /* Iterate over the fields, building initializations. */ for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) *************** build_value_init_1 (tree type, bool have *** 383,417 **** corresponding to base classes as well. Thus, iterating over TYPE_FIELDs will result in correct initialization of all of the subobjects. */ ! value = build_value_init_1 (ftype, have_ctor || call_ctor); if (value) CONSTRUCTOR_APPEND_ELT(v, field, value); } /* Build a constructor to contain the zero- initializations. */ ! init = build_constructor (type, v); ! if (call_ctor) ! { ! /* This is a class that needs constructing, but doesn't have ! a user-defined constructor. So we need to zero-initialize ! the object and then call the implicitly defined ctor. ! Implement this by sticking the zero-initialization inside ! the TARGET_EXPR for the constructor call; ! cp_gimplify_init_expr will know how to handle it. */ ! tree ctor = build_special_member_call ! (NULL_TREE, complete_ctor_identifier, ! NULL_TREE, type, LOOKUP_NORMAL); ! ! ctor = build_cplus_new (type, ctor); ! init = build2 (INIT_EXPR, void_type_node, ! TARGET_EXPR_SLOT (ctor), init); ! init = build2 (COMPOUND_EXPR, void_type_node, init, ! TARGET_EXPR_INITIAL (ctor)); ! TARGET_EXPR_INITIAL (ctor) = init; ! return ctor; ! } ! return init; } } else if (TREE_CODE (type) == ARRAY_TYPE) --- 360,373 ---- corresponding to base classes as well. Thus, iterating over TYPE_FIELDs will result in correct initialization of all of the subobjects. */ ! value = build_value_init (ftype); if (value) CONSTRUCTOR_APPEND_ELT(v, field, value); } /* Build a constructor to contain the zero- initializations. */ ! return build_constructor (type, v); } } else if (TREE_CODE (type) == ARRAY_TYPE) *************** build_value_init_1 (tree type, bool have *** 443,449 **** ce->index = build2 (RANGE_EXPR, sizetype, size_zero_node, max_index); ! ce->value = build_value_init_1 (TREE_TYPE (type), have_ctor); } /* Build a constructor to contain the initializations. */ --- 399,409 ---- ce->index = build2 (RANGE_EXPR, sizetype, size_zero_node, max_index); ! ce->value = build_value_init (TREE_TYPE (type)); ! ! /* The gimplifier can't deal with a RANGE_EXPR of TARGET_EXPRs. */ ! gcc_assert (TREE_CODE (ce->value) != TARGET_EXPR ! && TREE_CODE (ce->value) != AGGR_INIT_EXPR); } /* Build a constructor to contain the initializations. */ *************** build_value_init_1 (tree type, bool have *** 453,467 **** return build_zero_init (type, NULL_TREE, /*static_storage_p=*/false); } - /* Return a suitable initializer for value-initializing an object of type - TYPE, as described in [dcl.init]. */ - - tree - build_value_init (tree type) - { - return build_value_init_1 (type, false); - } - /* Initialize MEMBER, a FIELD_DECL, with INIT, a TREE_LIST of arguments. If TREE_LIST is void_type_node, an empty initializer list was given; if NULL_TREE no initializer was given. */ --- 413,418 ---- *************** perform_member_init (tree member, tree i *** 471,500 **** { tree decl; tree type = TREE_TYPE (member); - bool explicit; - - explicit = (init != NULL_TREE); /* Effective C++ rule 12 requires that all data members be initialized. */ ! if (warn_ecpp && !explicit && TREE_CODE (type) != ARRAY_TYPE) warning (OPT_Weffc__, "%J%qD should be initialized in the member initialization " "list", current_function_decl, member); - if (init == void_type_node) - init = NULL_TREE; - /* Get an lvalue for the data member. */ decl = build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, ! /*preserve_reference=*/true); if (decl == error_mark_node) return; /* Deal with this here, as we will get confused if we try to call the assignment op for an anonymous union. This can happen in a synthesized copy constructor. */ ! if (ANON_AGGR_TYPE_P (type)) { if (init) { --- 422,470 ---- { tree decl; tree type = TREE_TYPE (member); /* Effective C++ rule 12 requires that all data members be initialized. */ ! if (warn_ecpp && init == NULL_TREE && TREE_CODE (type) != ARRAY_TYPE) warning (OPT_Weffc__, "%J%qD should be initialized in the member initialization " "list", current_function_decl, member); /* Get an lvalue for the data member. */ decl = build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, ! /*preserve_reference=*/true, ! tf_warning_or_error); if (decl == error_mark_node) return; + if (init == void_type_node) + { + /* mem() means value-initialization. */ + if (TREE_CODE (type) == ARRAY_TYPE) + { + init = build_vec_init (decl, NULL_TREE, NULL_TREE, + /*explicit_value_init_p=*/true, + /* from_array=*/0, + tf_warning_or_error); + finish_expr_stmt (init); + } + else + { + if (TREE_CODE (type) == REFERENCE_TYPE) + permerror (input_location, "%Jvalue-initialization of %q#D, " + "which has reference type", + current_function_decl, member); + else + { + init = build2 (INIT_EXPR, type, decl, build_value_init (type)); + finish_expr_stmt (init); + } + } + } /* Deal with this here, as we will get confused if we try to call the assignment op for an anonymous union. This can happen in a synthesized copy constructor. */ ! else if (ANON_AGGR_TYPE_P (type)) { if (init) { *************** perform_member_init (tree member, tree i *** 504,542 **** } else if (TYPE_NEEDS_CONSTRUCTING (type)) { ! if (explicit && TREE_CODE (type) == ARRAY_TYPE - && init != NULL_TREE && TREE_CHAIN (init) == NULL_TREE && TREE_CODE (TREE_TYPE (TREE_VALUE (init))) == ARRAY_TYPE) { /* Initialization of one array from another. */ finish_expr_stmt (build_vec_init (decl, NULL_TREE, TREE_VALUE (init), ! /*explicit_default_init_p=*/false, ! /* from_array=*/1)); } else ! finish_expr_stmt (build_aggr_init (decl, init, 0)); } else { if (init == NULL_TREE) { - if (explicit) - { - init = build_default_init (type, /*nelts=*/NULL_TREE); - if (TREE_CODE (type) == REFERENCE_TYPE) - warning (0, "%Jdefault-initialization of %q#D, " - "which has reference type", - current_function_decl, member); - } /* member traversal: note it leaves init NULL */ ! else if (TREE_CODE (type) == REFERENCE_TYPE) ! pedwarn ("%Juninitialized reference member %qD", ! current_function_decl, member); else if (CP_TYPE_CONST_P (type)) ! pedwarn ("%Juninitialized member %qD with % type %qT", ! current_function_decl, member, type); } else if (TREE_CODE (init) == TREE_LIST) /* There was an explicit member initialization. Do some work --- 474,514 ---- } else if (TYPE_NEEDS_CONSTRUCTING (type)) { ! if (init != NULL_TREE && TREE_CODE (type) == ARRAY_TYPE && TREE_CHAIN (init) == NULL_TREE && TREE_CODE (TREE_TYPE (TREE_VALUE (init))) == ARRAY_TYPE) { /* Initialization of one array from another. */ finish_expr_stmt (build_vec_init (decl, NULL_TREE, TREE_VALUE (init), ! /*explicit_value_init_p=*/false, ! /* from_array=*/1, ! tf_warning_or_error)); } else ! { ! if (CP_TYPE_CONST_P (type) ! && init == NULL_TREE ! && !type_has_user_provided_default_constructor (type)) ! /* TYPE_NEEDS_CONSTRUCTING can be set just because we have a ! vtable; still give this diagnostic. */ ! permerror (input_location, "%Juninitialized member %qD with % type %qT", ! current_function_decl, member, type); ! finish_expr_stmt (build_aggr_init (decl, init, 0, ! tf_warning_or_error)); ! } } else { if (init == NULL_TREE) { /* member traversal: note it leaves init NULL */ ! if (TREE_CODE (type) == REFERENCE_TYPE) ! permerror (input_location, "%Juninitialized reference member %qD", ! current_function_decl, member); else if (CP_TYPE_CONST_P (type)) ! permerror (input_location, "%Juninitialized member %qD with % type %qT", ! current_function_decl, member, type); } else if (TREE_CODE (init) == TREE_LIST) /* There was an explicit member initialization. Do some work *************** perform_member_init (tree member, tree i *** 544,550 **** init = build_x_compound_expr_from_list (init, "member initializer"); if (init) ! finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init)); } if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) --- 516,523 ---- init = build_x_compound_expr_from_list (init, "member initializer"); if (init) ! finish_expr_stmt (cp_build_modify_expr (decl, INIT_EXPR, init, ! tf_warning_or_error)); } if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) *************** perform_member_init (tree member, tree i *** 553,559 **** expr = build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, ! /*preserve_reference=*/false); expr = build_delete (type, expr, sfk_complete_destructor, LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0); --- 526,533 ---- expr = build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, ! /*preserve_reference=*/false, ! tf_warning_or_error); expr = build_delete (type, expr, sfk_complete_destructor, LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0); *************** emit_mem_initializers (tree mem_inits) *** 840,850 **** "copy constructor", current_function_decl, BINFO_TYPE (subobject)); - /* If an explicit -- but empty -- initializer list was present, - treat it just like default initialization at this point. */ - if (arguments == void_type_node) - arguments = NULL_TREE; - /* Initialize the base. */ if (BINFO_VIRTUAL_P (subobject)) construct_virtual_base (subobject, arguments); --- 814,819 ---- *************** emit_mem_initializers (tree mem_inits) *** 855,863 **** base_addr = build_base_path (PLUS_EXPR, current_class_ptr, subobject, 1); expand_aggr_init_1 (subobject, NULL_TREE, ! build_indirect_ref (base_addr, NULL), arguments, ! LOOKUP_NORMAL); expand_cleanup_for_base (subobject, NULL_TREE); } --- 824,834 ---- base_addr = build_base_path (PLUS_EXPR, current_class_ptr, subobject, 1); expand_aggr_init_1 (subobject, NULL_TREE, ! cp_build_indirect_ref (base_addr, NULL, ! tf_warning_or_error), arguments, ! LOOKUP_NORMAL, ! tf_warning_or_error); expand_cleanup_for_base (subobject, NULL_TREE); } *************** expand_virtual_init (tree binfo, tree de *** 938,944 **** TREE_TYPE (vtt_parm), vtt_parm, vtt_index); ! vtbl2 = build_indirect_ref (vtbl2, NULL); vtbl2 = convert (TREE_TYPE (vtbl), vtbl2); /* The actual initializer is the VTT value only in the subobject --- 909,915 ---- TREE_TYPE (vtt_parm), vtt_parm, vtt_index); ! vtbl2 = cp_build_indirect_ref (vtbl2, NULL, tf_warning_or_error); vtbl2 = convert (TREE_TYPE (vtbl), vtbl2); /* The actual initializer is the VTT value only in the subobject *************** expand_virtual_init (tree binfo, tree de *** 953,965 **** } /* Compute the location of the vtpr. */ ! vtbl_ptr = build_vfield_ref (build_indirect_ref (decl, NULL), TREE_TYPE (binfo)); gcc_assert (vtbl_ptr != error_mark_node); /* Assign the vtable to the vptr. */ vtbl = convert_force (TREE_TYPE (vtbl_ptr), vtbl, 0); ! finish_expr_stmt (build_modify_expr (vtbl_ptr, NOP_EXPR, vtbl)); } /* If an exception is thrown in a constructor, those base classes already --- 924,938 ---- } /* Compute the location of the vtpr. */ ! vtbl_ptr = build_vfield_ref (cp_build_indirect_ref (decl, NULL, ! tf_warning_or_error), TREE_TYPE (binfo)); gcc_assert (vtbl_ptr != error_mark_node); /* Assign the vtable to the vptr. */ vtbl = convert_force (TREE_TYPE (vtbl_ptr), vtbl, 0); ! finish_expr_stmt (cp_build_modify_expr (vtbl_ptr, NOP_EXPR, vtbl, ! tf_warning_or_error)); } /* If an exception is thrown in a constructor, those base classes already *************** expand_cleanup_for_base (tree binfo, tre *** 981,990 **** base_dtor_identifier, NULL_TREE, binfo, ! LOOKUP_NORMAL | LOOKUP_NONVIRTUAL); if (flag) expr = fold_build3 (COND_EXPR, void_type_node, ! c_common_truthvalue_conversion (flag), expr, integer_zero_node); finish_eh_cleanup (expr); --- 954,964 ---- base_dtor_identifier, NULL_TREE, binfo, ! LOOKUP_NORMAL | LOOKUP_NONVIRTUAL, ! tf_warning_or_error); if (flag) expr = fold_build3 (COND_EXPR, void_type_node, ! c_common_truthvalue_conversion (input_location, flag), expr, integer_zero_node); finish_eh_cleanup (expr); *************** construct_virtual_base (tree vbase, tree *** 1025,1031 **** exp = convert_to_base_statically (current_class_ref, vbase); expand_aggr_init_1 (vbase, current_class_ref, exp, arguments, ! LOOKUP_COMPLAIN); finish_then_clause (inner_if_stmt); finish_if_stmt (inner_if_stmt); --- 999,1005 ---- exp = convert_to_base_statically (current_class_ref, vbase); expand_aggr_init_1 (vbase, current_class_ref, exp, arguments, ! LOOKUP_COMPLAIN, tf_warning_or_error); finish_then_clause (inner_if_stmt); finish_if_stmt (inner_if_stmt); *************** expand_member_init (tree name) *** 1230,1236 **** perform the initialization, but not both, as it would be ambiguous. */ tree ! build_aggr_init (tree exp, tree init, int flags) { tree stmt_expr; tree compound_stmt; --- 1204,1210 ---- perform the initialization, but not both, as it would be ambiguous. */ tree ! build_aggr_init (tree exp, tree init, int flags, tsubst_flags_t complain) { tree stmt_expr; tree compound_stmt; *************** build_aggr_init (tree exp, tree init, in *** 1257,1263 **** initialization form -- unless the initializer is "()". */ if (init && TREE_CODE (init) == TREE_LIST) { ! error ("bad array initializer"); return error_mark_node; } /* Must arrange to initialize each element of EXP --- 1231,1238 ---- initialization form -- unless the initializer is "()". */ if (init && TREE_CODE (init) == TREE_LIST) { ! if (complain & tf_error) ! error ("bad array initializer"); return error_mark_node; } /* Must arrange to initialize each element of EXP *************** build_aggr_init (tree exp, tree init, in *** 1268,1276 **** if (itype && cp_type_quals (itype) != TYPE_UNQUALIFIED) itype = TREE_TYPE (init) = TYPE_MAIN_VARIANT (itype); stmt_expr = build_vec_init (exp, NULL_TREE, init, ! /*explicit_default_init_p=*/false, itype && same_type_p (itype, ! TREE_TYPE (exp))); TREE_READONLY (exp) = was_const; TREE_THIS_VOLATILE (exp) = was_volatile; TREE_TYPE (exp) = type; --- 1243,1252 ---- if (itype && cp_type_quals (itype) != TYPE_UNQUALIFIED) itype = TREE_TYPE (init) = TYPE_MAIN_VARIANT (itype); stmt_expr = build_vec_init (exp, NULL_TREE, init, ! /*explicit_value_init_p=*/false, itype && same_type_p (itype, ! TREE_TYPE (exp)), ! complain); TREE_READONLY (exp) = was_const; TREE_THIS_VOLATILE (exp) = was_volatile; TREE_TYPE (exp) = type; *************** build_aggr_init (tree exp, tree init, in *** 1287,1293 **** destroy_temps = stmts_are_full_exprs_p (); current_stmt_tree ()->stmts_are_full_exprs_p = 0; expand_aggr_init_1 (TYPE_BINFO (type), exp, exp, ! init, LOOKUP_NORMAL|flags); stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt); current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps; TREE_READONLY (exp) = was_const; --- 1263,1269 ---- destroy_temps = stmts_are_full_exprs_p (); current_stmt_tree ()->stmts_are_full_exprs_p = 0; expand_aggr_init_1 (TYPE_BINFO (type), exp, exp, ! init, LOOKUP_NORMAL|flags, complain); stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt); current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps; TREE_READONLY (exp) = was_const; *************** build_aggr_init (tree exp, tree init, in *** 1297,1303 **** } static void ! expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags) { tree type = TREE_TYPE (exp); tree ctor_name; --- 1273,1280 ---- } static void ! expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags, ! tsubst_flags_t complain) { tree type = TREE_TYPE (exp); tree ctor_name; *************** expand_default_init (tree binfo, tree tr *** 1323,1332 **** to run a new constructor; and catching an exception, where we have already built up the constructor call so we could wrap it in an exception region. */; ! else if (BRACE_ENCLOSED_INITIALIZER_P (init)) { /* A brace-enclosed initializer for an aggregate. */ - gcc_assert (CP_AGGREGATE_TYPE_P (type)); init = digest_init (type, init); } else --- 1300,1309 ---- to run a new constructor; and catching an exception, where we have already built up the constructor call so we could wrap it in an exception region. */; ! else if (BRACE_ENCLOSED_INITIALIZER_P (init) ! && CP_AGGREGATE_TYPE_P (type)) { /* A brace-enclosed initializer for an aggregate. */ init = digest_init (type, init); } else *************** expand_default_init (tree binfo, tree tr *** 1364,1372 **** else ctor_name = base_ctor_identifier; ! rval = build_special_member_call (exp, ctor_name, parms, binfo, flags); if (TREE_SIDE_EFFECTS (rval)) ! finish_expr_stmt (convert_to_void (rval, NULL)); } /* This function is responsible for initializing EXP with INIT --- 1341,1350 ---- else ctor_name = base_ctor_identifier; ! rval = build_special_member_call (exp, ctor_name, parms, binfo, flags, ! complain); if (TREE_SIDE_EFFECTS (rval)) ! finish_expr_stmt (convert_to_void (rval, NULL, complain)); } /* This function is responsible for initializing EXP with INIT *************** expand_default_init (tree binfo, tree tr *** 1390,1396 **** for its description. */ static void ! expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags) { tree type = TREE_TYPE (exp); --- 1368,1375 ---- for its description. */ static void ! expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags, ! tsubst_flags_t complain) { tree type = TREE_TYPE (exp); *************** expand_aggr_init_1 (tree binfo, tree tru *** 1415,1438 **** return; } /* We know that expand_default_init can handle everything we want at this point. */ ! expand_default_init (binfo, true_exp, exp, init, flags); } ! /* Report an error if TYPE is not a user-defined, aggregate type. If OR_ELSE is nonzero, give an error message. */ int ! is_aggr_type (tree type, int or_else) { if (type == error_mark_node) return 0; ! if (! IS_AGGR_TYPE (type)) { if (or_else) ! error ("%qT is not an aggregate type", type); return 0; } return 1; --- 1394,1444 ---- return; } + /* If an explicit -- but empty -- initializer list was present, + that's value-initialization. */ + if (init == void_type_node) + { + /* If there's a user-provided constructor, we just call that. */ + if (type_has_user_provided_constructor (type)) + /* Fall through. */; + /* If there isn't, but we still need to call the constructor, + zero out the object first. */ + else if (TYPE_NEEDS_CONSTRUCTING (type)) + { + init = build_zero_init (type, NULL_TREE, /*static_storage_p=*/false); + init = build2 (INIT_EXPR, type, exp, init); + finish_expr_stmt (init); + /* And then call the constructor. */ + } + /* If we don't need to mess with the constructor at all, + then just zero out the object and we're done. */ + else + { + init = build2 (INIT_EXPR, type, exp, build_value_init_noctor (type)); + finish_expr_stmt (init); + return; + } + init = NULL_TREE; + } + /* We know that expand_default_init can handle everything we want at this point. */ ! expand_default_init (binfo, true_exp, exp, init, flags, complain); } ! /* Report an error if TYPE is not a user-defined, class type. If OR_ELSE is nonzero, give an error message. */ int ! is_class_type (tree type, int or_else) { if (type == error_mark_node) return 0; ! if (! CLASS_TYPE_P (type)) { if (or_else) ! error ("%qT is not a class type", type); return 0; } return 1; *************** build_offset_ref (tree type, tree member *** 1476,1482 **** /*template_p=*/false); gcc_assert (TYPE_P (type)); ! if (! is_aggr_type (type, 1)) return error_mark_node; gcc_assert (DECL_P (member) || BASELINK_P (member)); --- 1482,1488 ---- /*template_p=*/false); gcc_assert (TYPE_P (type)); ! if (! is_class_type (type, 1)) return error_mark_node; gcc_assert (DECL_P (member) || BASELINK_P (member)); *************** build_offset_ref (tree type, tree member *** 1565,1571 **** a class derived from that class (_class.base.init_). */ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (member)) { ! /* Build a representation of a the qualified name suitable for use as the operand to "&" -- even though the "&" is not actually present. */ member = build2 (OFFSET_REF, TREE_TYPE (member), decl, member); --- 1571,1577 ---- a class derived from that class (_class.base.init_). */ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (member)) { ! /* Build a representation of the qualified name suitable for use as the operand to "&" -- even though the "&" is not actually present. */ member = build2 (OFFSET_REF, TREE_TYPE (member), decl, member); *************** build_offset_ref (tree type, tree member *** 1574,1580 **** if (flag_ms_extensions) { PTRMEM_OK_P (member) = 1; ! return build_unary_op (ADDR_EXPR, member, 0); } error ("invalid use of non-static member function %qD", TREE_OPERAND (member, 1)); --- 1580,1587 ---- if (flag_ms_extensions) { PTRMEM_OK_P (member) = 1; ! return cp_build_unary_op (ADDR_EXPR, member, 0, ! tf_warning_or_error); } error ("invalid use of non-static member function %qD", TREE_OPERAND (member, 1)); *************** constant_value_1 (tree decl, bool integr *** 1636,1641 **** --- 1643,1657 ---- } if (init == error_mark_node) return decl; + /* Initializers in templates are generally expanded during + instantiation, so before that for const int i(2) + INIT is a TREE_LIST with the actual initializer as + TREE_VALUE. */ + if (processing_template_decl + && init + && TREE_CODE (init) == TREE_LIST + && TREE_CHAIN (init) == NULL_TREE) + init = TREE_VALUE (init); if (!init || !TREE_TYPE (init) || (integral_p *************** avoid_placement_new_aliasing (tree t, tr *** 1765,1793 **** static tree build_new_1 (tree placement, tree type, tree nelts, tree init, ! bool globally_qualified_p) { tree size, rval; /* True iff this is a call to "operator new[]" instead of just "operator new". */ bool array_p = false; ! /* True iff ARRAY_P is true and the bound of the array type is ! not necessarily a compile time constant. For example, VLA_P is ! true for "new int[f()]". */ ! bool vla_p = false; ! /* The type being allocated. If ARRAY_P is true, this will be an ! ARRAY_TYPE. */ ! tree full_type; ! /* If ARRAY_P is true, the element type of the array. This is an ! never ARRAY_TYPE; for something like "new int[3][4]", the ELT_TYPE is "int". If ARRAY_P is false, this is the same type as ! FULL_TYPE. */ tree elt_type; /* The type of the new-expression. (This type is always a pointer type.) */ tree pointer_type; - /* A pointer type pointing to the FULL_TYPE. */ - tree full_pointer_type; tree outer_nelts = NULL_TREE; tree alloc_call, alloc_expr; /* The address returned by the call to "operator new". This node is --- 1781,1800 ---- static tree build_new_1 (tree placement, tree type, tree nelts, tree init, ! bool globally_qualified_p, tsubst_flags_t complain) { tree size, rval; /* True iff this is a call to "operator new[]" instead of just "operator new". */ bool array_p = false; ! /* If ARRAY_P is true, the element type of the array. This is never ! an ARRAY_TYPE; for something like "new int[3][4]", the ELT_TYPE is "int". If ARRAY_P is false, this is the same type as ! TYPE. */ tree elt_type; /* The type of the new-expression. (This type is always a pointer type.) */ tree pointer_type; tree outer_nelts = NULL_TREE; tree alloc_call, alloc_expr; /* The address returned by the call to "operator new". This node is *************** build_new_1 (tree placement, tree type, *** 1818,1852 **** if (nelts) { - tree index; - outer_nelts = nelts; array_p = true; - - /* ??? The middle-end will error on us for building a VLA outside a - function context. Methinks that's not it's purvey. So we'll do - our own VLA layout later. */ - vla_p = true; - index = convert (sizetype, nelts); - index = size_binop (MINUS_EXPR, index, size_one_node); - index = build_index_type (index); - full_type = build_cplus_array_type (type, NULL_TREE); - /* We need a copy of the type as build_array_type will return a shared copy - of the incomplete array type. */ - full_type = build_distinct_type_copy (full_type); - TYPE_DOMAIN (full_type) = index; - SET_TYPE_STRUCTURAL_EQUALITY (full_type); } ! else { ! full_type = type; ! if (TREE_CODE (type) == ARRAY_TYPE) ! { ! array_p = true; ! nelts = array_type_nelts_top (type); ! outer_nelts = nelts; ! type = TREE_TYPE (type); ! } } /* If our base type is an array, then make sure we know how many elements --- 1825,1839 ---- if (nelts) { outer_nelts = nelts; array_p = true; } ! else if (TREE_CODE (type) == ARRAY_TYPE) { ! array_p = true; ! nelts = array_type_nelts_top (type); ! outer_nelts = nelts; ! type = TREE_TYPE (type); } /* If our base type is an array, then make sure we know how many elements *************** build_new_1 (tree placement, tree type, *** 1854,1865 **** for (elt_type = type; TREE_CODE (elt_type) == ARRAY_TYPE; elt_type = TREE_TYPE (elt_type)) ! nelts = cp_build_binary_op (MULT_EXPR, nelts, ! array_type_nelts_top (elt_type)); if (TREE_CODE (elt_type) == VOID_TYPE) { ! error ("invalid type % for new"); return error_mark_node; } --- 1841,1855 ---- for (elt_type = type; TREE_CODE (elt_type) == ARRAY_TYPE; elt_type = TREE_TYPE (elt_type)) ! nelts = cp_build_binary_op (input_location, ! MULT_EXPR, nelts, ! array_type_nelts_top (elt_type), ! complain); if (TREE_CODE (elt_type) == VOID_TYPE) { ! if (complain & tf_error) ! error ("invalid type % for new"); return error_mark_node; } *************** build_new_1 (tree placement, tree type, *** 1867,1895 **** return error_mark_node; is_initialized = (TYPE_NEEDS_CONSTRUCTING (elt_type) || init); ! if (CP_TYPE_CONST_P (elt_type) && !is_initialized) { ! error ("uninitialized const in % of %q#T", elt_type); return error_mark_node; } size = size_in_bytes (elt_type); if (array_p) ! { ! size = size_binop (MULT_EXPR, size, convert (sizetype, nelts)); ! if (vla_p) ! { ! tree n, bitsize; ! ! /* Do our own VLA layout. Setting TYPE_SIZE/_UNIT is ! necessary in order for the > to be valid. */ ! TYPE_SIZE_UNIT (full_type) = size; ! n = convert (bitsizetype, nelts); ! bitsize = size_binop (MULT_EXPR, TYPE_SIZE (elt_type), n); ! TYPE_SIZE (full_type) = bitsize; ! } ! } alloc_fn = NULL_TREE; --- 1857,1874 ---- return error_mark_node; is_initialized = (TYPE_NEEDS_CONSTRUCTING (elt_type) || init); ! ! if (CP_TYPE_CONST_P (elt_type) && !init ! && !type_has_user_provided_default_constructor (elt_type)) { ! if (complain & tf_error) ! error ("uninitialized const in % of %q#T", elt_type); return error_mark_node; } size = size_in_bytes (elt_type); if (array_p) ! size = size_binop (MULT_EXPR, size, convert (sizetype, nelts)); alloc_fn = NULL_TREE; *************** build_new_1 (tree placement, tree type, *** 1907,1927 **** if (!get_global_value_if_present (get_identifier (alloc_name), &alloc_fn)) { ! error ("call to Java constructor with %qs undefined", alloc_name); return error_mark_node; } else if (really_overloaded_fn (alloc_fn)) { ! error ("%qD should never be overloaded", alloc_fn); return error_mark_node; } alloc_fn = OVL_CURRENT (alloc_fn); class_addr = build1 (ADDR_EXPR, jclass_node, class_decl); ! alloc_call = (build_function_call (alloc_fn, ! build_tree_list (NULL_TREE, class_addr))); } ! else if (TYPE_FOR_JAVA (elt_type) && IS_AGGR_TYPE (elt_type)) { error ("Java class %q#T object allocated using placement new", elt_type); return error_mark_node; --- 1886,1909 ---- if (!get_global_value_if_present (get_identifier (alloc_name), &alloc_fn)) { ! if (complain & tf_error) ! error ("call to Java constructor with %qs undefined", alloc_name); return error_mark_node; } else if (really_overloaded_fn (alloc_fn)) { ! if (complain & tf_error) ! error ("%qD should never be overloaded", alloc_fn); return error_mark_node; } alloc_fn = OVL_CURRENT (alloc_fn); class_addr = build1 (ADDR_EXPR, jclass_node, class_decl); ! alloc_call = (cp_build_function_call (alloc_fn, ! build_tree_list (NULL_TREE, class_addr), ! complain)); } ! else if (TYPE_FOR_JAVA (elt_type) && MAYBE_CLASS_TYPE_P (elt_type)) { error ("Java class %q#T object allocated using placement new", elt_type); return error_mark_node; *************** build_new_1 (tree placement, tree type, *** 1952,1971 **** fns = lookup_fnfields (elt_type, fnname, /*protect=*/2); if (fns == NULL_TREE) { ! error ("no suitable %qD found in class %qT", fnname, elt_type); return error_mark_node; } if (TREE_CODE (fns) == TREE_LIST) { ! error ("request for member %qD is ambiguous", fnname); ! print_candidates (fns); return error_mark_node; } alloc_call = build_new_method_call (build_dummy_object (elt_type), fns, args, /*conversion_path=*/NULL_TREE, LOOKUP_NORMAL, ! &alloc_fn); } else { --- 1934,1958 ---- fns = lookup_fnfields (elt_type, fnname, /*protect=*/2); if (fns == NULL_TREE) { ! if (complain & tf_error) ! error ("no suitable %qD found in class %qT", fnname, elt_type); return error_mark_node; } if (TREE_CODE (fns) == TREE_LIST) { ! if (complain & tf_error) ! { ! error ("request for member %qD is ambiguous", fnname); ! print_candidates (fns); ! } return error_mark_node; } alloc_call = build_new_method_call (build_dummy_object (elt_type), fns, args, /*conversion_path=*/NULL_TREE, LOOKUP_NORMAL, ! &alloc_fn, ! complain); } else { *************** build_new_1 (tree placement, tree type, *** 2019,2029 **** return rval; } ! /* While we're working, use a pointer to the type we've actually ! allocated. Store the result of the call in a variable so that we ! can use it more than once. */ ! full_pointer_type = build_pointer_type (full_type); ! alloc_expr = get_target_expr (build_nop (full_pointer_type, alloc_call)); alloc_node = TARGET_EXPR_SLOT (alloc_expr); /* Strip any COMPOUND_EXPRs from ALLOC_CALL. */ --- 2006,2014 ---- return rval; } ! /* Store the result of the allocation call in a variable so that we can ! use it more than once. */ ! alloc_expr = get_target_expr (alloc_call); alloc_node = TARGET_EXPR_SLOT (alloc_expr); /* Strip any COMPOUND_EXPRs from ALLOC_CALL. */ *************** build_new_1 (tree placement, tree type, *** 2075,2091 **** tree size_ptr_type; /* Adjust so we're pointing to the start of the object. */ ! data_addr = get_target_expr (build2 (POINTER_PLUS_EXPR, full_pointer_type, ! alloc_node, cookie_size)); /* Store the number of bytes allocated so that we can know how many elements to destroy later. We use the last sizeof (size_t) bytes to store the number of elements. */ ! cookie_ptr = fold_build1 (NEGATE_EXPR, sizetype, size_in_bytes (sizetype)); size_ptr_type = build_pointer_type (sizetype); ! cookie_ptr = build2 (POINTER_PLUS_EXPR, size_ptr_type, ! fold_convert (size_ptr_type, data_addr), cookie_ptr); ! cookie = build_indirect_ref (cookie_ptr, NULL); cookie_expr = build2 (MODIFY_EXPR, sizetype, cookie, nelts); --- 2060,2077 ---- tree size_ptr_type; /* Adjust so we're pointing to the start of the object. */ ! data_addr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (alloc_node), ! alloc_node, cookie_size); /* Store the number of bytes allocated so that we can know how many elements to destroy later. We use the last sizeof (size_t) bytes to store the number of elements. */ ! cookie_ptr = size_binop (MINUS_EXPR, cookie_size, size_in_bytes (sizetype)); ! cookie_ptr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (alloc_node), ! alloc_node, cookie_ptr); size_ptr_type = build_pointer_type (sizetype); ! cookie_ptr = fold_convert (size_ptr_type, cookie_ptr); ! cookie = cp_build_indirect_ref (cookie_ptr, NULL, complain); cookie_expr = build2 (MODIFY_EXPR, sizetype, cookie, nelts); *************** build_new_1 (tree placement, tree type, *** 2096,2108 **** fold_build1 (NEGATE_EXPR, sizetype, size_in_bytes (sizetype))); ! cookie = build_indirect_ref (cookie_ptr, NULL); cookie = build2 (MODIFY_EXPR, sizetype, cookie, ! size_in_bytes(elt_type)); cookie_expr = build2 (COMPOUND_EXPR, TREE_TYPE (cookie_expr), cookie, cookie_expr); } - data_addr = TARGET_EXPR_SLOT (data_addr); } else { --- 2082,2093 ---- fold_build1 (NEGATE_EXPR, sizetype, size_in_bytes (sizetype))); ! cookie = cp_build_indirect_ref (cookie_ptr, NULL, complain); cookie = build2 (MODIFY_EXPR, sizetype, cookie, ! size_in_bytes (elt_type)); cookie_expr = build2 (COMPOUND_EXPR, TREE_TYPE (cookie_expr), cookie, cookie_expr); } } else { *************** build_new_1 (tree placement, tree type, *** 2110,2115 **** --- 2095,2105 ---- data_addr = alloc_node; } + /* Now use a pointer to the type we've actually allocated. */ + data_addr = fold_convert (pointer_type, data_addr); + /* Any further uses of alloc_node will want this type, too. */ + alloc_node = fold_convert (pointer_type, alloc_node); + /* Now initialize the allocated object. Note that we preevaluate the initialization expression, apart from the actual constructor call or assignment--we do this because we want to delay the allocation as long *************** build_new_1 (tree placement, tree type, *** 2118,2145 **** if (is_initialized) { bool stable; ! init_expr = build_indirect_ref (data_addr, NULL); if (array_p) { ! bool explicit_default_init_p = false; ! ! if (init == void_zero_node) ! { ! init = NULL_TREE; ! explicit_default_init_p = true; ! } ! else if (init) ! pedwarn ("ISO C++ forbids initialization in array new"); ! init_expr ! = build_vec_init (init_expr, ! cp_build_binary_op (MINUS_EXPR, outer_nelts, ! integer_one_node), init, ! explicit_default_init_p, ! /*from_array=*/0); /* An array initialization is stable because the initialization of each element is a full-expression, so the temporaries don't --- 2108,2140 ---- if (is_initialized) { bool stable; + bool explicit_value_init_p = false; ! if (init == void_zero_node) ! { ! init = NULL_TREE; ! explicit_value_init_p = true; ! } if (array_p) { ! if (init) ! { ! if (complain & tf_error) ! permerror (input_location, "ISO C++ forbids initialization in array new"); ! else ! return error_mark_node; ! } init_expr ! = build_vec_init (data_addr, ! cp_build_binary_op (input_location, ! MINUS_EXPR, outer_nelts, ! integer_one_node, ! complain), init, ! explicit_value_init_p, ! /*from_array=*/0, ! complain); /* An array initialization is stable because the initialization of each element is a full-expression, so the temporaries don't *************** build_new_1 (tree placement, tree type, *** 2148,2163 **** } else { ! if (init == void_zero_node) ! init = build_default_init (full_type, nelts); ! if (TYPE_NEEDS_CONSTRUCTING (type)) { init_expr = build_special_member_call (init_expr, complete_ctor_identifier, init, elt_type, ! LOOKUP_NORMAL); ! stable = stabilize_init (init_expr, &init_preeval_expr); } else { --- 2143,2163 ---- } else { ! init_expr = cp_build_indirect_ref (data_addr, NULL, complain); ! if (TYPE_NEEDS_CONSTRUCTING (type) && !explicit_value_init_p) { init_expr = build_special_member_call (init_expr, complete_ctor_identifier, init, elt_type, ! LOOKUP_NORMAL, ! complain); ! } ! else if (explicit_value_init_p) ! { ! /* Something like `new int()'. */ ! init_expr = build2 (INIT_EXPR, type, ! init_expr, build_value_init (type)); } else { *************** build_new_1 (tree placement, tree type, *** 2171,2179 **** gcc_assert (TREE_CODE (init) != CONSTRUCTOR || TREE_TYPE (init) != NULL_TREE); ! init_expr = build_modify_expr (init_expr, INIT_EXPR, init); ! stable = stabilize_init (init_expr, &init_preeval_expr); } } if (init_expr == error_mark_node) --- 2171,2180 ---- gcc_assert (TREE_CODE (init) != CONSTRUCTOR || TREE_TYPE (init) != NULL_TREE); ! init_expr = cp_build_modify_expr (init_expr, INIT_EXPR, init, ! complain); } + stable = stabilize_init (init_expr, &init_preeval_expr); } if (init_expr == error_mark_node) *************** build_new_1 (tree placement, tree type, *** 2195,2205 **** /* The Standard is unclear here, but the right thing to do is to use the same method for finding deallocation functions that we use for finding allocation functions. */ ! cleanup = build_op_delete_call (dcode, alloc_node, size, ! globally_qualified_p, ! (placement_allocation_fn_p ! ? alloc_call : NULL_TREE), ! alloc_fn); if (!cleanup) /* We're done. */; --- 2196,2208 ---- /* The Standard is unclear here, but the right thing to do is to use the same method for finding deallocation functions that we use for finding allocation functions. */ ! cleanup = (build_op_delete_call ! (dcode, ! alloc_node, ! size, ! globally_qualified_p, ! placement_allocation_fn_p ? alloc_call : NULL_TREE, ! alloc_fn)); if (!cleanup) /* We're done. */; *************** build_new_1 (tree placement, tree type, *** 2254,2260 **** if (cookie_expr) rval = build2 (COMPOUND_EXPR, TREE_TYPE (rval), cookie_expr, rval); ! if (rval == alloc_node) /* If we don't have an initializer or a cookie, strip the TARGET_EXPR and return the call (which doesn't need to be adjusted). */ rval = TARGET_EXPR_INITIAL (alloc_expr); --- 2257,2263 ---- if (cookie_expr) rval = build2 (COMPOUND_EXPR, TREE_TYPE (rval), cookie_expr, rval); ! if (rval == data_addr) /* If we don't have an initializer or a cookie, strip the TARGET_EXPR and return the call (which doesn't need to be adjusted). */ rval = TARGET_EXPR_INITIAL (alloc_expr); *************** build_new_1 (tree placement, tree type, *** 2262,2270 **** { if (check_new) { ! tree ifexp = cp_build_binary_op (NE_EXPR, alloc_node, ! integer_zero_node); ! rval = build_conditional_expr (ifexp, rval, alloc_node); } /* Perform the allocation before anything else, so that ALLOC_NODE --- 2265,2276 ---- { if (check_new) { ! tree ifexp = cp_build_binary_op (input_location, ! NE_EXPR, alloc_node, ! integer_zero_node, ! complain); ! rval = build_conditional_expr (ifexp, rval, alloc_node, ! complain); } /* Perform the allocation before anything else, so that ALLOC_NODE *************** build_new_1 (tree placement, tree type, *** 2275,2283 **** if (init_preeval_expr) rval = build2 (COMPOUND_EXPR, TREE_TYPE (rval), init_preeval_expr, rval); - /* Convert to the final type. */ - rval = build_nop (pointer_type, rval); - /* A new-expression is never an lvalue. */ gcc_assert (!lvalue_p (rval)); --- 2281,2286 ---- *************** build_new_1 (tree placement, tree type, *** 2299,2305 **** tree build_new (tree placement, tree type, tree nelts, tree init, ! int use_global_new) { tree rval; tree orig_placement; --- 2302,2308 ---- tree build_new (tree placement, tree type, tree nelts, tree init, ! int use_global_new, tsubst_flags_t complain) { tree rval; tree orig_placement; *************** build_new (tree placement, tree type, tr *** 2314,2319 **** --- 2317,2329 ---- orig_nelts = nelts; orig_init = init; + if (nelts == NULL_TREE && init != void_zero_node && list_length (init) == 1) + { + tree auto_node = type_uses_auto (type); + if (auto_node && describable_type (TREE_VALUE (init))) + type = do_auto_deduction (type, TREE_VALUE (init), auto_node); + } + if (processing_template_decl) { if (dependent_type_p (type) *************** build_new (tree placement, tree type, tr *** 2333,2339 **** if (nelts) { if (!build_expr_type_conversion (WANT_INT | WANT_ENUM, nelts, false)) ! pedwarn ("size in array new must have integral type"); nelts = cp_save_expr (cp_convert (sizetype, nelts)); } --- 2343,2354 ---- if (nelts) { if (!build_expr_type_conversion (WANT_INT | WANT_ENUM, nelts, false)) ! { ! if (complain & tf_error) ! permerror (input_location, "size in array new must have integral type"); ! else ! return error_mark_node; ! } nelts = cp_save_expr (cp_convert (sizetype, nelts)); } *************** build_new (tree placement, tree type, tr *** 2342,2354 **** returned by new.'' ARM 5.3.3 */ if (TREE_CODE (type) == REFERENCE_TYPE) { ! error ("new cannot be applied to a reference type"); type = TREE_TYPE (type); } if (TREE_CODE (type) == FUNCTION_TYPE) { ! error ("new cannot be applied to a function type"); return error_mark_node; } --- 2357,2373 ---- returned by new.'' ARM 5.3.3 */ if (TREE_CODE (type) == REFERENCE_TYPE) { ! if (complain & tf_error) ! error ("new cannot be applied to a reference type"); ! else ! return error_mark_node; type = TREE_TYPE (type); } if (TREE_CODE (type) == FUNCTION_TYPE) { ! if (complain & tf_error) ! error ("new cannot be applied to a function type"); return error_mark_node; } *************** build_new (tree placement, tree type, tr *** 2358,2364 **** if (!complete_type_or_else (type, NULL_TREE)) return error_mark_node; ! rval = build_new_1 (placement, type, nelts, init, use_global_new); if (rval == error_mark_node) return error_mark_node; --- 2377,2383 ---- if (!complete_type_or_else (type, NULL_TREE)) return error_mark_node; ! rval = build_new_1 (placement, type, nelts, init, use_global_new, complain); if (rval == error_mark_node) return error_mark_node; *************** build_vec_delete_1 (tree base, tree maxi *** 2456,2462 **** /* We should only have 1-D arrays here. */ gcc_assert (TREE_CODE (type) != ARRAY_TYPE); ! if (! IS_AGGR_TYPE (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type)) goto no_destructor; /* The below is short by the cookie size. */ --- 2475,2481 ---- /* We should only have 1-D arrays here. */ gcc_assert (TREE_CODE (type) != ARRAY_TYPE); ! if (! MAYBE_CLASS_TYPE_P (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type)) goto no_destructor; /* The below is short by the cookie size. */ *************** build_vec_delete_1 (tree base, tree maxi *** 2464,2473 **** convert (sizetype, maxindex)); tbase = create_temporary_var (ptype); ! tbase_init = build_modify_expr (tbase, NOP_EXPR, ! fold_build2 (POINTER_PLUS_EXPR, ptype, ! fold_convert (ptype, base), ! virtual_size)); DECL_REGISTER (tbase) = 1; controller = build3 (BIND_EXPR, void_type_node, tbase, NULL_TREE, NULL_TREE); --- 2483,2493 ---- convert (sizetype, maxindex)); tbase = create_temporary_var (ptype); ! tbase_init = cp_build_modify_expr (tbase, NOP_EXPR, ! fold_build2 (POINTER_PLUS_EXPR, ptype, ! fold_convert (ptype, base), ! virtual_size), ! tf_warning_or_error); DECL_REGISTER (tbase) = 1; controller = build3 (BIND_EXPR, void_type_node, tbase, NULL_TREE, NULL_TREE); *************** build_vec_delete_1 (tree base, tree maxi *** 2478,2485 **** fold_convert (ptype, base))); tmp = fold_build1 (NEGATE_EXPR, sizetype, size_exp); body = build_compound_expr ! (body, build_modify_expr (tbase, NOP_EXPR, ! build2 (POINTER_PLUS_EXPR, ptype, tbase, tmp))); body = build_compound_expr (body, build_delete (ptype, tbase, sfk_complete_destructor, LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1)); --- 2498,2506 ---- fold_convert (ptype, base))); tmp = fold_build1 (NEGATE_EXPR, sizetype, size_exp); body = build_compound_expr ! (body, cp_build_modify_expr (tbase, NOP_EXPR, ! build2 (POINTER_PLUS_EXPR, ptype, tbase, tmp), ! tf_warning_or_error)); body = build_compound_expr (body, build_delete (ptype, tbase, sfk_complete_destructor, LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1)); *************** build_vec_delete_1 (tree base, tree maxi *** 2508,2517 **** cookie_size = targetm.cxx.get_cookie_size (type); base_tbd = cp_convert (ptype, ! cp_build_binary_op (MINUS_EXPR, cp_convert (string_type_node, base), ! cookie_size)); /* True size with header. */ virtual_size = size_binop (PLUS_EXPR, virtual_size, cookie_size); } --- 2529,2540 ---- cookie_size = targetm.cxx.get_cookie_size (type); base_tbd = cp_convert (ptype, ! cp_build_binary_op (input_location, ! MINUS_EXPR, cp_convert (string_type_node, base), ! cookie_size, ! tf_warning_or_error)); /* True size with header. */ virtual_size = size_binop (PLUS_EXPR, virtual_size, cookie_size); } *************** build_vec_delete_1 (tree base, tree maxi *** 2553,2559 **** /* Pre-evaluate the SAVE_EXPR outside of the BIND_EXPR. */ body = build2 (COMPOUND_EXPR, void_type_node, base, body); ! return convert_to_void (body, /*implicit=*/NULL); } /* Create an unnamed variable of the indicated TYPE. */ --- 2576,2582 ---- /* Pre-evaluate the SAVE_EXPR outside of the BIND_EXPR. */ body = build2 (COMPOUND_EXPR, void_type_node, base, body); ! return convert_to_void (body, /*implicit=*/NULL, tf_warning_or_error); } /* Create an unnamed variable of the indicated TYPE. */ *************** get_temp_regvar (tree type, tree init) *** 2588,2594 **** decl = create_temporary_var (type); add_decl_expr (decl); ! finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init)); return decl; } --- 2611,2618 ---- decl = create_temporary_var (type); add_decl_expr (decl); ! finish_expr_stmt (cp_build_modify_expr (decl, INIT_EXPR, init, ! tf_warning_or_error)); return decl; } *************** get_temp_regvar (tree type, tree init) *** 2596,2610 **** /* `build_vec_init' returns tree structure that performs initialization of a vector of aggregate types. ! BASE is a reference to the vector, of ARRAY_TYPE. MAXINDEX is the maximum index of the array (one less than the ! number of elements). It is only used if TYPE_DOMAIN (TREE_TYPE (BASE)) == NULL_TREE. INIT is the (possibly NULL) initializer. ! If EXPLICIT_DEFAULT_INIT_P is true, then INIT must be NULL. All ! elements in the array are default-initialized. FROM_ARRAY is 0 if we should init everything with INIT (i.e., every element initialized from INIT). --- 2620,2635 ---- /* `build_vec_init' returns tree structure that performs initialization of a vector of aggregate types. ! BASE is a reference to the vector, of ARRAY_TYPE, or a pointer ! to the first element, of POINTER_TYPE. MAXINDEX is the maximum index of the array (one less than the ! number of elements). It is only used if BASE is a pointer or TYPE_DOMAIN (TREE_TYPE (BASE)) == NULL_TREE. INIT is the (possibly NULL) initializer. ! If EXPLICIT_VALUE_INIT_P is true, then INIT must be NULL. All ! elements in the array are value-initialized. FROM_ARRAY is 0 if we should init everything with INIT (i.e., every element initialized from INIT). *************** get_temp_regvar (tree type, tree init) *** 2615,2629 **** tree build_vec_init (tree base, tree maxindex, tree init, ! bool explicit_default_init_p, ! int from_array) { tree rval; tree base2 = NULL_TREE; tree size; tree itype = NULL_TREE; tree iterator; ! /* The type of the array. */ tree atype = TREE_TYPE (base); /* The type of an element in the array. */ tree type = TREE_TYPE (atype); --- 2640,2654 ---- tree build_vec_init (tree base, tree maxindex, tree init, ! bool explicit_value_init_p, ! int from_array, tsubst_flags_t complain) { tree rval; tree base2 = NULL_TREE; tree size; tree itype = NULL_TREE; tree iterator; ! /* The type of BASE. */ tree atype = TREE_TYPE (base); /* The type of an element in the array. */ tree type = TREE_TYPE (atype); *************** build_vec_init (tree base, tree maxindex *** 2639,2654 **** int num_initialized_elts = 0; bool is_global; ! if (TYPE_DOMAIN (atype)) maxindex = array_type_nelts (atype); if (maxindex == NULL_TREE || maxindex == error_mark_node) return error_mark_node; ! if (explicit_default_init_p) gcc_assert (!init); ! inner_elt_type = strip_array_types (atype); if (init && (from_array == 2 ? (!CLASS_TYPE_P (inner_elt_type) --- 2664,2679 ---- int num_initialized_elts = 0; bool is_global; ! if (TREE_CODE (atype) == ARRAY_TYPE && TYPE_DOMAIN (atype)) maxindex = array_type_nelts (atype); if (maxindex == NULL_TREE || maxindex == error_mark_node) return error_mark_node; ! if (explicit_value_init_p) gcc_assert (!init); ! inner_elt_type = strip_array_types (type); if (init && (from_array == 2 ? (!CLASS_TYPE_P (inner_elt_type) *************** build_vec_init (tree base, tree maxindex *** 2665,2679 **** brace-enclosed initializers. In this case, digest_init and store_constructor will handle the semantics for us. */ stmt_expr = build2 (INIT_EXPR, atype, base, init); return stmt_expr; } maxindex = cp_convert (ptrdiff_type_node, maxindex); - ptype = build_pointer_type (type); size = size_in_bytes (type); ! if (TREE_CODE (TREE_TYPE (base)) == ARRAY_TYPE) ! base = cp_convert (ptype, decay_conversion (base)); /* The code we are generating looks like: ({ --- 2690,2709 ---- brace-enclosed initializers. In this case, digest_init and store_constructor will handle the semantics for us. */ + gcc_assert (TREE_CODE (atype) == ARRAY_TYPE); stmt_expr = build2 (INIT_EXPR, atype, base, init); return stmt_expr; } maxindex = cp_convert (ptrdiff_type_node, maxindex); size = size_in_bytes (type); ! if (TREE_CODE (atype) == ARRAY_TYPE) ! { ! ptype = build_pointer_type (type); ! base = cp_convert (ptype, decay_conversion (base)); ! } ! else ! ptype = atype; /* The code we are generating looks like: ({ *************** build_vec_init (tree base, tree maxindex *** 2736,2750 **** num_initialized_elts++; current_stmt_tree ()->stmts_are_full_exprs_p = 1; ! if (IS_AGGR_TYPE (type) || TREE_CODE (type) == ARRAY_TYPE) ! finish_expr_stmt (build_aggr_init (baseref, elt, 0)); else ! finish_expr_stmt (build_modify_expr (baseref, NOP_EXPR, ! elt)); current_stmt_tree ()->stmts_are_full_exprs_p = 0; ! finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base, 0)); ! finish_expr_stmt (build_unary_op (PREDECREMENT_EXPR, iterator, 0)); } /* Clear out INIT so that we don't get confused below. */ --- 2766,2782 ---- num_initialized_elts++; current_stmt_tree ()->stmts_are_full_exprs_p = 1; ! if (MAYBE_CLASS_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE) ! finish_expr_stmt (build_aggr_init (baseref, elt, 0, complain)); else ! finish_expr_stmt (cp_build_modify_expr (baseref, NOP_EXPR, ! elt, complain)); current_stmt_tree ()->stmts_are_full_exprs_p = 0; ! finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base, 0, ! complain)); ! finish_expr_stmt (cp_build_unary_op (PREDECREMENT_EXPR, iterator, 0, ! complain)); } /* Clear out INIT so that we don't get confused below. */ *************** build_vec_init (tree base, tree maxindex *** 2766,2772 **** && TYPE_NEEDS_CONSTRUCTING (type) && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type)) { ! error ("initializer ends prematurely"); return error_mark_node; } } --- 2798,2805 ---- && TYPE_NEEDS_CONSTRUCTING (type) && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type)) { ! if (complain & tf_error) ! error ("initializer ends prematurely"); return error_mark_node; } } *************** build_vec_init (tree base, tree maxindex *** 2778,2784 **** We do need to keep going if we're copying an array. */ if (from_array ! || ((TYPE_NEEDS_CONSTRUCTING (type) || explicit_default_init_p) && ! (host_integerp (maxindex, 0) && (num_initialized_elts == tree_low_cst (maxindex, 0) + 1)))) --- 2811,2817 ---- We do need to keep going if we're copying an array. */ if (from_array ! || ((TYPE_NEEDS_CONSTRUCTING (type) || explicit_value_init_p) && ! (host_integerp (maxindex, 0) && (num_initialized_elts == tree_low_cst (maxindex, 0) + 1)))) *************** build_vec_init (tree base, tree maxindex *** 2794,2800 **** finish_for_cond (build2 (NE_EXPR, boolean_type_node, iterator, build_int_cst (TREE_TYPE (iterator), -1)), for_stmt); ! finish_for_expr (build_unary_op (PREDECREMENT_EXPR, iterator, 0), for_stmt); to = build1 (INDIRECT_REF, type, base); --- 2827,2834 ---- finish_for_cond (build2 (NE_EXPR, boolean_type_node, iterator, build_int_cst (TREE_TYPE (iterator), -1)), for_stmt); ! finish_for_expr (cp_build_unary_op (PREDECREMENT_EXPR, iterator, 0, ! complain), for_stmt); to = build1 (INDIRECT_REF, type, base); *************** build_vec_init (tree base, tree maxindex *** 2809,2819 **** from = NULL_TREE; if (from_array == 2) ! elt_init = build_modify_expr (to, NOP_EXPR, from); else if (TYPE_NEEDS_CONSTRUCTING (type)) ! elt_init = build_aggr_init (to, from, 0); else if (from) ! elt_init = build_modify_expr (to, NOP_EXPR, from); else gcc_unreachable (); } --- 2843,2855 ---- from = NULL_TREE; if (from_array == 2) ! elt_init = cp_build_modify_expr (to, NOP_EXPR, from, ! complain); else if (TYPE_NEEDS_CONSTRUCTING (type)) ! elt_init = build_aggr_init (to, from, 0, complain); else if (from) ! elt_init = cp_build_modify_expr (to, NOP_EXPR, from, ! complain); else gcc_unreachable (); } *************** build_vec_init (tree base, tree maxindex *** 2824,2847 **** ("cannot initialize multi-dimensional array with initializer"); elt_init = build_vec_init (build1 (INDIRECT_REF, type, base), 0, 0, ! /*explicit_default_init_p=*/false, ! 0); } ! else if (!TYPE_NEEDS_CONSTRUCTING (type)) ! elt_init = (build_modify_expr ! (to, INIT_EXPR, ! build_zero_init (type, size_one_node, ! /*static_storage_p=*/false))); else ! elt_init = build_aggr_init (to, init, 0); current_stmt_tree ()->stmts_are_full_exprs_p = 1; finish_expr_stmt (elt_init); current_stmt_tree ()->stmts_are_full_exprs_p = 0; ! finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base, 0)); if (base2) ! finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base2, 0)); finish_for_stmt (for_stmt); } --- 2860,2886 ---- ("cannot initialize multi-dimensional array with initializer"); elt_init = build_vec_init (build1 (INDIRECT_REF, type, base), 0, 0, ! explicit_value_init_p, ! 0, complain); } ! else if (explicit_value_init_p) ! elt_init = build2 (INIT_EXPR, type, to, ! build_value_init (type)); else ! { ! gcc_assert (TYPE_NEEDS_CONSTRUCTING (type)); ! elt_init = build_aggr_init (to, init, 0, complain); ! } current_stmt_tree ()->stmts_are_full_exprs_p = 1; finish_expr_stmt (elt_init); current_stmt_tree ()->stmts_are_full_exprs_p = 0; ! finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base, 0, ! complain)); if (base2) ! finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base2, 0, ! complain)); finish_for_stmt (for_stmt); } *************** build_vec_init (tree base, tree maxindex *** 2851,2863 **** && from_array != 2) { tree e; ! tree m = cp_build_binary_op (MINUS_EXPR, maxindex, iterator); /* Flatten multi-dimensional array since build_vec_delete only expects one-dimensional array. */ if (TREE_CODE (type) == ARRAY_TYPE) ! m = cp_build_binary_op (MULT_EXPR, m, ! array_type_nelts_total (type)); finish_cleanup_try_block (try_block); e = build_vec_delete_1 (rval, m, --- 2890,2906 ---- && from_array != 2) { tree e; ! tree m = cp_build_binary_op (input_location, ! MINUS_EXPR, maxindex, iterator, ! complain); /* Flatten multi-dimensional array since build_vec_delete only expects one-dimensional array. */ if (TREE_CODE (type) == ARRAY_TYPE) ! m = cp_build_binary_op (input_location, ! MULT_EXPR, m, ! array_type_nelts_total (type), ! complain); finish_cleanup_try_block (try_block); e = build_vec_delete_1 (rval, m, *************** build_vec_init (tree base, tree maxindex *** 2872,2881 **** stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt); ! /* Now convert make the result have the correct type. */ ! atype = build_pointer_type (atype); ! stmt_expr = build1 (NOP_EXPR, atype, stmt_expr); ! stmt_expr = build_indirect_ref (stmt_expr, NULL); current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps; return stmt_expr; --- 2915,2927 ---- stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt); ! /* Now make the result have the correct type. */ ! if (TREE_CODE (atype) == ARRAY_TYPE) ! { ! atype = build_pointer_type (atype); ! stmt_expr = build1 (NOP_EXPR, atype, stmt_expr); ! stmt_expr = cp_build_indirect_ref (stmt_expr, NULL, complain); ! } current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps; return stmt_expr; *************** build_dtor_call (tree exp, special_funct *** 2911,2917 **** /*args=*/NULL_TREE, /*conversion_path=*/NULL_TREE, flags, ! /*fn_p=*/NULL); } /* Generate a call to a destructor. TYPE is the type to cast ADDR to. --- 2957,2964 ---- /*args=*/NULL_TREE, /*conversion_path=*/NULL_TREE, flags, ! /*fn_p=*/NULL, ! tf_warning_or_error); } /* Generate a call to a destructor. TYPE is the type to cast ADDR to. *************** build_delete (tree type, tree addr, spec *** 2958,2973 **** complete_type (type); if (!COMPLETE_TYPE_P (type)) { ! warning (0, "possible problem detected in invocation of " ! "delete operator:"); ! cxx_incomplete_type_diagnostic (addr, type, 1); ! inform ("neither the destructor nor the class-specific " ! "operator delete will be called, even if they are " ! "declared when the class is defined."); complete_p = false; } } ! if (VOID_TYPE_P (type) || !complete_p || !IS_AGGR_TYPE (type)) /* Call the builtin operator delete. */ return build_builtin_delete_call (addr); if (TREE_SIDE_EFFECTS (addr)) --- 3005,3022 ---- complete_type (type); if (!COMPLETE_TYPE_P (type)) { ! if (warning (0, "possible problem detected in invocation of " ! "delete operator:")) ! { ! cxx_incomplete_type_diagnostic (addr, type, DK_WARNING); ! inform (input_location, "neither the destructor nor the class-specific " ! "operator delete will be called, even if they are " ! "declared when the class is defined."); ! } complete_p = false; } } ! if (VOID_TYPE_P (type) || !complete_p || !MAYBE_CLASS_TYPE_P (type)) /* Call the builtin operator delete. */ return build_builtin_delete_call (addr); if (TREE_SIDE_EFFECTS (addr)) *************** build_delete (tree type, tree addr, spec *** 2993,3006 **** /* Don't check PROTECT here; leave that decision to the destructor. If the destructor is accessible, call it, else report error. */ ! addr = build_unary_op (ADDR_EXPR, addr, 0); if (TREE_SIDE_EFFECTS (addr)) addr = save_expr (addr); addr = convert_force (build_pointer_type (type), addr, 0); } ! gcc_assert (IS_AGGR_TYPE (type)); if (TYPE_HAS_TRIVIAL_DESTRUCTOR (type)) { --- 3042,3055 ---- /* Don't check PROTECT here; leave that decision to the destructor. If the destructor is accessible, call it, else report error. */ ! addr = cp_build_unary_op (ADDR_EXPR, addr, 0, tf_warning_or_error); if (TREE_SIDE_EFFECTS (addr)) addr = save_expr (addr); addr = convert_force (build_pointer_type (type), addr, 0); } ! gcc_assert (MAYBE_CLASS_TYPE_P (type)); if (TYPE_HAS_TRIVIAL_DESTRUCTOR (type)) { *************** build_delete (tree type, tree addr, spec *** 3065,3071 **** /*alloc_fn=*/NULL_TREE); } ! expr = build_dtor_call (build_indirect_ref (addr, NULL), auto_delete, flags); if (do_delete) expr = build2 (COMPOUND_EXPR, void_type_node, expr, do_delete); --- 3114,3121 ---- /*alloc_fn=*/NULL_TREE); } ! expr = build_dtor_call (cp_build_indirect_ref (addr, NULL, ! tf_warning_or_error), auto_delete, flags); if (do_delete) expr = build2 (COMPOUND_EXPR, void_type_node, expr, do_delete); *************** build_delete (tree type, tree addr, spec *** 3079,3085 **** ifexp = integer_one_node; else /* Handle deleting a null pointer. */ ! ifexp = fold (cp_build_binary_op (NE_EXPR, addr, integer_zero_node)); if (ifexp != integer_one_node) expr = build3 (COND_EXPR, void_type_node, --- 3129,3137 ---- ifexp = integer_one_node; else /* Handle deleting a null pointer. */ ! ifexp = fold (cp_build_binary_op (input_location, ! NE_EXPR, addr, integer_zero_node, ! tf_warning_or_error)); if (ifexp != integer_one_node) expr = build3 (COND_EXPR, void_type_node, *************** push_base_cleanups (void) *** 3123,3129 **** NULL_TREE, base_binfo, (LOOKUP_NORMAL ! | LOOKUP_NONVIRTUAL)); expr = build3 (COND_EXPR, void_type_node, cond, expr, void_zero_node); finish_decl_cleanup (NULL_TREE, expr); --- 3175,3182 ---- NULL_TREE, base_binfo, (LOOKUP_NORMAL ! | LOOKUP_NONVIRTUAL), ! tf_warning_or_error); expr = build3 (COND_EXPR, void_type_node, cond, expr, void_zero_node); finish_decl_cleanup (NULL_TREE, expr); *************** push_base_cleanups (void) *** 3142,3148 **** expr = build_special_member_call (current_class_ref, base_dtor_identifier, NULL_TREE, base_binfo, ! LOOKUP_NORMAL | LOOKUP_NONVIRTUAL); finish_decl_cleanup (NULL_TREE, expr); } --- 3195,3202 ---- expr = build_special_member_call (current_class_ref, base_dtor_identifier, NULL_TREE, base_binfo, ! LOOKUP_NORMAL | LOOKUP_NONVIRTUAL, ! tf_warning_or_error); finish_decl_cleanup (NULL_TREE, expr); } *************** push_base_cleanups (void) *** 3158,3164 **** tree this_member = (build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, ! /*preserve_reference=*/false)); tree this_type = TREE_TYPE (member); expr = build_delete (this_type, this_member, sfk_complete_destructor, --- 3212,3219 ---- tree this_member = (build_class_member_access_expr (current_class_ref, member, /*access_path=*/NULL_TREE, ! /*preserve_reference=*/false, ! tf_warning_or_error)); tree this_type = TREE_TYPE (member); expr = build_delete (this_type, this_member, sfk_complete_destructor, *************** build_vec_delete (tree base, tree maxind *** 3199,3204 **** --- 3254,3260 ---- { /* Step back one from start of vector, and read dimension. */ tree cookie_addr; + tree size_ptr_type = build_pointer_type (sizetype); if (TREE_SIDE_EFFECTS (base)) { *************** build_vec_delete (tree base, tree maxind *** 3208,3217 **** type = strip_array_types (TREE_TYPE (type)); cookie_addr = fold_build1 (NEGATE_EXPR, sizetype, TYPE_SIZE_UNIT (sizetype)); cookie_addr = build2 (POINTER_PLUS_EXPR, ! build_pointer_type (sizetype), ! base, cookie_addr); ! maxindex = build_indirect_ref (cookie_addr, NULL); } else if (TREE_CODE (type) == ARRAY_TYPE) { --- 3264,3273 ---- type = strip_array_types (TREE_TYPE (type)); cookie_addr = fold_build1 (NEGATE_EXPR, sizetype, TYPE_SIZE_UNIT (sizetype)); cookie_addr = build2 (POINTER_PLUS_EXPR, ! size_ptr_type, ! fold_convert (size_ptr_type, base), cookie_addr); ! maxindex = cp_build_indirect_ref (cookie_addr, NULL, tf_warning_or_error); } else if (TREE_CODE (type) == ARRAY_TYPE) { *************** build_vec_delete (tree base, tree maxind *** 3219,3225 **** bad name. */ maxindex = array_type_nelts_total (type); type = strip_array_types (type); ! base = build_unary_op (ADDR_EXPR, base, 1); if (TREE_SIDE_EFFECTS (base)) { base_init = get_target_expr (base); --- 3275,3281 ---- bad name. */ maxindex = array_type_nelts_total (type); type = strip_array_types (type); ! base = cp_build_unary_op (ADDR_EXPR, base, 1, tf_warning_or_error); if (TREE_SIDE_EFFECTS (base)) { base_init = get_target_expr (base); diff -Nrcpad gcc-4.3.3/gcc/cp/lex.c gcc-4.4.0/gcc/cp/lex.c *** gcc-4.3.3/gcc/cp/lex.c Mon Nov 12 00:38:48 2007 --- gcc-4.4.0/gcc/cp/lex.c Thu Mar 26 15:17:26 2009 *************** *** 1,6 **** /* Separate lexical analyzer for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,6 ---- /* Separate lexical analyzer for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** struct impl_files *** 81,86 **** --- 81,88 ---- static struct impl_files *impl_file_chain; + /* True if we saw "#pragma GCC java_exceptions". */ + bool pragma_java_exceptions; void cxx_finish (void) *************** cxx_finish (void) *** 89,97 **** } /* A mapping from tree codes to operator name information. */ ! operator_name_info_t operator_name_info[(int) LAST_CPLUS_TREE_CODE]; /* Similar, but for assignment operators. */ ! operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE]; /* Initialize data structures that keep track of operator names. */ --- 91,99 ---- } /* A mapping from tree codes to operator name information. */ ! operator_name_info_t operator_name_info[(int) MAX_TREE_CODES]; /* Similar, but for assignment operators. */ ! operator_name_info_t assignment_operator_name_info[(int) MAX_TREE_CODES]; /* Initialize data structures that keep track of operator names. */ *************** init_operators (void) *** 163,350 **** = "(round %=)"; } ! /* The reserved keyword table. */ ! struct resword ! { ! const char *const word; ! ENUM_BITFIELD(rid) const rid : 16; ! const unsigned int disable : 16; ! }; ! ! /* Disable mask. Keywords are disabled if (reswords[i].disable & mask) is ! _true_. */ ! #define D_EXT 0x01 /* GCC extension */ ! #define D_ASM 0x02 /* in C99, but has a switch to turn it off */ ! #define D_OBJC 0x04 /* Objective C++ only */ ! #define D_CXX0X 0x08 /* C++0x only */ ! ! CONSTRAINT(ridbits_fit, RID_LAST_MODIFIER < sizeof(unsigned long) * CHAR_BIT); ! ! static const struct resword reswords[] = ! { ! { "_Complex", RID_COMPLEX, 0 }, ! { "__FUNCTION__", RID_FUNCTION_NAME, 0 }, ! { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 }, ! { "__alignof", RID_ALIGNOF, 0 }, ! { "__alignof__", RID_ALIGNOF, 0 }, ! { "__asm", RID_ASM, 0 }, ! { "__asm__", RID_ASM, 0 }, ! { "__attribute", RID_ATTRIBUTE, 0 }, ! { "__attribute__", RID_ATTRIBUTE, 0 }, ! { "__builtin_offsetof", RID_OFFSETOF, 0 }, ! { "__builtin_va_arg", RID_VA_ARG, 0 }, ! { "__complex", RID_COMPLEX, 0 }, ! { "__complex__", RID_COMPLEX, 0 }, ! { "__const", RID_CONST, 0 }, ! { "__const__", RID_CONST, 0 }, ! { "__decltype", RID_DECLTYPE, 0 }, ! { "__extension__", RID_EXTENSION, 0 }, ! { "__func__", RID_C99_FUNCTION_NAME, 0 }, ! { "__has_nothrow_assign", RID_HAS_NOTHROW_ASSIGN, 0 }, ! { "__has_nothrow_constructor", RID_HAS_NOTHROW_CONSTRUCTOR, 0 }, ! { "__has_nothrow_copy", RID_HAS_NOTHROW_COPY, 0 }, ! { "__has_trivial_assign", RID_HAS_TRIVIAL_ASSIGN, 0 }, ! { "__has_trivial_constructor", RID_HAS_TRIVIAL_CONSTRUCTOR, 0 }, ! { "__has_trivial_copy", RID_HAS_TRIVIAL_COPY, 0 }, ! { "__has_trivial_destructor", RID_HAS_TRIVIAL_DESTRUCTOR, 0 }, ! { "__has_virtual_destructor", RID_HAS_VIRTUAL_DESTRUCTOR, 0 }, ! { "__is_abstract", RID_IS_ABSTRACT, 0 }, ! { "__is_base_of", RID_IS_BASE_OF, 0 }, ! { "__is_class", RID_IS_CLASS, 0 }, ! { "__is_convertible_to", RID_IS_CONVERTIBLE_TO, 0 }, ! { "__is_empty", RID_IS_EMPTY, 0 }, ! { "__is_enum", RID_IS_ENUM, 0 }, ! { "__is_pod", RID_IS_POD, 0 }, ! { "__is_polymorphic", RID_IS_POLYMORPHIC, 0 }, ! { "__is_union", RID_IS_UNION, 0 }, ! { "__imag", RID_IMAGPART, 0 }, ! { "__imag__", RID_IMAGPART, 0 }, ! { "__inline", RID_INLINE, 0 }, ! { "__inline__", RID_INLINE, 0 }, ! { "__label__", RID_LABEL, 0 }, ! { "__null", RID_NULL, 0 }, ! { "__real", RID_REALPART, 0 }, ! { "__real__", RID_REALPART, 0 }, ! { "__restrict", RID_RESTRICT, 0 }, ! { "__restrict__", RID_RESTRICT, 0 }, ! { "__signed", RID_SIGNED, 0 }, ! { "__signed__", RID_SIGNED, 0 }, ! { "__thread", RID_THREAD, 0 }, ! { "__typeof", RID_TYPEOF, 0 }, ! { "__typeof__", RID_TYPEOF, 0 }, ! { "__volatile", RID_VOLATILE, 0 }, ! { "__volatile__", RID_VOLATILE, 0 }, ! { "asm", RID_ASM, D_ASM }, ! { "auto", RID_AUTO, 0 }, ! { "bool", RID_BOOL, 0 }, ! { "break", RID_BREAK, 0 }, ! { "case", RID_CASE, 0 }, ! { "catch", RID_CATCH, 0 }, ! { "char", RID_CHAR, 0 }, ! { "class", RID_CLASS, 0 }, ! { "const", RID_CONST, 0 }, ! { "const_cast", RID_CONSTCAST, 0 }, ! { "continue", RID_CONTINUE, 0 }, ! { "decltype", RID_DECLTYPE, D_CXX0X }, ! { "default", RID_DEFAULT, 0 }, ! { "delete", RID_DELETE, 0 }, ! { "do", RID_DO, 0 }, ! { "double", RID_DOUBLE, 0 }, ! { "dynamic_cast", RID_DYNCAST, 0 }, ! { "else", RID_ELSE, 0 }, ! { "enum", RID_ENUM, 0 }, ! { "explicit", RID_EXPLICIT, 0 }, ! { "export", RID_EXPORT, 0 }, ! { "extern", RID_EXTERN, 0 }, ! { "false", RID_FALSE, 0 }, ! { "float", RID_FLOAT, 0 }, ! { "for", RID_FOR, 0 }, ! { "friend", RID_FRIEND, 0 }, ! { "goto", RID_GOTO, 0 }, ! { "if", RID_IF, 0 }, ! { "inline", RID_INLINE, 0 }, ! { "int", RID_INT, 0 }, ! { "long", RID_LONG, 0 }, ! { "mutable", RID_MUTABLE, 0 }, ! { "namespace", RID_NAMESPACE, 0 }, ! { "new", RID_NEW, 0 }, ! { "operator", RID_OPERATOR, 0 }, ! { "private", RID_PRIVATE, 0 }, ! { "protected", RID_PROTECTED, 0 }, ! { "public", RID_PUBLIC, 0 }, ! { "register", RID_REGISTER, 0 }, ! { "reinterpret_cast", RID_REINTCAST, 0 }, ! { "return", RID_RETURN, 0 }, ! { "short", RID_SHORT, 0 }, ! { "signed", RID_SIGNED, 0 }, ! { "sizeof", RID_SIZEOF, 0 }, ! { "static", RID_STATIC, 0 }, ! { "static_assert", RID_STATIC_ASSERT, D_CXX0X }, ! { "static_cast", RID_STATCAST, 0 }, ! { "struct", RID_STRUCT, 0 }, ! { "switch", RID_SWITCH, 0 }, ! { "template", RID_TEMPLATE, 0 }, ! { "this", RID_THIS, 0 }, ! { "throw", RID_THROW, 0 }, ! { "true", RID_TRUE, 0 }, ! { "try", RID_TRY, 0 }, ! { "typedef", RID_TYPEDEF, 0 }, ! { "typename", RID_TYPENAME, 0 }, ! { "typeid", RID_TYPEID, 0 }, ! { "typeof", RID_TYPEOF, D_ASM|D_EXT }, ! { "union", RID_UNION, 0 }, ! { "unsigned", RID_UNSIGNED, 0 }, ! { "using", RID_USING, 0 }, ! { "virtual", RID_VIRTUAL, 0 }, ! { "void", RID_VOID, 0 }, ! { "volatile", RID_VOLATILE, 0 }, ! { "wchar_t", RID_WCHAR, 0 }, ! { "while", RID_WHILE, 0 }, ! ! /* The remaining keywords are specific to Objective-C++. NB: ! All of them will remain _disabled_, since they are context- ! sensitive. */ ! ! /* These ObjC keywords are recognized only immediately after ! an '@'. NB: The following C++ keywords double as ! ObjC keywords in this context: RID_CLASS, RID_PRIVATE, ! RID_PROTECTED, RID_PUBLIC, RID_THROW, RID_TRY and RID_CATCH. */ ! { "compatibility_alias", RID_AT_ALIAS, D_OBJC }, ! { "defs", RID_AT_DEFS, D_OBJC }, ! { "encode", RID_AT_ENCODE, D_OBJC }, ! { "end", RID_AT_END, D_OBJC }, ! { "implementation", RID_AT_IMPLEMENTATION, D_OBJC }, ! { "interface", RID_AT_INTERFACE, D_OBJC }, ! { "protocol", RID_AT_PROTOCOL, D_OBJC }, ! { "selector", RID_AT_SELECTOR, D_OBJC }, ! { "finally", RID_AT_FINALLY, D_OBJC }, ! { "synchronized", RID_AT_SYNCHRONIZED, D_OBJC }, ! /* These are recognized only in protocol-qualifier context. */ ! { "bycopy", RID_BYCOPY, D_OBJC }, ! { "byref", RID_BYREF, D_OBJC }, ! { "in", RID_IN, D_OBJC }, ! { "inout", RID_INOUT, D_OBJC }, ! { "oneway", RID_ONEWAY, D_OBJC }, ! { "out", RID_OUT, D_OBJC }, ! }; void init_reswords (void) { unsigned int i; tree id; ! int mask = ((flag_no_asm ? D_ASM : 0) ! | D_OBJC ! | (flag_no_gnu_keywords ? D_EXT : 0) ! | ((cxx_dialect == cxx0x) ? 0 : D_CXX0X)); ridpointers = GGC_CNEWVEC (tree, (int) RID_MAX); ! for (i = 0; i < ARRAY_SIZE (reswords); i++) { ! id = get_identifier (reswords[i].word); ! C_RID_CODE (id) = reswords[i].rid; ! ridpointers [(int) reswords[i].rid] = id; ! if (! (reswords[i].disable & mask)) C_IS_RESERVED_WORD (id) = 1; } } --- 165,198 ---- = "(round %=)"; } ! /* Initialize the reserved words. */ void init_reswords (void) { unsigned int i; tree id; ! int mask = 0; ! ! if (cxx_dialect != cxx0x) ! mask |= D_CXX0X; ! if (flag_no_asm) ! mask |= D_ASM | D_EXT; ! if (flag_no_gnu_keywords) ! mask |= D_EXT; ! ! /* The Objective-C keywords are all context-dependent. */ ! mask |= D_OBJC; ridpointers = GGC_CNEWVEC (tree, (int) RID_MAX); ! for (i = 0; i < num_c_common_reswords; i++) { ! if (c_common_reswords[i].disable & D_CONLY) ! continue; ! id = get_identifier (c_common_reswords[i].word); ! C_SET_RID_CODE (id, c_common_reswords[i].rid); ! ridpointers [(int) c_common_reswords[i].rid] = id; ! if (! (c_common_reswords[i].disable & mask)) C_IS_RESERVED_WORD (id) = 1; } } *************** bool statement_code_p[MAX_TREE_CODES]; *** 372,377 **** --- 220,226 ---- bool cxx_init (void) { + location_t saved_loc; unsigned int i; static const enum tree_code stmt_codes[] = { CTOR_INITIALIZER, TRY_BLOCK, HANDLER, *************** cxx_init (void) *** 385,398 **** for (i = 0; i < ARRAY_SIZE (stmt_codes); i++) statement_code_p[stmt_codes[i]] = true; ! /* We cannot just assign to input_filename because it has already ! been initialized and will be used later as an N_BINCL for stabs+ ! debugging. */ ! #ifdef USE_MAPPED_LOCATION ! push_srcloc (BUILTINS_LOCATION); ! #else ! push_srcloc ("", 0); ! #endif init_reswords (); init_tree (); --- 234,241 ---- for (i = 0; i < ARRAY_SIZE (stmt_codes); i++) statement_code_p[stmt_codes[i]] = true; ! saved_loc = input_location; ! input_location = BUILTINS_LOCATION; init_reswords (); init_tree (); *************** cxx_init (void) *** 407,426 **** cxx_init_decl_processing (); - /* The fact that G++ uses COMDAT for many entities (inline - functions, template instantiations, virtual tables, etc.) mean - that it is fundamentally unreliable to try to make decisions - about whether or not to output a particular entity until the end - of the compilation. However, the inliner requires that functions - be provided to the back end if they are to be inlined. - Therefore, we always use unit-at-a-time mode; in that mode, we - can provide entities to the back end and it will decide what to - emit based on what is actually needed. */ - flag_unit_at_a_time = 1; - if (c_common_init () == false) { ! pop_srcloc(); return false; } --- 250,258 ---- cxx_init_decl_processing (); if (c_common_init () == false) { ! input_location = saved_loc; return false; } *************** cxx_init (void) *** 428,434 **** init_repo (); ! pop_srcloc(); return true; } --- 260,266 ---- init_repo (); ! input_location = saved_loc; return true; } *************** handle_pragma_interface (cpp_reader* dfi *** 523,529 **** else if (fname == 0) filename = lbasename (input_filename); else ! filename = ggc_strdup (TREE_STRING_POINTER (fname)); finfo = get_fileinfo (input_filename); --- 355,361 ---- else if (fname == 0) filename = lbasename (input_filename); else ! filename = TREE_STRING_POINTER (fname); finfo = get_fileinfo (input_filename); *************** handle_pragma_implementation (cpp_reader *** 571,588 **** } else { ! filename = ggc_strdup (TREE_STRING_POINTER (fname)); ! #ifdef USE_MAPPED_LOCATION ! /* We currently cannot give this diagnostic, as we reach this point ! only after cpplib has scanned the entire translation unit, so ! cpp_included always returns true. A plausible fix is to compare ! the current source-location cookie with the first source-location ! cookie (if any) of the filename, but this requires completing the ! --enable-mapped-location project first. See PR 17577. */ if (cpp_included_before (parse_in, filename, input_location)) warning (0, "#pragma implementation for %qs appears after " "file is included", filename); - #endif } for (; ifiles; ifiles = ifiles->next) --- 403,412 ---- } else { ! filename = TREE_STRING_POINTER (fname); if (cpp_included_before (parse_in, filename, input_location)) warning (0, "#pragma implementation for %qs appears after " "file is included", filename); } for (; ifiles; ifiles = ifiles->next) *************** handle_pragma_implementation (cpp_reader *** 593,599 **** if (ifiles == 0) { ifiles = XNEW (struct impl_files); ! ifiles->filename = filename; ifiles->next = impl_file_chain; impl_file_chain = ifiles; } --- 417,423 ---- if (ifiles == 0) { ifiles = XNEW (struct impl_files); ! ifiles->filename = xstrdup (filename); ifiles->next = impl_file_chain; impl_file_chain = ifiles; } *************** handle_pragma_java_exceptions (cpp_reade *** 608,613 **** --- 432,438 ---- warning (0, "junk at end of #pragma GCC java_exceptions"); choose_personality_routine (lang_java); + pragma_java_exceptions = true; } /* Issue an error message indicating that the lookup of NAME (an *************** unqualified_fn_lookup_error (tree name) *** 660,675 **** Note that we have the exact wording of the following message in the manual (trouble.texi, node "Name lookup"), so they need to be kept in synch. */ ! pedwarn ("there are no arguments to %qD that depend on a template " ! "parameter, so a declaration of %qD must be available", ! name, name); if (!flag_permissive) { static bool hint; if (!hint) { ! error ("(if you use %<-fpermissive%>, G++ will accept your " "code, but allowing the use of an undeclared name is " "deprecated)"); hint = true; --- 485,500 ---- Note that we have the exact wording of the following message in the manual (trouble.texi, node "Name lookup"), so they need to be kept in synch. */ ! permerror (input_location, "there are no arguments to %qD that depend on a template " ! "parameter, so a declaration of %qD must be available", ! name, name); if (!flag_permissive) { static bool hint; if (!hint) { ! inform (input_location, "(if you use %<-fpermissive%>, G++ will accept your " "code, but allowing the use of an undeclared name is " "deprecated)"); hint = true; *************** cxx_make_type (enum tree_code code) *** 814,820 **** tree t = make_node (code); /* Create lang_type structure. */ ! if (IS_AGGR_TYPE_CODE (code) || code == BOUND_TEMPLATE_TEMPLATE_PARM) { struct lang_type *pi = GGC_CNEW (struct lang_type); --- 639,645 ---- tree t = make_node (code); /* Create lang_type structure. */ ! if (RECORD_OR_UNION_CODE_P (code) || code == BOUND_TEMPLATE_TEMPLATE_PARM) { struct lang_type *pi = GGC_CNEW (struct lang_type); *************** cxx_make_type (enum tree_code code) *** 829,835 **** } /* Set up some flags that give proper default behavior. */ ! if (IS_AGGR_TYPE_CODE (code)) { struct c_fileinfo *finfo = get_fileinfo (input_filename); SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, finfo->interface_unknown); --- 654,660 ---- } /* Set up some flags that give proper default behavior. */ ! if (RECORD_OR_UNION_CODE_P (code)) { struct c_fileinfo *finfo = get_fileinfo (input_filename); SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, finfo->interface_unknown); *************** cxx_make_type (enum tree_code code) *** 840,852 **** } tree ! make_aggr_type (enum tree_code code) { tree t = cxx_make_type (code); ! ! if (IS_AGGR_TYPE_CODE (code)) ! SET_IS_AGGR_TYPE (t, 1); ! return t; } --- 665,674 ---- } tree ! make_class_type (enum tree_code code) { tree t = cxx_make_type (code); ! SET_CLASS_TYPE_P (t, 1); return t; } diff -Nrcpad gcc-4.3.3/gcc/cp/mangle.c gcc-4.4.0/gcc/cp/mangle.c *** gcc-4.3.3/gcc/cp/mangle.c Thu Jan 31 20:06:33 2008 --- gcc-4.4.0/gcc/cp/mangle.c Thu Apr 2 18:37:57 2009 *************** *** 1,5 **** /* Name mangling for the 3.0 C++ ABI. ! Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Alex Samuel --- 1,5 ---- /* Name mangling for the 3.0 C++ ABI. ! Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Written by Alex Samuel *************** static struct obstack name_obstack; *** 117,129 **** allocated on the name_obstack. */ static void *name_base; - /* An incomplete mangled name. There will be no NUL terminator. If - there is no incomplete mangled name, this variable is NULL. */ - static char *partially_mangled_name; - - /* The number of characters in the PARTIALLY_MANGLED_NAME. */ - static size_t partially_mangled_name_len; - /* Indices into subst_identifiers. These are identifiers used in special substitution rules. */ typedef enum --- 117,122 ---- *************** static int discriminator_for_string_lite *** 217,227 **** static void write_discriminator (const int); static void write_local_name (const tree, const tree, const tree); static void dump_substitution_candidates (void); ! static const char *mangle_decl_string (const tree); /* Control funct