summaryrefslogtreecommitdiffstats
path: root/gcc/cp/tree.c
Commit message (Collapse)AuthorAgeFilesLines
...
* PR c++/28588mmitchel2006-08-261-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * class.c (resolve_address_of_overloaded_function): Add access_path parameter. Perform access checks. (instantiate_type): Adjust call to resolve_address_of_overloaded_function. Remove unnecessary code. * tree.c (is_overloaded_fn): Document. Return 2 when there are acutally multiple functions. (really_overloaded_fn): Use is_overloaded_fn. * mangle.c (write_expression): Handle BASELINKs. * cp-tree.h (really_overloaded_fn): Return bool. (baselink_for_fns): Declare. * search.c (lookup_member): Check access for single static functions here. * pt.c (convert_nontype_argument_function): Handle BASELINKs. (tsubst_copy_and_build): Generate BASELINKs for template-ids. * semantics.c (finish_call_expr): Use baselink_for_fns. (baselink_for_fns): New function. (finish_id_expression): Use it. * parser.c (cp_parser_template_argument): Don't strip BASELINKs. PR c++/28595 * pt.c (tsubst): Issue errors about attempts to create VLAs at template-instantiation time. PR c++/28588 * g++.dg/inherit/access6.C: New test. * g++.dg/inherit/access7.C: Likewise. PR c++/28595 * g++.dg/template/array15.C: New test. * g++.dg/template/crash2.C: Tweak error markers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116468 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/28659jason2006-08-221-0/+4
| | | | | | | | | | | | * typeck.c (merge_types): If either of the types have the right attributes, return that one. * tree.c (cp_build_type_attribute_variant): Make sure we aren't doing this to class types. * typeck.c (original_type): Deal with type quals properly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116329 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/28741lmillward2006-08-211-1/+1
| | | | | | | | | | | * tree.c (decl_anon_ns_mem_p): Robustify. * decl2.c (determine_visibility): Likewise. * g++.dg/template/void7.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116303 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/28341mmitchel2006-08-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tree.c (cast_valid_in_integral_constant_expression_p): New function. * cp-tree.h (tsubst_copy_and_build): Adjust prototype. * pt.c (tsubst_expr): Add integral_constant_expression_p parameter. (fold_non_dependent_expr): Adjust callers of tsubst_{expr,copy_and_build}. (tsubst_friend_function): Likewise. (tsubst_template_arg): Likewise. (tsubst_default_argument): Likewise. (tsubst_decl): Likewise. (tsubst): Likewise. (tsubst_omp_clasuses): Likewise. (regenerate_decl_fromp_template): Likewise. (instantiate_decl): Likewise. (tsubst_initializer_list): Likewise. (tsubst_enum): Likewise. (tsubst_expr): Use RECUR throughout. (tsubst_copy_and_build): Change definition of RECUR. Do not allow invalid casts in integral constant expressions. * parser.c (cp_parser_postfix_expression): Use cast_valid_in_integral_constant_expression_p. (cp_parser_cast_expression): Likewise. (cp_parser_functional_cast): Likewise. PR c++/28346 * pt.c (tsubst_qualified_id): Do not strip references from OFFSET_REFs. 2006-08-20 Mark Mitchell <mark@codesourcery.com> PR c++/28341 * g++.dg/template/ref3.C: New test. * g++.dg/template/nontype13.C: New test. PR c++/28346 * g++.dg/template/ptrmem17.C: New test. 2006-08-20 Mark Mitchell <mark@codesourcery.com> * objcp-lang.c (objcp_tsubst_copy_and_build): Adjust call to tsubst_copy_and_build. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116276 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/28523mmitchel2006-08-011-37/+48
| | | | | | | | | | | * tree.c (stabilize_expr): Tweak documentation. Add assertion. (stabilize_call): Tweak documentation. (stabilize_init): Only call stabilize_call for calls. PR c++/28523 * g++.dg/eh/cast1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115862 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/28407jason2006-07-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | * cp/decl.c (grokvardecl): Set DECL_THIS_STATIC on file-scope const variables with implicit internal linkage. * cp/tree.c (decl_linkage): Only return lk_external if it's set. PR c++/28409 * cp/decl2.c (constrain_visibility): Ignore the anonymous namespace for extern C decls. (VISIBILITY_STATIC): Rename to VISIBILITY_ANON. Don't override explicit visibility. * cp/decl2.c (constrain_visibility): Remove specified and reason parameters. Don't touch decls that already have explicit visibility. (determine_visibility): Do copy DECL_VISIBILITY_SPECIFIED from template. (determine_visibility_from_class): Reverse sense of DECL_VISIBILITY_SPECIFIED test for target-specific visibility rules. (constrain_class_visibility): Only complain about member visibility if the member type is another class. Don't change visibility of the current class. * tree.c (remove_attribute): New fn. * tree.h: Declare it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115622 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/26905jason2006-06-301-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/26612 PR c++/27000 PR c++/26984 PR c++/19134 * tree.c (build_decl_stat): Don't hande #pragma visibility here. * c-common.c (c_determine_visibility): Handle it here. * c-decl.c (finish_decl): Call c_determine_visibility for functions, too. * flags.h (enum symbol_visibility): Sort from most to least visibility. * tree.h: Likewise. * varasm.c (default_assemble_visibility): Likewise. * c-common.c (handle_visibility_attribute): Complain about trying to give visibility to an already defined class, or trying to change declared visibility. Always attach the attribute. * cp/decl2.c (determine_visibility): Overhaul. (determine_visibility_from_class): Likewise. (min_vis_r, type_visibility, constrain_visibility): New fns. (constrain_visibility_for_template): Likewise. (constrain_class_visibility): Likewise. * cp/decl.c (cp_finish_decl): Call determine_visibility for function decls, too. * cp/name-lookup.c (pushtag): Call determine_visibility. * cp/decl.c (duplicate_decls): Don't copy visibility from template to specialization. * cp/pt.c (check_explicit_specialization): Likewise. (lookup_template_class, tsubst_decl): Call determine_visibility. * cp/class.c (finish_struct_1): Call constrain_class_visibility. PR c++/26905 PR c++/21675 PR c++/17470 * cp/parser.c (cp_parser_explicit_instantiation): Pass the attributes to grokdeclarator. (cp_parser_type_specifier): Allow 'enum __attribute ((...)) E'. (cp_parser_enum_specifier): Likewise. (cp_parser_elaborated_type_specifier): Apply attributes if this declares only the class. (cp_parser_class_specifier): Apply leading attributes immediately. * cp/semantics.c (begin_class_definition): Add attributes parameter, apply them to the type. * attribs.c (decl_attributes): Ignore type-in-place attributes once the type has been defined. PR c++/21581 PR c++/25915 * cp/tree.c (decl_anon_ns_mem_p): New function. * cp/cp-tree.h: Declare it. * cp/decl2.c (determine_visibility): Make anonymous namespace members static. (min_vis_r, constrain_visibility): Likewise. * cp/rtti.c (create_pseudo_type_info): Set TREE_PUBLIC on pseudo-types. * cp/decl.c (cxx_init_decl_processing): Set TREE_PUBLIC on global_namespace. * cp/name-lookup.c (push_namespace_with_attribs): Don't set TREE_PUBLIC on anonymous namespaces. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115086 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix up whitespacingmrs2006-06-061-3/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114428 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/27210mmitchel2006-05-211-0/+14
| | | | | | | | | | | | | * cp-tree.h (cp_save_expr): New function. * init.c (build_new): Correct logic for zero-element array warning. Use cp_save_expr. * tree.c (cp_save_expr): New function. PR c++/27210 * g++.dg/warn/new1.C: New test. * g++.dg/template/new5.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113958 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/27471mmitchel2006-05-191-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/27506 * typeck.c (decay_conversion): Convert bitfields to their declared types here. Improve documentation. Avoid use of cp_convert. (default_conversion): Make it static. Perform integral promotions before lvalue-to-rvalue, function-to-pointer, and array-to-pointer conversions. * init.c (build_init): Remove. (expand_default_init): Do not call rvalue. * call.c (null_ptr_cst_p): Robustify. (build_conditional_expr): Tidy. * except.c (build_throw): Do not perform lvalue-to-rvalue conversion on operand before initializing temporary. * tree.c (convert.h): Include it. (convert_bitfield_to_declared_type): Use convert_to_integer, not cp_convert. (rvalue): Don't convert bitfields to their declared type here. * cp-tree.h (build_init): Remove. (default_conversion): Likewise. * typeck2.c (build_m_component_ref): Do not perform lvalue-to-rvalue, function-to-pointer, or array-to-pointer conversions here. Correct error message. PR c++/27471 PR c++/27506 * g++.dg/conversion/bitfield5.C: New test. * g++.dg/conversion/bitfield6.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113902 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/27505mmitchel2006-05-151-5/+18
| | | | | | | | | | | | | * call.c (convert_like_real): Convert bitfields to their declared types when forming an rvalue. * tree.c (convert_bitfield_to_declared_type): New function. (rvalue): Use it. * cp-tree.h (convert_bitfield_to_declare_type): Declare it. PR c++/27505 * g++.dg/expr/bitfield1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113803 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/27292mmitchel2006-04-281-2/+3
| | | | | | | | | * tree.c (rvalue): Convert bitfields to their declared types. PR c++/27292 * g++.dg/conversion/bitfield4.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113339 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/27292mmitchel2006-04-251-1/+3
| | | | | | | | | | | | | | * typeck.c (decay_conversion): Don't adjust bitfield types. (perform_integral_promotions): Treat bitfield enums as enums, not as short integer types. * tree.c (rvalue): Convert bitfields to their correct types. PR c++/27292 * g++.dg/conversion/bitfield1.C: New test. * g++.dg/conversion/bitfield2.C: Likewise. * g++.dg/conversion/bitfield3.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113240 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/15759reichelt2006-03-061-11/+4
| | | | | | | | | * tree.c (bot_manip): Don't call mark_used. * g++.dg/other/default4.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111754 138bc75d-0d04-0410-961f-82ee72b054a4
* * call.c (alloc_conversion): Use cast when converting fromgdr2006-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | void *. (alloc_conversions): Likewise. (add_candidate): Likewise. (print_z_candidates): Likewise. (add_warning): Likewise. * pt.c (retrieve_local_specialization): Likewise. (process_partial_specialization): Likewise. (mangle_class_name_for_template): Likewise. (tsubst_template_args): Likewise. * typeck2.c (pat_calc_hash): Likewise. (pat_compare): Likewise. (abstract_virtuals_error): Likewise. * class.c (method_name_cmp): Likewise. (resort_method_name_cmp): Likewise. (get_vfield_name): Likewise. * decl2.c (generate_ctor_and_dtor_functions_for_priority): Likewise. * lex.c (init_reswords): Likewise. * rtti.c (create_pseudo_type_info): Likewise. * search.c (dfs_lookup_base): Likewise. (dfs_dcast_hint_pre): Likewise. (dfs_dcast_hint_post): Likewise. * tree.c (hash_tree_cons): Likewise. * repo.c (extract_string): Likewise. (afgets): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_lookup): Likewise. * g++spec.c (lang_specific_driver): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110366 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree.c (find_tree_t, find_tree): Remove.kazu2006-01-181-22/+0
| | | | | | | * cp-tree.h: Remove the prototype for find_tree. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109892 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree.c (lvalue_p_1): Any part of a COMPONENT_REF affectsnathan2006-01-111-3/+0
| | | | | | | | | packedness. * g++.dg/ext/packed3.C: Add expected packed error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109590 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/25635mmitchel2006-01-031-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * class.c (add_method): Set TYPE_HAS_CONVERSION for classes with a conversion operator. * decl.c (grokdeclarator): Do not set TYPE_HAS_CONVERSION here. PR c++/25638 * class.c (add_method): Never associate more than one destructor with a single class. PR c++/25637 * cp-tree.h (do_friend): Adjust prototype. * decl.c (grokfndecl): Make funcdef_flag a bool, not an int. (grokdeclarator): Likewise. Refine check for invalid declarations/definitions of member functions outside of their own class. * friend.c (do_friend): Make funcdef_flag a bool, not an int. PR c++/25633 * parser.c (cp_parser_mem_initializer_list): Check result of cp_parser_mem_initializer against error_mark_node, not NULL_TREE. (cp_parser_mem_initializer): Return error_mark_node for failure. PR c++/25634 * parser.c (cp_parser_template_parameter_list): Call begin_template_parm_list and end_template_parm_list here. (cp_parser_type_parameter): Not here. (cp_parser_template_declaration_after_export): Or here. (cp_parser_elaborated_type_specifier): Call cp_parser_check_template_parameters. * tree.c (build_target_expr_with_type): Use force_target_expr. PR c++/25635 * g++.dg/parse/operator6.C: New test. PR c++/25637 * g++.dg/parse/error29.C: New test. PR c++/25638 * g++.dg/parse/dtor6.C: New test. PR c++/25633 * g++.dg/parse/ctor3.C: New test. PR c++/25634 * g++.dg/template/class3.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109270 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/25369mmitchel2005-12-231-1/+1
| | | | | | | | | | | | | | * g++.dg/template/ptrmem16.C: New test. PR c++/25369 * tree.c (really_overloaded_fn): Tweak comment. * pt.c (tsubst_call_declarator_parms): Remove. (tsubst_copy): Call mark_used on the member referenced by an OFFSET_REF. * semantics.c (finish_qualified_id_expr): Simplify. * decl2.c (mark_used): Accept BASELINKs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109010 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/25300mmitchel2005-12-121-0/+4
| | | | | | | | | | * tree.c (build_qualified_name): Return error_mark_node for erroneous input. PR c++/25300 * g++.dg/template/inherit.C: Do not use a generic error message. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108413 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/22137mmitchel2005-10-161-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cp-tree.h (QUALIFIED_NAME_IS_TEMPLATE): New macro. (check_template_keyword): New function. (finish_id_expression): Change prototoype. (finish_qualified_id_expr): Change prototype. (build_qualified_name): New function. (finish_class_member_access_expr): Change prototype. * init.c (build_offset_ref): Use build_qualified_name. * mangle.c (write_expression): Likewise. * parser.c (cp_parser_primary_expression): Remove qualifying_class parameter. Add address_p and template_arg_p. Use build_qualified_name. (cp_parser_id_expression): Default *template_p to template_keyword_p. Check for invalid uses of the template keyword. (cp_parser_postfix_expression): Eliminate special handling for qualified names. Adjust call to cp_parser_primary_expression. (cp_parser_postfix_dot_deref_expression): Adjust call to cp_parser_id_expression and finish_class_member_access_expr. (cp_parser_template_argument_list): Add comment. (cp_parser_template_argument): Adjust use of cp_parser_primary_expression. Remove call to finish_qualified_id_expr. (cp_parser_lookup_name): Use build_qualified_name. * pt.c (tsubst): Use build_qualified_name. (tsubst_qualified_id): Likewise. Adjust call to finish_qualified_id_expr. (tsubst_copy): Use build_qualified_name. (tsubst_copy_and_build): Adjusts call to finish_id_expression and finish_class_member_access_expr. * semantics.c (finish_non_static_data_member): Use build_qualified_name. (finish_qualified_id_expr): Add template_p and template_arg_p parameters. (finish_id_expression): Remove qualifiying_class parameter. Add template_p, done, address_p, and template_arg_p. Use build_qualified_name. Adjust calls to finish_class_member_acess_expr. * tree.c (build_qualified_name): New function. * typeck.c (check_template_keyword): New function. (finish_class_member_access_expr): Add template_p argument. Check for invalid uses of the template keyword. PR c++/22137 * g++.dg/parse/template18.C: New test. * g++.dg/template/nontype15.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105463 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/23840mmitchel2005-10-021-1/+5
| | | | | | | | | | | * tree.c (lvalue_p1): A VA_ARG_EXPR with class type is an lvalue, when class rvalues are lvalues. PR c++/23840 * g++.dg/expr/stdarg1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104877 138bc75d-0d04-0410-961f-82ee72b054a4
* * cp-tree.h (rvalue): New function.mmitchel2005-09-061-0/+20
| | | | | | | | | | | | | | | | | | | | | * call.c (build_conditional_expr): Use it. * init.c (build_new_1): Likewise. * rtti.c (build_dynamic_cast_1): Likewise. * tree.c (rvalue): New function. * typeck.c (build_unary_op): Use it. (build_static_cast_1): Likewise. * g++.dg/expr/cast6.C: New test. PR c++/9782 * init.c (build_new_1): Make sure the entire array type is complete, not just its element types. PR c++/9782 * g++.dg/init/new15.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103947 138bc75d-0d04-0410-961f-82ee72b054a4
* Make CONSTRUCTOR use VEC to store initializers.giovannibajo2005-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * c-common.c (complete_array_type): Update to cope with VEC in CONSTRUCTOR_ELTS. * c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts. (pp_c_constructor_elts): New function. * c-pretty-print.h (pp_c_constructor_elts): Declare. * c-typeck.c (build_function_call, build_c_cast, digest_init, struct constructor_stack, struct initializer_stack, constructor_elements, push_init_level, pop_init_level, add_pending_init, find_init_member, output_init_element): Update to cope with VEC in CONSTRUCTOR_ELTS. * coverage.c (build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * expr.c (categorize_ctor_elements_1, store_constructor, expand_expr_real_1): Likewise. * fold-const.c (fold_ternary): Likewise. * gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl, gimplify_init_constructor, gimplify_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR node. * tree-pretty-print.c (dump_generic_node): Update to cope with VEC in CONSTRUCTOR_ELTS. * tree-sra.c (generate_element_init_1): Likewise. * tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-vect-generic.c (expand_vector_piecewise): Likewise. * tree-vect-transform.c (vect_get_vec_def_for_operand): (get_initial_def_for_reduction): Likewise. * tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses value handle in annotations. * tree.c (tree_node_kind, tree_code_size, make_node_stat, tree_node_structure): Add support for constr_kind. (build_vector_from_ctor, build_constructor_single, build_constructor_from_list): New functions. (build_constructor): Update to take a VEC instead of a TREE_LIST. (simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree): Update to cope with VEC in CONSTRUCTOR_ELTS. * tree.def (CONSTRUCTOR): Make it a tcc_exceptional node. * tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT, CONSTRUCTOR_APPEND_ELT): New macros. (struct constructor_elt, struct tree_constructor): New data types. (union tree_node): Add tree_constructor field. * treestruct.def: Define TS_CONSTRUCTOR. * varasm.c (const_hash_1, compare_constant, copy_constant, compute_reloc_for_constant, output_addressed_constants, initializer_constant_valid_p, output_constant, array_size_for_constructor, output_constructor): Update to cope with VEC in CONSTRUCTOR_ELTS. * vec.h (VEC_empty, VEC_copy): New macros. ada/ Make CONSTRUCTOR use VEC to store initializers. * decl.c (gnat_to_gnu_entity): Update to cope with VEC in CONSTRUCTOR_ELTS. * trans.c (extract_values): Likewise. * utils.c (convert, remove_conversions): Likewise. * utils2.c (contains_save_expr_p, build_binary_op, build_unary_op, gnat_build_constructor): Likewise. cp/ Make CONSTRUCTOR use VEC to store initializers. * call.c (convert_default_arg): Update call to digest_init. * class.c (dump_class_hierarchy, dump_array): Update to cope with VEC in CONSTRUCTOR_ELTS. * cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise. (finish_compound_literal, digest_init): Update declaration. * decl.c (struct reshape_iter): New data type. (reshape_init_array): Rename to... (reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS. (reshape_init): Rewrite from scratch. Split parts into... (reshape_init_array, reshape_init_vector, reshape_init_class, reshape_init_r): New functions. (check_initializer): Update call to reshape_init. Remove obsolete code. (initialize_artificial_var, cp_complete_array_type): Update to cope with VEC in CONSTRUCTOR_ELTS. * decl2.c (grokfield): Update calls to digest_init. (mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS. * error.c (dump_expr_init_vec): New function. (dump_expr): Use dump_expr_init_vec. * init.c (build_zero_init, build_vec_init): Update to cope with VEC in CONSTRUCTOR_ELTS. (expand_default_init): Update call to digest_init. * parser.c (cp_parser_postfix_expression): Use a VEC for the initializers. (cp_parser_initializer_list): Build a VEC of initializers. * pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC in CONSTRUCTOR_ELTS. * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer, ptm_initializer, class_initializer, get_pseudo_ti_init): Use build_constructor_from_list instead of build_constructor. * semantics.c (finish_compound_literal): Update call to digest_init. * tree.c (stabilize_init): Update to cope with VEC in CONSTRUCTOR_ELTS. * typeck.c (build_ptrmemfunc1): Likewise. * typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1): Likewise. (store_init_value): Use build_constructor_from_list and update call to digest_init. (digest_init): Rewrite. (process_init_constructor): Rewrite from scratch. Split into... (process_init_constructor_array, picflag_from_initializer, process_init_constructor_record, process_init_constructor_union): New functions. (PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE): New macros. (build_functional_cast): Use build_constructor_from_list instead of build_constructor. fortran/ Make CONSTRUCTOR use VEC to store initializers. * trans-array.c (gfc_build_null_descriptor, gfc_trans_array_constructor_value, gfc_conv_array_initializer): Update to cope with VEC in CONSTRUCTOR_ELTS. * trans-common.c (create_common): Likewise. * trans-expr.c (gfc_conv_structure): Likewise. * trans-stmt.c (gfc_trans_character_select): Use build_constructor_from_list instead of build_constructor. java/ Make CONSTRUCTOR use VEC to store initializers. * check-init.c (check_init): Update to cope with VEC in CONSTRUCTOR_ELTS. * class.c (make_field_value, make_method_value, get_dispatch_table, make_class_data, emit_symbol_table, emit_catch_table, emit_assertion_table): Use build_constructor_from_list instead of build_constructor. * constants.c (build_constants_constructor): Likewise. * java-gimplify.c (java_gimplify_new_array_init): Update to cope with VEC in CONSTRUCTOR_ELTS. * java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE, PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead of a TREE_LIST. * jcf-write.c (generate_bytecode_insns): Update to cope with VEC in CONSTRUCTOR_ELTS. * parse.y (build_new_array_init): Use build_constructor_from_list instead of build_constructor. (patch_new_array_init): Update to cope with VEC in CONSTRUCTOR_ELTS. (array_constructor_check_entry): Likewise. objc/ Make CONSTRUCTOR use VEC to store initializers. * objc-act.c (objc_build_constructor): Use build_constructor_from_list instead of build_constructor. testsuite/ Make CONSTRUCTOR use VEC to store initializers. * g++.dg/ext/complit3.C: Check for specific error messages. * g++.dg/init/brace2.C: Update error message. * g++.dg/warn/Wbraces2.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102182 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-07-14 Daniel Berlin <dberlin@dberlin.org>dberlin2005-07-151-0/+5
| | | | | | | | Fix PR c++/22452 * tree.c (decl_linkage): Don't check DECL_COMDAT on CONST_DECL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102063 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-07-08 Daniel Berlin <dberlin@dberlin.org>dberlin2005-07-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (TREE_H): Add treestruct.def. (c-decl.o): Add pointer-set.h * c-decl.c (diagnose_mismatched_decls): Don't attempt to look at visibility on regular DECL's. (merge_decls): Fix the copying of decl nodes of various types for the new structures. Don't update RTL, section name, weak status, etc, on DECL's without RTL. (grokdeclarator): DECL_ARG_TYPE_AS_WRITTEN is gone. Don't check volatile on non-variable types. (store_parm_decls_oldstyle): Use pointer_set instead of DECL_WEAK to check whether we have seen arguments. * c-objc-common.c (c_tree_printer): Reverse order of tests so that flag is checked before field (flag is common, field is not). * dwarf2out.c (decl_ultimate_origin): Only DECL's with TS_DECL_COMMON could have an origin. (add_location_or_const_value_attribute): Don't check section name on non-var/function decls. (dwarf2out_var_location): Reverse order of tests. * emit-rtl.c (set_reg_attrs_for_parm): DECL_CHECK is dead, replace with DECL_WRTL_CHECK. * expmed.c (make_tree): rtl is now in decl_with_rtl. * fold-const.c (fold_binary): Don't check weakness on non-var/function decls. (tree_expr_nonzero_p): Ditto. (fold_checksum_tree): Use tree_decl_extra as sizeof buffer. * ggc-page.c (extra_order_size_table): Add sizes for tree_decl_non_common, tree_parm_decl, tree_var_decl, and tree_field_decl. * gimplify.c (gimplify_bind_expr): Only set DECL_SEEN_IN_BIND_EXPR_P on VAR_DECL. * integrate.c (copy_decl_for_inlining): Don't set RTL on decl's without RTL. * langhooks-def.h (LANG_HOOK_INIT_TS): New. * langhooks.h (init_ts). New langhook. * passes.c (rest_of_decl_compilation): Reverse order of tests. * print-tree.c (print_node): Update to only print fields that exist in the structures the passed decl has. * toplev.c (wrapup_global_declarations): Don't reset DECL_DEFER_OUTPUT on DECL's that don't contain it. * tree-browser.c (browse_tree): DECL_ARG_TYPE_AS_WRITTEN removed. * tree-inline.c (remap_decl): Ditto. * tree-outof-ssa.c (create_temp): Reverse order of tests. * tree-pretty-print.c (print_declaration): Don't print DECL_REGISTER on things that don't contain it. * tree-vrp.c (expr_computes_nonzero): Don't check weakness on non-var/function decls. * tree.c (tree_contains_struct): New structure. (init_priority_for_decl): New hashtable. (tree_int_map): New structure. (tree_int_map_eq): New function. (tree_int_map_marked_p): Ditto. (tree_int_map_hash): Ditto. (tree_map): Move to tree.h. (tree_map_eq): Externalize. (tree_map_hash): Ditto. (tree_map_marked_p): Ditto. (init_ttree): Set up tree_contains_struct and call langhook. (decl_assembler_name): Use DECL_NON_COMMON_CHECK.. (tree_code_size): Update for new structures. (tree_node_structure): Update for new structures. (make_node_stat): Don't try to set DECL_IN_SYSTEM_HEADER on decls without the field. (copy_node_stat): Copy init priority. (build_decl_stat): Ditto for visibility. (ts_enum_names): New. (tree_contains_struct_check_failed): New function. (decl_init_priority_lookup): Ditto. (decl_init_priority_insert): Ditto. * treestruct.def: New file. * tree.h (CODE_CONTAINS_STRUCT): New macro. (CONTAINS_STRUCT_CHECK): Ditto. (tree_contains_struct_check_failed): New prototype. (DECL_CHECK): Removed. (DECL_MINIMAL_CHECK): New. (DECL_COMMON_CHECK): Ditto. (DECL_WRTL_CHECK): Ditto. (DECL_NON_COMMON_CHECK): Ditto. (DECL_WITH_VIS_CHECK): Ditto. (VAR_OR_FUNCTION_DECL_P): Ditto (struct tree_decl_minimal): New structure. (struct tree_decl_common): Ditto. (struct tree_decl_with_rtl): Ditto. (struct tree_decl_with_vis): Ditto. (struct tree_decl_non_common): Ditto. (struct tree_field_decl): Ditto. (struct tree_parm_decl): Ditto. (struct tree_var_decl): Ditto. (struct tree_function_decl): Ditto. (struct tree_const_decl): Ditto. (struct tree_result_decl): Ditto. (union tree_node): Add new structures. * var-tracking.c (track_expr_p): Reverse order of tests. * doc/c-tree.texi: Add documentation on DECL node internal structure. 2005-07-08 Daniel Berlin <dberlin@dberlin.org> * utils.c (create_param_decl): DECL_ARG_TYPE_AS_WRITTEN is removed. 2005-07-08 Daniel Berlin <dberlin@dberlin.org> * Make-lang.in: Add gt-cp-lang.h. (cp-lang.o): Ditto. * class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on the field. * config-lang.in: Add cp-lang.c to gtfiles. * cp-lang.c: Include hashtab.h. (cp_init_ts): New function. (LANG_HOOK_INIT_TS): Use macro. (decl_shadowed_for_var_lookup): New function. (decl_shadowed_for_var_insert): Ditto. * cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common. (NON_THUNK_FUNCTION_CHECK): Ditto. (DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common. (DECL_INIT_PRIORITY): Ditto. (DECL_HAS_SHADOWED_FOR_VAR_P): Ditto. (DECL_SHADOWED_FOR_VAR): Use hashtable. (SET_DECL_SHADOWED_FOR_VAR): Ditto. * decl.c (duplicate_decls): Update for new/updated structures. (poplevel): Use SET_DECL_SHADOWED_FOR_VAR. * decl2.c (start_static_initialization_or_destruction): Deal with priority. * pt.c (tsubst_decl): Check TS_DECL_WRTL before doing SET_DECL_RTL. * tree.c (handle_init_priority_attribute): Handle priority. 2005-07-08 Daniel Berlin <dberlin@dberlin.org> * objc-act.c (objc_push_parm): DECL_ARG_TYPE_AS_WRITTEN is removed. * objc-act.h (KEYWORD_ARG_NAME): Use decl_non_common. (KEYWORD_KEY_NAME): Use decl_minimal. (METHOD_SEL_NAME): Ditto.. (METHOD_SEL_ARGS): Use decl_non_common. (METHOD_ADD_ARGS): Ditto. (METHOD_ADD_ARGS_ELLIPSIS_P): Use decl_common. (METHOD_DEFINITION): Ditto. (METHOD_ENCODING): Ditto. * objc-lang.c: (objc_init_ts): New function. 2005-07-08 Daniel Berlin <dberlin@dberlin.org> * trans-decl.c (create_function_arglist): DECL_ARG_TYPE_AS_WRITTEN is removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101799 138bc75d-0d04-0410-961f-82ee72b054a4
* Update FSF address.kcook2005-06-251-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101312 138bc75d-0d04-0410-961f-82ee72b054a4
* Canonicalize whitespace.mrs2005-06-151-40/+40
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100965 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/21619mmitchel2005-06-051-3/+1
| | | | | | | | | | | | | | * cp-tree.h (DECL_IS_BUILTIN_CONSTANT_P): New macro. * parser.c (cp_parser_postfix_expression): Allow non-constant expressions as arguments to __builtin_constant_p. * tree.c (builtin_valid_in_constant_expr_p): Use DECL_IS_BUILTIN_CONSTANT_P. PR c++/21619 * g++.dg/ext/builtin9.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100626 138bc75d-0d04-0410-961f-82ee72b054a4
* * cp-tree.def (UNARY_PLUS_EXPR): New C++ unary tree code.sayle2005-05-271-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | * parser.c (cp_parser_unary_expression): Use UNARY_PLUS_EXPR instead of CONVERT_EXPR. (cp_parser_unary_expression): Likewise. * typeck.c (build_unary_op): Likewise. * call.c (add_builtin_candidate, build_new_op): Likewise. * error.c (dump_expr): Likewise. * pt.c (tsubst_copy, tsubst_copy_and_build): Likewise. * decl.c (ambi_op_p, grok_op_properties): Likewise. * dump.c (dump_op): Likewise. * lex.c (init_operators): Likewise. * operators.def ("+"): Likewise. * cp-gimplify.c (cp_gimplify_expr): Handle UNARY_PLUS_EXPR like a conversion, if the result and argument types differ. * tree.c (fold_if_not_in_template): Fold UNARY_PLUS_EXPR much like a NOP_EXPR when !processing_template_decl. * cxx-pretty-print.c (pp_cxx_cast_expression): Prototype. (pp_cxx_unary_expression): Handle new UNARY_PLUS_EXPR tree code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100285 138bc75d-0d04-0410-961f-82ee72b054a4
* * common.opt (-Wattributes): New. Default true.dj2005-05-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/invoke.texi (-Wno-attributes): Document. * attribs.c (decl_attributes): Move warning control from if() to warning(OPT_*). * c-common.c (handle_packed_attribute): Likewise. (handle_nocommon_attribute): Likewise. (handle_common_attribute): Likewise. (handle_noreturn_attribute): Likewise. (handle_noinline_attribute): Likewise. (handle_always_inline_attribute): Likewise. (handle_used_attribute): Likewise. (handle_unused_attribute): Likewise. (handle_const_attribute): Likewise. (handle_transparent_union_attribute): Likewise. (handle_constructor_attribute): Likewise. (handle_destructor_attribute): Likewise. (handle_mode_attribute): Likewise. (handle_alias_attribute): Likewise. (handle_visibility_attribute): Likewise. (handle_tls_model_attribute): Likewise. (handle_malloc_attribute): Likewise. (handle_returns_twice_attribute): Likewise. (handle_pure_attribute): Likewise. (handle_deprecated_attribute): Likewise. (handle_vector_size_attribute): Likewise. (handle_nothrow_attribute): Likewise. (handle_cleanup_attribute): Likewise. (handle_warn_unused_result_attribute): Likewise. (handle_sentinel_attribute): Likewise. * c-decl.c (diagnose_mismatched_decls): Likewise. (start_decl): Likewise. (grokdeclarator): Likewise. (start_function): Likewise. * c-format.c (check_function_format): Likewise. * stor-layout.c (place_field): Likewise. (finalize_record_size): Likewise. * tree.c (handle_dll_attribute)): Likewise. * varasm.c (default_assemble_visibility): Likewise. * config/darwin.c (darwin_handle_weak_import_attribute): Likewise. (darwin_assemble_visibility): Likewise. * config/arc/arc.c (arc_handle_interrupt_attribute): Likewise. * config/arm/arm.c (arm_handle_fndecl_attribute): Likewise. (arm_handle_isr_attribute): Likewise. * config/avr/avr.c (avr_handle_progmem_attribute): Likewise. (avr_handle_fndecl_attribute): Likewise. * config/bfin/bfin.c (handle_int_attribute): Likewise. * config/c4x/c4x.c (c4x_handle_fntype_attribute): Likewise. * config/h8300/h8300.c (h8300_handle_fndecl_attribute): Likewise. (h8300_handle_eightbit_data_attribute): Likewise. (h8300_handle_tiny_data_attribute): Likewise. * config/i386/i386.c (ix86_handle_cdecl_attribute): Likewise. (ix86_handle_regparm_attribute): Likewise. (ix86_handle_struct_attribute): Likewise. * config/i386/winnt.c (ix86_handle_shared_attribute): Likewise. (i386_pe_encode_section_info): Likewise. * config/ia64/ia64.c (ia64_handle_model_attribute): Likewise. * config/ip2k/ip2k.c (ip2k_handle_progmem_attribute): Likewise. (ip2k_handle_fndecl_attribute): Likewise. * config/m32r/m32r.c (m32r_handle_model_attribute): Likewise. * config/m68hc11/m68hc11 (m68hc11_handle_page0_attribute): Likewise. (m68hc11_handle_fntype_attribute): Likewise. (m68hc11_encode_section_info): Likewise. * config/m68k/m68k.c (m68k_handle_fndecl_attribute): Likewise. * config/mcore/mcore.c (mcore_handle_naked_attribute): Likewise. * config/ns32k/ns32k.c (ns32k_handle_fntype_attribute): Likewise. * config/rs6000/rs6000.c (rs6000_handle_longcall_attribute): Likewise. * config/sh/sh.c (sh_handle_interrupt_handler_attribute): Likewise. (sh_handle_sp_switch_attribute): Likewise. (sh_handle_trap_exit_attribute): Likewise. * config/sh/symbian.c (sh_symbian_dllimport_p): Likewise. (sh_symbian_handle_dll_attribute): Likewise. * config/stormy16/stormy16.c (xstormy16_handle_interrupt_attribute): Likewise. (xstormy16_handle_below100_attribute): Likewise. * config/v850/v850.c (v850_handle_interrupt_attribute): Likewise. [testsuite] * gcc.dg/Wattributes-1.c: New. * gcc.dg/Wattributes-2.c: New. * gcc.dg/Wattributes-3.c: New. [cp] * decl.c (duplicate_decls): Move warning control from if() to warning(OPT_*). * name-lookup.c (parse_using_directive): Likewise. * parser.c (cp_parser_elaborated_type_specifier): Likewise. (cp_parser_init_declarator): Likewise. * tree.c (handle_com_interface_attribute): Likewise. [java] * class.c (set_constant_value): Move warning control from if() to warning(OPT_*). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100136 138bc75d-0d04-0410-961f-82ee72b054a4
* Yet more Objective-C++...mrs2005-05-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cp-objcp-common.h (cxx_get_alias_set): Move from here... (cxx_warn_unused_global_decl): Likewise. (cp_expr_size): Likewise. (cp_tree_size): Likewise. (cp_var_mod_type_p): Likewise. (cxx_initialize_diagnostics): Likewise. (cxx_types_compatible_p): Likewise. * cp-tree.h: to here. (do_poplevel): Add. * lex.c (D_OBJC): Add. (init_reswords): Add. * Make-lang.in (cp/pt.o): Add cp/cp-objcp-common.h. * parser.c: Add c-common.h include. * pt.c: Add c-common.h and cp-objcp-common.h includes. (template_args_equal): Use objc_comptypes as well. (tsubst_copy_and_build): Use objcp_tsubst_copy_and_build as well. * semantics.c (do_poplevel): Remove static. * decl.c (objc_mark_locals_volatile): Don't change decls that are already ok. * decl2.c (generate_ctor_or_dtor_function): Add code to initialize Objective C++ early enough. * lex.c (struct resword reswords): Add Objective-C++ support. * parser.c (cp_lexer_get_preprocessor_token): Add Objective-C++. (cp_parser_objc_message_receiver): Add. (cp_parser_objc_message_args): Likewise. (cp_parser_objc_message_expression): 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_expression): Likewise. (cp_parser_objc_visibility_spec): Likewise. (cp_parser_objc_method_type): Likewise. (cp_parser_objc_protocol_qualifiers): Likewise. (cp_parser_objc_typename): Likewise. (cp_parser_objc_selector_p): Likewise. (cp_parser_objc_selector): Likewise. (cp_parser_objc_method_keyword_params): Likewise. (cp_parser_objc_method_tail_params_opt): Likewise. (cp_parser_objc_interstitial_code): Likewise. (cp_parser_objc_method_signature): Likewise. (cp_parser_objc_method_prototype_list): Likewise. (cp_parser_objc_method_definition_list): Likewise. (cp_parser_objc_class_ivars): Likewise. (cp_parser_objc_identifier_list): Likewise. (cp_parser_objc_alias_declaration): Likewise. (cp_parser_objc_class_declaration): Likewise. (cp_parser_objc_protocol_declaration): Likewise. (cp_parser_objc_protocol_refs_opt): Likewise. (cp_parser_objc_superclass_or_category): Likewise. (cp_parser_objc_class_interface): Likewise. (cp_parser_objc_class_implementation): Likewise. (cp_parser_objc_end_implementation): Likewise. (cp_parser_objc_declaration): Likewise. (cp_parser_objc_try_catch_finally_statement): Likewise. (cp_parser_objc_synchronized_statement): Likewise. (cp_parser_objc_throw_statement): Likewise. (cp_parser_objc_statement): Likewise. (cp_parser_primary_expression): Add Objective-C++. (cp_parser_statement): Likewise. (cp_parser_declaration): Likewise. (cp_parser_simple_type_specifier): Likewise. (cp_parser_type_name): Likewise. (cp_parser_parameter_declaration_list): Likewise. (cp_parser_member_declaration) Likewise. * tree.c: Include debug.h. * typeck.c (composite_pointer_type): Add Objective-C++ support. (finish_class_member_access_expr): Likewise. (build_function_call): Allow objc to rewrite FUNCTION_DECLs. (build_modify_expr): Allow objc to generate write barriers. * Make-lang.in (cp/tree.o): Add debug.h. * tree.c (lvalue_p_1, case CONST_DECL): Add. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99855 138bc75d-0d04-0410-961f-82ee72b054a4
* * diagnostic.c (warning): Accept parameter to classify warning option.dj2005-04-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98633 138bc75d-0d04-0410-961f-82ee72b054a4
* * cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P.mmitchel2005-04-081-11/+0
| | | | | | | | | | | | | | | | | | | | * cp-tree.h (struct tinst_level): Add in_system_header_p. (TINST_IN_SYSTEM_HEADER_P): New macro. (make_tinst_level): Remove. * pt.c (lookup_template_class): Preserve DECL_IN_SYSTEM_HEADER on the instantiated class. (push_tinst_level): Do not use make_tinst_level. Set TINST_IN_SYSTEM_HEADER_P. (pop_tinst_level): Likewise. (instantiate_class_template): Set in_system_header. (instantiate_pending_templates): Likewise. * tree.c (make_tinst_level): Remove. PR c++/20145 * g++.dg/warn/Wdtor1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97854 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/19312jason2005-04-061-1/+4
| | | | | | | | * tree.c (stabilize_init): Don't bother trying to stabilize something with no side-effects. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97691 138bc75d-0d04-0410-961f-82ee72b054a4
* * typeck.c (comptypes): First determine if the types are compatiblesteven2005-03-241-4/+4
| | | | | | | | | | | | | | | | | | | | | from a target-independent point of view. Check target attributes last. * class.c (build_base_path): (build_vbase_offset_vtbl_entries): (add_vcall_offset): Replace fold (buildN (...)) with fold_buildN. * error.c (dump_expr): Likewise. * init.c (build_zero_init, expand_cleanup_for_base, build_vec_delete_1): Likewise. * mangle.c (write_integer_cst): Likewise. * method.c (thunk_adjust): Likewise. * pt.c (convert_nontype_argument, tsubst, unify): Likewise. * tree.c (cxx_print_statistics, array_type_nelts_total): Likewise. * typeck.c (build_ptrmemfunc_access_expr, (get_member_function_from_ptrfunc): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96985 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-03-18 Dale Johannese <dalej@apple.com>dalej2005-03-231-0/+1
| | | | | | | * cp/tree.c (cp_tree_equal): Handle SSA_NAME. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96938 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-02-21 Douglas Gregor <dgregor@cs.indiana.edu>paolo2005-02-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/19076 PR c++/6628 * cp-tree.h (cp_apply_type_quals_to_decl): Declared. * decl.c (grokdeclarator): Pedwarn about qualifying a function type. Add qualifiers when declaring a typedef of a function type. Member function pointers pick up the qualifiers of the typedef used to declare them. Don't complain about creating cv-qualified function types. Complain about qualified function typedefs that are used to declare non-static member functions or free functions. Use cp_apply_type_quals_to_decl. (start_preparsed_function): Use cp_apply_type_quals_to_decl. (grokclassfn): Use cp_apply_type_quals_to_decl. * error.c (dump_type_suffix): Print qualifiers for function types. * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl. (tsubst): When substituting a function type into a member pointer type, pass along the qualifiers. (unify): Unify member pointers to member function pointers. * tree.c (cp_build_qualified_type_real): Function types may be qualified. This includes restrict qualifiers. * typeck.c (cp_apply_type_quals_to_decl): New function to replace use of c_apply_type_quals_to_decl. Drops qualifiers that are being added to function types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95356 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/19628austern2005-02-031-0/+13
| | | | | | | | | | | | | | * cp-tree.h (builtin_valid_in_constant_expr_p): Declare. * parser.c (cp_parser_postfix_expression): Accept function call in constant expression if builtin_valid_in_constant_expr_p is true for that function. * pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly. * semantics.c (finish_id_expression): Accept function call in constant expression if builtin_valid_in_constant_expr_p is true for that function. * tree.c (builtin_valid_in_constant_expr_p): New. * g++/ext/builtin7.C: New. * g++/ext/builtin8.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94635 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree.c (count_functions, bound_pmf_p, cp_is_overload_p,kazu2005-01-181-64/+0
| | | | | | | | cp_update_decl_after_saving, name_p): Remove. * cp-tree.h: Remove the corresponding prototypes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93869 138bc75d-0d04-0410-961f-82ee72b054a4
* * Make-lang.in, call.c, cvt.c, init.c, rtti.c, tree.c,kazu2005-01-181-1/+1
| | | | | | | typeck2.c: Update copyright. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93828 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree.c (hash_chainon): Remove.kazu2005-01-171-15/+0
| | | | | | | * cp-tree.h: Remove the corresponding prototypes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93757 138bc75d-0d04-0410-961f-82ee72b054a4
* PR middle-end/17799rth2005-01-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * function.c (use_register_for_decl): Check DECL_IGNORED_P instead of DECL_ARTIFICIAL. (assign_parms_augmented_arg_list): Set DECL_IGNORED_P. * c-decl.c (build_compound_literal): Likewise. * dwarf2asm.c (dw2_force_const_mem): Likewise. * gimplify.c (create_artificial_label): Likewise. * tree-inline.c (expand_call_inline): Likewise. * var-tracking.c (vt_initialize): Likewise. * tree-outof-ssa.c (create_temp): Copy DECL_IGNORED_P. cp/ * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P. * class.c (build_vtable): Don't conditionallize setting it based on DWARF2_DEBUG. (layout_class_type): Set DECL_IGNORED_P. * decl2.c (get_guard): Likewise. * rtti.c (get_tinfo_decl, build_lang_decl): Likewise. * tree.c (build_local_temp): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92781 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/18378mmitchel2004-12-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | * call.c (convert_like_real): Do not permit the use of a copy constructor to copy a packed field. PR c++/17413 * decl.c (grokdeclarator): Return error_mark_node, not void_type_node, to indicate errors. * parser.c (cp_parser_template_parameter_list): Robustify. (cp_parser_template_parameter): Likewise. PR c++/19034 * tree.c (cp_tree_equal): Handle OVERLOAD. PR c++/18378 * g++.dg/ext/packed8.C: New test. PR c++/13268 * g++.dg/template/crash31.C: New test. PR c++/19034 * g++.dg/template/crash30.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92486 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/18001mmitchel2004-11-251-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * c-common.h (lvalue_use): Move here from c-ctypeck.c. (lvalue_or_else): Declare. * c-common.c (lvalue_or_else): Move here from c-typeck.c. * c-typeck.c (lvalue_use): Remove. (lvalue_or_else): Remove. PR c++/18556 * toplev.c (check_global_declarations): Set DECL_IGNORED_P on unemitted variables with static storage duration. PR c++/18445 * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with unknown_type as non matching. Tidy up. * pt.c (build_non_dependent_expr): Do not build a NON_DEPENDENT_EXPR for a VAR_DECL. PR c++/18001 * cp-tree.h (lvalue_or_else): Remove declaration. * tree.c (lvalue_or_else): Remove. * typeck.c (build_unary_op): Adjust call to lvalue_or_else. (build_modify_expr): Likewise. PR c++/18625 * decl.c (duplicate_decls): Return error_mark_node on error, as specified. PR c++/18466 * decl.c (grokvardecl): Keep track of whether or not a there was explicit qualification. * name-lookup.c (set_decl_namespace): Complain about explicit qualification of a name within its own namespace. PR c++/18545 * typeck.c (check_return_expr): Robustify. PR c++/18445 * g++.dg/template/crash28.C: Likewise. PR c++/18001 * g++.dg/expr/unary2.C: Adjust lvalue messages. * g++.dg/ext/lvaddr.C: Likewise. * g++.dg/opt/pr7503-3.C: Likewise. PR c++/18466 * g++.dg/parse/qualified3.C: New test. * g++.old-deja/g++.other/friend7.C: Remove bogus qualification. PR c++/18545 * g++.dg/expr/return1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91301 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/18389mmitchel2004-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * decl.c (start_decl): Make sure to set *pop_scope_p. Return error_mark_node to indicate errors. PR c++/18429 * parser.c (cp_parser_direct_declarator): Disallow non-constant array bounds when not inside a function. PR c++/18436 * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an unqualified name resolves to a member function. PR c++/18407 * pt.c (tsubst_copy_and_build): Handle qualified names used from a derived class correctly. * decl2.c (import_export_decl): Fix typo in comment. * tree.c (pod_type_p): Likewise. PR c++/18389 * g++.dg/parse/cond1.C: New test. PR c++/18429 * g++.dg/template/array9.C: New test. * g++.dg/ext/vla1.C: Adjust error messages. * g++.dg/ext/vlm1.C: Likewise. * g++.dg/template/crash2.C: Likewise. PR c++/18436 * g++.dg/template/call3.C: New test. PR c++/18407 * g++.dg/template/ptrmem11.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90545 138bc75d-0d04-0410-961f-82ee72b054a4
* cp:nathan2004-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call. (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove. (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call. (enum base_access): Reorganize. (accessible_base_p, accessible_p): Add consider_local_p parameter. * call.c (standard_conversion): Update comment about DERIVED_FROM_P. (enforce_access): Adjust accessible_p call. (build_over_call): Adjust accessible_base_p call. * class.c (convert_to_base): Adjust lookup_base call. (build_vtbl_ref_1): Likewise. (warn_about_ambiguous_bases): Likewise. Add early exit. * cvt.c (convert_to_pointer_force) Adjust lookup_base call. * search.c (accessible_base_p): Add consider_local_p parameter. (lookup_base): Pass consider_local_p to accessible_base_p call. (friend_accessible_p): Check whether scope is a class member. Remove unnecessary class template check. (accessible_p): Add consider_local_p parameter. Use it. (adjust_result_of_qualified_name_lookup): Adjust lookup_base call. * tree.c (maybe_dummy_object): Likewise. * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P. (build_class_member_access_expr): Adjust lookup_base call. * typeck2.c (binfo_or_else): Likewise. * rtti.c (build_dynamic_cast_1): Access can consider friendship and current scope. testsuite: * g++.dg/eh/shadow1.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89232 138bc75d-0d04-0410-961f-82ee72b054a4
* Speed up walk_tree by introducing a special-purpose hash table.austern2004-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pointer-set.c: New file, special-purpose hash table. * pointer-set.h: New file. * tree.h (struct pointer_set_t): Declare as opaque type. (tree_walk): Last argument is pointer_set_t* now. * tree-inline.c (WALK_SUBTREE): Convert from htab to pset. (walk_type_fields): (walk_tree): Convert from htab_t to pointer_set_t for keeping track of which nodes have already been visited. (walk_tree_without_duplicates): Convert from htab_t to pointer_set_t. * cgraphunit.c (cgraph_create_edges): Likewise. (cgraph_characterize_statics_local): Likewise. * tree-dfa.c (collect_dfa_stats): Likewise. * langhooks-def.h (lhd_tree_inlining_walk_subtrees): Last arg is pointer_set_t* now. * langhooks.c (lhd_tree_inlining_walk_subtrees): Likewise. * langhooks.h (struct lang_hooks_for_tree_inlining): Last arg type of walk_subtrees is pointer_set_t* now. * Makefile.in (OBJS-common): add pointer-set.o (tree-inline.o): Depends on pointer-set.h (tree-dfa.o): Likewise (cgraphunit.o): Likewise * cp/Make-lang.in (pt.o): depends on pointer-set.h * cp/cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now. * cp/pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t (for_each_template_parm): Convert from htab_t to pointer_set_t. * cp/tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now. * java/lang.c (java_tree_inlining_walk_subtrees): Last arg is struct pointer_set_t* now. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89062 138bc75d-0d04-0410-961f-82ee72b054a4
* * cp-tree.h (SAME_BINFO_TYPE_P): New.nathan2004-10-111-1/+1
| | | | | | | | | | | | | | | | | | * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare binfo types. (convert_to_base_statically, determine_primary_bases, update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group, accumulate_vtbl_inits, dfs_accumulate_vtbl_inits, build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise. * init.c (expand_member_init): Likewise. * search.c (lookup_base_r, dynamic_cast_base_recurse, binfo_via_virtual, copied_binfo, binfo_for_vbase, original_binfo): Likewise. * tree.c (copy_binfo): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88880 138bc75d-0d04-0410-961f-82ee72b054a4
* cp/gdr2004-10-101-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert diagnostics to use quoting flag q 7/n * typeck.c (composite_pointer_type_r, composite_pointer_type, cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr, string_conv_p, build_class_member_access_expr, build_class_member_access_expr, lookup_destructor, finish_class_member_access_expr, build_indirect_ref, get_member_function_from_ptrfunc, build_function_call, convert_arguments, build_binary_op, pointer_diff, build_unary_op, check_for_casting_away_constness, build_static_cast, build_reinterpret_cast, build_const_cast, build_c_cast, build_modify_expr, get_delta_difference, build_ptrmemfunc, dubious_conversion_warnings, convert_for_assignment, convert_for_initialization, maybe_warn_about_returning_address_of_local, check_return_expr): Use quoting marks. * typeck2.c (error_not_base_type, readonly_error, abstract_virtuals_error, cxx_incomplete_type_diagnostic, store_init_value, digest_init, build_x_arrow, build_m_component_ref, require_complete_eh_spec_types): Likewise. * tree.c (cp_build_qualified_type_real, handle_java_interface_attribute, handle_init_priority_attribute): Likewise. * semantics.c (finish_asm_stmt, finish_non_static_data_member, finish_pseudo_destructor_expr, check_template_template_default_arg, begin_class_definition, finish_base_specifier, qualified_name_lookup_error, finish_id_expression, finish_typeof): Likewise. * search.c (lookup_base, check_final_overrider, look_for_overrides_r): Likewise. * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise. testsuite/ * g++.dg/overload/pmf1.C: Adjust quoting marks. * g++.dg/warn/incomplete1.C: Likewise. * g++.dg/template/qualttp20.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88854 138bc75d-0d04-0410-961f-82ee72b054a4
OpenPOWER on IntegriCloud