aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2003-08-01re PR c++/11525 (ICE/segfault on C++ code)Nathan Sidwell2-5/+4
cp: PR c++/11525 * parser.c (cp_parser_primary_expression): Do not set non-constant-p merely because it is a dependent scope. testsuite: PR c++/11525 * g++.dg/parse/constant4.C: New test. From-SVN: r70041
2003-08-01re PR c++/9447 (using Base<T>::member does not work)Nathan Sidwell3-2/+9
cp: PR c++/9447 * decl2.c (do_class_using_decl): Set type to NULL_TREE. * semantics.c (finish_expr_stmt): Do not convert to void in a template. testsuite: PR c++/9447 * g++.dg/template/using5.C: New test. From-SVN: r70039
2003-07-31pt.c (coerce_template_parms): Refactor.Nathan Sidwell2-17/+24
cp: * pt.c (coerce_template_parms): Refactor. (fn_type_unification): Increment processing_template_decl when tsubsting an incomplete set of explicit args. testsuite: * g++.dg/template/explicit3.C: New. * g++.dg/template/explicit4.C: New. * g++.dg/template/explicit5.C: New. From-SVN: r69995
2003-07-31re PR c++/11347 (Error on valid expression in default value for int argument ↵Nathan Sidwell2-13/+14
to inner template.) cp: PR c++/11347 * pt.c (instantiate_class_template): Increment processing_template_decl around the tsubst of a template member class. (tsubst_qualified_id): Assert we do not have a dependent scope. testsuite: PR c++/11347 * g++.dg/template/memtmpl1.C: New. From-SVN: r69994
2003-07-31pt.c (coerce_template_template_parms, [...]): Reformat.Nathan Sidwell2-28/+28
* pt.c (coerce_template_template_parms, lookup_template_class, can_complete_type_without_circularity, instantiate_class_template, tsubst_decl, unify): Reformat. From-SVN: r69993
2003-07-30decl2.c (maybe_make_one_only): Use mark_referenced.Jan Hubicka3-3/+8
* decl2.c (maybe_make_one_only): Use mark_referenced. * method.c (use_thunk): Likewsie. From-SVN: r69979
2003-07-30re PR c/10320 (gcc 3.4 gets rid of static inline function that does not get ↵Jan Hubicka5-67/+9
inlined) * gcse.c (insert_store): Ignore fake edges. * c-common.c (flag_vtable_gc): Kill. * c-common.g (flag_vtable_gc): Kill. * c-opts (c_common_handle_option): Kill. * c.opt (fvtable-gc): Kill. * final.c (final_scan_insn): Do not call assemble_vtable_entry. * output.h (assemble_vtable_entry, assemble_vtable_inherit): Kill. * varasm.c (assemble_vtable_entry, assemble_vtable_inherit): Kill. * invoke.texi (-ftable-gc): Kill documentation. PR C/10320 * tree-inline.c (inlinable_function_p): Don't set DECL_UNINLINABLE just because function body is missing. * i386.c (pic_symbolic_operand): Properly detect RIP relative unspecs. * class.c (build_vtable_entry_ref): Kill. (build_vtbl_ref_1): Do not call build_vtable_entry_ref. (build_vfn_ref): Do not call build_vtable_entry_ref. * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Kill. * cp-tree.h (prepare_assemble_variable): Kill. * cp-decl.c (prepare_assemble_variable): Kill. From-SVN: r69964
2003-07-29c-common.c (allow_pch): Remove.Geoffrey Keating2-1/+6
2003-07-29 Geoffrey Keating <geoffk@apple.com> * c-common.c (allow_pch): Remove. * c-common.h (allow_pch): Remove. (c_common_no_more_pch): Declare. * c-lex.c (c_lex): Call c_common_no_more_pch when appropriate. * c-pch.c: Include hosthooks.h. (c_common_valid_pch): Don't check allow_pch. (c_common_read_pch): Clear valid_pch to prevent reading PCH files. (c_common_no_more_pch): New. * ggc-common.c: Include hosthooks.h. (gt_pch_save): Call gt_pch_get_address. (gt_pch_restore): Call gt_pch_use_address. * hooks.c (hook_voidp_size_t_null): New. (hook_bool_voidp_size_t_false): New. * hooks.h (hook_voidp_size_t_null): New. (hook_bool_voidp_size_t_false): New. * hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): New. (HOST_HOOKS_GT_PCH_USE_ADDRESS): New. (HOST_HOOKS_INITIALIZER): Add HOST_HOOKS_GT_PCH_GET_ADDRESS, HOST_HOOKS_GT_PCH_USE_ADDRESS. * hosthooks.h (struct host_hooks): Add gt_pch_get_address, gt_pch_use_address. * doc/hostconfig.texi (Host Common): Document HOST_HOOKS_GT_PCH_GET_ADDRESS, HOST_HOOKS_GT_PCH_USE_ADDRESS. * Makefile.in (c-pch.o): Depend on hosthooks.h. (ggc-common.o): Likewise. * config/rs6000/host-darwin.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Define. (HOST_HOOKS_GT_PCH_USE_ADDRESS): Define. (pch_address_space): New. (darwin_rs6000_gt_pch_get_address): New. (darwin_rs6000_gt_pch_use_address): New. Index: cp/ChangeLog 2003-07-29 Geoffrey Keating <geoffk@apple.com> * parser.c (cp_lexer_new_main): Use c_common_no_more_pch instead of setting valid_pch by hand. From-SVN: r69944
2003-07-29* decl.c (finish_enum): Initialize underlying_type.Rainer Orth2-1/+5
From-SVN: r69941
2003-07-29re PR c++/9447 (using Base<T>::member does not work)Nathan Sidwell6-67/+98
cp: PR c++/9447 * decl.c (add_binding): Add bval local variable. (push_class_level_binding): Likewise. Allow a USING_DECL to be pushed. * decl2.c (do_class_using_decl): The type of a using decl is unknown. * parser.c (cp_parser_postfix_expression): Refactor unqualified-id function call lookup code. * pt.c (tsubst): A USING_DECL will have unknown type. (tsubst_copy_and_build): Allow a using decl. (type_dependent_expression_p): A USING_DECL will make it dependent. * semantics.c (finish_member_declaration): Push a dependent using declaration. testsuite: PR c++/9447 * g++.dg/template/using1.C: New test. * g++.dg/template/using2.C: New test. * g++.dg/template/using3.C: New test. * g++.dg/template/using4.C: New test. From-SVN: r69921
2003-07-29re PR c++/11530 ([unit-at-a-time] inline static function not emitted with -O3)Mark Mitchell3-23/+32
PR c++/11530 * parser.c (cp_parser_postfix_expression): Do not call mark_used. * semantics.c (finish_id_expression): Call mark_used for all declarations. PR c++/11530 * g++.dg/opt/call1.C: New test. From-SVN: r69911
2003-07-29re PR c++/11667 (wider-than-int enums never compare equal to 0)Mark Mitchell8-97/+164
PR c++/11667 * c-common.c (shorten_compare): Take into account differences between C and C++ representation for enumeration types. * tree.h (set_min_and_max_values_for_integral_type): Declare. * stor-layout.c (set_min_and_max_values_for_integral_type): New function, broken out from ... (fixup_signed_type): ... here and ... (fixup_unsigned_type): ... here. PR c++/11667 * call.c (standard_conversion): Allow all integral->enumeral conversions, after marking them as bad. * decl.c (finish_enum): Make sure that all enumerators are properly converted to the underlying type. (build_enumerator): Set DECL_CONTEXT for namespace-scope enumeration types. * pt.c (tsubst_copy): Adjust handling of CONST_DECLs accordingly. (tsubst_enum): Tidy. * Make-lang.in (typeck.o): Depend on convert.h. (class.o): Likewise. (rtti.o): Likewise. * call.c: Include convert.h. (convert_arg_to_ellipsis): Use convert_to_real. * class.c: Include convert.h. (build_base_path): Use convert_to_integer. * rtti.c: Include convert.h. (build_headof): Use convert_to_integer. * typeck.c: Include convert.h. (decay_conversion): Use convert_to_integer. (build_unary_op): Use build_nop. (get_delta_difference): Use convert_to_integer. (build_ptrmemfunc): Avoid unncessary conversions. From-SVN: r69909
2003-07-28decl2.c (mark_member_pointers): Verify that member pointer points to the ↵Jan Hubicka2-1/+7
function. * decl2.c (mark_member_pointers): Verify that member pointer points to the function. From-SVN: r69902
2003-07-28cp-tree.h (begin_compound_stmt): No scope arg is a bool.Nathan Sidwell10-57/+68
* cp-tree.h (begin_compound_stmt): No scope arg is a bool. (finish_compound_stmt): Remove no scope arg. * decl.c (register_dtor_fn): Adjust begin_compound_stmt and end_compound_stmt calls. (expand_static_init, begin_destructor_body, begin_function_body, finish_function_body): Likewise. * decl2.c (start_objects, finish_objects, start_static_storage_duration_function, finish_static_storage_duration_function): Likewise. * init.c (begin_init_stmts, finish_init_stmts, construct_virtual_base, build_vec_init): Likewise. * method.c (do_build_assign_ref, synthesize_method): Likewise. * parser.c (cp_parser_compound_statement, cp_parser_implicitly_scoped_statement, cp_parser_already_scoped_statement): Likewise. * pt.c (tsubst_expr): Likewise. * semantics.c (begin_compound_stmt): No scope arg is a bool. (finish_compound_stmt): Remove no scope arg. * error.c (dump_expr) <COMPOUND_EXPR case>: A compound expr is always dyadic. From-SVN: r69882
2003-07-27call.c (standard_conversion): Tweak handling of pointer-to-member types.Mark Mitchell4-7/+17
* call.c (standard_conversion): Tweak handling of pointer-to-member types. * pt.c (tsubst): Correctly qualify pointers-to-data member types. * typeck.c (comp_ptr_ttypes_real): Check qualifiers on pointer-to-data member types. * g++.dg/template/ptrmem6.C: New test. From-SVN: r69855
2003-07-27parser.c (cp_parser_type_parameter): Reformat.Nathan Sidwell2-7/+15
* parser.c (cp_parser_type_parameter): Reformat. (cp_parser_parameter_declaration): Deprecate default args where not allowed. From-SVN: r69852
2003-07-26* cfns.h: Rebuilt.Nathan Sidwell2-242/+242
From-SVN: r69833
2003-07-26changelogNathan Sidwell1-0/+15
From-SVN: r69831
2003-07-26cp-tree.h (begin_init_stmts, [...]): Remove.Nathan Sidwell3-98/+29
* cp-tree.h (begin_init_stmts, finish_init_stmts): Remove. (begin_global_stmt_expr, finish_global_stmt_expr): Remove. * init.c (begin_init_stmts): Make static. Return is_global value. Always call begin_stmt_expr. (finish_init_stmts): Make static. Add is_global parm. Always building a stmt tree. (build_aggr_init): Adjust begin_init_stmts, finish_init_stmts calls. (build_vec_init): Likewise. Always building a stmt tree. (expand_default_init): Always building a stmt tree. (get_temp_regvar): Likewise. * semantics.c (begin_global_stmt_expr, finish_global_stmt_expr): Remove. From-SVN: r69830
2003-07-26document default arg deprecationsNathan Sidwell1-0/+3
From-SVN: r69815
2003-07-25cp-tree.h (build_compound_expr): Take LHS & RHS args.Nathan Sidwell6-135/+96
* cp-tree.h (build_compound_expr): Take LHS & RHS args. (build_x_compound_expr_from_list): Declare. * typeck.c (build_x_compound_expr_from_list): New. (build_x_compound_expr): Adjust. (build_compound_expr): Remove unreachable code. Take two parameters, adjust. * decl.c (grok_reference_init): Use build_x_compound_expr_from_list. (expand_static_init): Adjust build_compound_expr call. (cxx_maybe_build_cleanup): Likewise. * init.c (perform_member_init): Use build_x_compound_expr_from_list. (build_new_1): Likewise. (build_vec_delete): Adjust build_compound_expr calls. (build_vbase_delete): Likewise. * typeck2.c (store_init_value): Use build_x_compound_expr_from_list. (build_functional_cast): Likewise. From-SVN: r69794
2003-07-25cp-tree.h (enum tsubst_flags_t): Add tf_user.Nathan Sidwell5-13/+26
* cp-tree.h (enum tsubst_flags_t): Add tf_user. * decl.c (make_typename_type): Pass it. * pt.c (lookup_template_class): Use it. (resolve_typename_type): Pass it. * semantics.c (finish_template_type): Pass it. From-SVN: r69793
2003-07-25re PR c++/11617 (g++ does not report missing member functions)Nathan Sidwell4-24/+47
cp: PR c++/11617 * cp-tree.h (qualified_name_lookup_error): Declare. * pt.c (tsubst_qualified_id): Use qualified_name_lookup_error for errors. (tsubst_expr) <DECL_STMT case>: Likewise. (tsubst_copy_and_build) <COMPONENT_REF case>: Likewise. * semantics.c (qualified_name_lookup_error): New, broken out of ... (finish_id_expression): ... here. Use it. testsuite: PR c++/11617 * g++.dg/template/lookup2.C: New test. * g++.dg/template/memclass1.C: Remove instantiated from error. From-SVN: r69790
2003-07-25* cfns.gperf: Add '%%' delimiter to placate gperf 3.0.Falk Hueffner2-0/+5
From-SVN: r69787
2003-07-25Revert patch for 11617 which accidently crept inNathan Sidwell1-14/+13
From-SVN: r69779
2003-07-25re PR c++/11596 (ICE with int templates)Nathan Sidwell2-121/+132
cp: PR c++/11596 * pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove. (tsubst_template_arg): New. (tsubst_template_arg_vector): Rename to ... (tsubst_template_args): ... this. Accept a TREE_LIST form. Use tsubst_template_arg. (coerce_template_parms): Use tsubst_template_arg for default value. (tsubst_template_parms): Likewise. (tsubst_aggr_type): Adjust. (tsubst_decl): Likewise. (tsubst): Use tsubst_template_arg for a DOMAIN. Adjust. (tsubst_copy) <TEMPLATE_ID_EXPR case>: Use tsubst_template_args. testsuite: PR 11596 * g++.dg/template/defarg3.C: New test. * g++.dg/ext/packed2.C: Pack member struct too. Explain why. From-SVN: r69776
2003-07-25Remove pedwarn_with_decl, warning_with_decl and error_with_decl from GCC.Gabriel Dos Reis3-362/+320
Remove pedwarn_with_decl, warning_with_decl and error_with_decl from GCC. * calls.c (try_to_integrate): Don't use xxx_with_decl. (expand_call): Likewise. * dwarfout.c (output_reg_number): Likewise. * expr.c (expand_expr): Likewise. * function.c (assign_temp): Likewise. (uninitialized_vars_warning): Likewise. (setjmp_args_warning): Likewise. (expand_function_end): Likewise. * stmt.c (fixup_gotos): Likewise. (warn_about_unused_variables): Likewise. (expand_end_bindings): Likewise. * stor-layout.c (layout_decl): Likewise. (place_field): Likewise. * toplev.c (check_global_declarations): Likewise. (rest_of_handle_inlining): Likewise. (default_tree_printer): New function. (general_init): Initialize diagnostic machinery before routing signals to the ICE machinery. Set default tree printer. * toplev.h (pedwarn_with_decl): Remove declaration. (warning_with_decl): Likewise. (error_with_decl): Likewise. (pedwarn): Remove attribute for the time being. * tree-inline.c (expand_call_inline): Don't use xxx_with_decl. * varasm.c (named_section): Likewise. (make_decl_rtl): Likewise. (assemble_variable): Likewise. (merge_weak): Likewise. (declare_weak): Likewise. * diagnostic.h: Move non-diagnostic stuff into pretty-print.h. * diagnostic.c: Move non-diagnostic stuff into pretty-print.c. (format_with_decl): Remove. (diagnostic_for_decl): Likewise. (pedwarn_with_decl): Likewise. (warning_with_decl): Likewise. (error_with_decl): Likewise. (diagnostic_initialize): Adjust. (diagnostic_count_diagnostic): Likewise. (announce_function): Likewise. (lhd_print_error_function): Likewise. (diagnostic_report_current_module): Likewise. (default_diagnostic_starter): Likewise. (diagnostic_report_diagnostic): Likewise. (default_diagnostic_finalizer): Likewise. (verbatim): Likewise. (error): Likewise. (warning): Likewise. * opts.c (common_handle_option): Likewise. * pretty-print.c: New file. * c-pretty-print.h (pp_base): Override. * c-pretty-print.c: Adjust use of macros throughout. (pp_buffer): New macro. (pp_newline): Likewise. * c-objc-common.c (c_tree_printer): Adjust prototype. Tidy. * Makefile.in (DIAGNOSTIC_H): New variable. (c-errors.o): Use it. (c-objc-common.o): Likewise. (c-common.o): Likewise. (c-opts.o): Likewise. (c-format.o): Likewise. (diagnostic.o): Likewise. (opts.o): Likewise. (toplev.o): Likewise. (rtl-error.o): Likewise. (dwarf2out.o): Likewise. (jump.o): Likewise. (pretty-print.o): New rule. cp/ * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H. * error.c: Use the new pretty-printer fraamework. From-SVN: r69773
2003-07-24decl.c (pushdecl_class_level): Don't use push_srcloc/pop_srcloc which causes ↵Per Bothner2-2/+8
errors messages to incorrectly... * decl.c (pushdecl_class_level): Don't use push_srcloc/pop_srcloc which causes errors messages to incorrectly mention included files. From-SVN: r69771
2003-07-24cp-tree.h (convert_to_base_statically): Declare.Mark Mitchell6-18/+61
* cp-tree.h (convert_to_base_statically): Declare. * call.c (build_special_member_call): Convert INSTANCE to the base type. * class.c (convert_to_base_statically): New method. * init.c (construct_virtual_base): Use it. * method.c (do_build_assign_ref): Fix typo in comment. * g++.dg/inherit/access5.C: New test. From-SVN: r69763
2003-07-24tree.h (boolean_type_node): Move from C/C++/Java frontends.Jason Merrill2-9/+7
* tree.h (boolean_type_node): Move from C/C++/Java frontends. (boolean_true_node, boolean_false_node): Likewise. (enum tree_index): Add TI_BOOLEAN_{TYPE,FALSE,TRUE}. * tree.c (build_common_tree_nodes): Init boolean_type_node. (build_common_tree_nodes_2): Init boolean_{true,false}_node. * stor-layout.c (set_sizetype): Handle an early BOOLEAN_TYPE. * c-common.h (truthvalue_type_node): Renamed from boolean_type_node. (truthvalue_true_node): Renamed from boolean_true_node. (truthvalue_false_node): Renamed from boolean_false_node. * c-decl.c: Just set truthvalue_* to integer_*. * c-*.[ch]: s/boolean/truthvalue/. s/c_bool/boolean/. * cp/decl.c: Just set truthvalue_* to boolean_*. * java/java-tree.h: Move boolean_type_node et al to the back end. From-SVN: r69758
2003-07-24* decl.c (reshape_init): Remove unreachable code.Nathan Sidwell2-7/+5
From-SVN: r69741
2003-07-24re PR c++/11513 (ICE in push_template_decl_real cp/pt.c:2755, template ↵Kriang Lerdsuwanakij2-1/+6
member functions) PR c++/11513 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope. * g++.dg/template/crash8.C: New test. From-SVN: r69739
2003-07-23re PR c++/11645 (Failure to deal with using and private inheritance)Mark Mitchell4-25/+44
PR c++/11645 * cp-tree.h (accessible_base_p): Declare. * call.c (build_over_call): Use it. * search.c (accessible_base_p): New function, split out from ... (lookup_base): ... here. PR c++/11645 * g++.dg/inherit/access4.C: New test. From-SVN: r69724
2003-07-23re PR c++/11517 (g++ fails to properly convert pointer expressions in ↵Mark Mitchell3-8/+14
conditional expressions.) PR c++/11517 * call.c (build_conditional_expr): Use perform_implicit_conversion and error_operand_p. Robustify. * typeck.c (build_unary_op): Use perform_implicit_conversion. PR c++/11517 * g++.dg/expr/cond2.C: New test. From-SVN: r69715
2003-07-23parser.c (cp_parser_nested_name_specifier): Reset scope on failure.Nathan Sidwell2-1/+12
cp: * parser.c (cp_parser_nested_name_specifier): Reset scope on failure. (cp_parser_elaborated_type_specifier): Likewise. testsuite: * g++.dg/parse/crash10: New test. From-SVN: r69702
2003-07-22fold-const.c (force_fit_type): Handle OFFSET_TYPE.Mark Mitchell18-948/+606
* fold-const.c (force_fit_type): Handle OFFSET_TYPE. * varasam.c (output_constant): Likewise. 2003-07-22 Mark Mitchell <mark@codesourcery.com> Eliminate use of POINTER_TYPE for pointers-to-members. * call.c (standard_conversion): Rework pointer-to-member handling. Add comments. (add_builtin_candidate): Likewise. (resolve_scoped_fn_name): Remove. (build_conditional_expr): Rework pointer-to-member handling. (compare_ics): Likewise. * class.c (check_field_decls): Use TYPE_PTR_P. * cp-lang.c (cp_var_mod_type_p): Rework pointer-to-member handling. * cp-tree.h (SCALAR_TYPE_P): Use TYPE_PTR_TO_MEMBER_P. (TYPE_PTRMEM_P): Add comment. (TYPE_PTR_P): Simplify. (TYPE_PTROB_P): Correct definition. (TYPE_PTR_TO_MEMBER_P): New macro. (TYPE_PTRMEM_CLASS_TYPE): Adjust. (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. (resolved_scoped_fn_name): Remove declaration. (build_offset_ref): Change prototype. (resolve_offset_ref): Remove. (comp_target_types): Remove. * cvt.c (cp_convert_to_pointer): Rework pointer-to-member handling. (convert_to_reference): Use can_convert. (ocp_convert): Improve error handling. Rework pointer-to-member handling. (perform_qualification_conversions): Rework pointer-to-member handling. * decl.c (build_ptrmem_type): Handle functions too. (create_array_type_for_decl): Remove OFFSET_TYPE error message. (grokdeclarator): Use OFFSET_TYPE for pointers to data members. (grokparms): Remove OFFSET_TYPE error message. * dump.c (cp_dump_tree): Rework pointer-to-member handling. * error.c (dump_type_prefix): Likewise. * expr.c (cplus_expand_constant): Use build_nop. * init.c (build_offset_ref): Add address_p parameter. Fold in necessary bits from resolve_offset_ref. (resolve_offset_ref): Remove. * parser.c (cp_parser_postfix_expression): Remove special case code for OFFSET_TYPE. * pt.c (convert_nontype_argument): Rework pointer-to-member handling. (convert_template_argument): Likewise. (unify): Likewise. (invalid_nontype_parm_type_p): Likewise. (dependent_type_p_r): Likewise. * rtti.c (get_tinfo_decl): Remove OFFSET_TYPE special case. (target_incomplete_p_): Rework pointer-to-member handling. (get_pseudo_ti_init): Likewise. (get_pseudo_ti_desc): Likewise. * semantics.c (finish_qualified_id_expr): Adjust call to build_offset_ref. Remove use of resolve_offset_ref. * tree.c (pod_type_p): Use TYPE_PTR_TO_MEMBER_P. * typeck.c (target_type): Use TYPE_PTRMEM_P. (type_unknown_p): Remove obsolete code about the time before non-dependent expressions were handled correctly. (qualify_type_recursive): Remove. (composite_pointer_type_r): New function. (composite_pointer_type): Use it. (merge_types): Remove dead comments. (comp_cv_target_types): Remove. (comp_target_types): Likewise. (comp_target_parms): Likewise. (cxx_sizeof_or_alignof_type): Remove OFFSET_TYPE error. (build_indirect_ref): Use TYPE_PTR_TO_MEMBER_P. (build_binary_op): Do not use of comp_target_types. (pointer_diff): Remove OFFSET_TYPE case. (build_unary_op): Adjust pointer-to-member handling. (unary_complex_lvalue): Likewise. (check_for_casting_away_constness): Add description parameter. (build_static_cast): Pass it. (build_reinterpret_cast): Use check_for_casting_away_constness. (build_const_cast): Adjust pointer-to-member handling. (build_c_cast): Likewise. (convert_for_assignment): Remove OFFSET_TYPE error message. (comp_ptr_ttypes_real): Adjust pointer-to-member handling. (comp_ptr_ttypes_reinterpret): Remove. (casts_away_constness_r): Adjust pointer-to-member handling. (casts_away_constness): Liekwise. (strip_all_pointer_quals): Remove. * typeck2.c (digest_init): Adjust pointer-to-member handling. (build_m_component_ref): Likewise. From-SVN: r69691
2003-07-22lex.c (unqualified_fn_lookup_error): Mention that the error message needs to ↵Wolfgang Bangerth2-2/+13
be kept in synch with the manual. 2003-07-22 Wolfgang Bangerth <bangerth@dealii.org> * lex.c (unqualified_fn_lookup_error): Mention that the error message needs to be kept in synch with the manual. From-SVN: r69676
2003-07-22re PR c++/11614 (Incorrect handling of pointers to arrays)Nathan Sidwell2-4/+14
cp: PR c++/11614 * decl.c (grokdeclarator): An array member is only a flexible array member if the field itself is the array. testsuite: * g++.dg/ext/flexary1.C: New test. From-SVN: r69673
2003-07-22re PR c++/10793 (ICE (treecheck) when partial-specializing with an invalid ↵Kriang Lerdsuwanakij2-0/+8
type and a base class, in xref_basetypes, at cp/decl.c:12834) PR c++/10793 * decl.c (xref_basetypes): Handle error_mark_node. * g++.dg/template/crash9.C: New test. From-SVN: r69671
2003-07-22cp-tree.h (enum cp_lvalue_kind): Add clk_packed.Nathan Sidwell5-10/+51
cp: * cp-tree.h (enum cp_lvalue_kind): Add clk_packed. * tree.c (lvalue_p_1): Set it. * class.c (check_field): Don't allow non-packed non-POD fields to be packed. * call.c (reference_binding): Need a temporary for all bitfield and packed fields. (convert_like_real): Check it is ok to make a temporary here. testsuite: * g++.dg/ext/packed3.C: New test. * g++.dg/ext/packed4.C: New test. From-SVN: r69669
2003-07-21cp-tree.h (hack_identifier): Remove.Nathan Sidwell4-120/+89
cp: * cp-tree.h (hack_identifier): Remove. * method.c (hack_identifier): Remove. * semantics.c (finish_id_expression): Expand hack_identifier here. Simplify. From-SVN: r69625
2003-07-19fixfixes.c [...]: Remove unnecessary casts.Kaveh R. Ghazi12-60/+51
gcc: * fixinc/fixfixes.c fixinc/fixincl.c fixinc/fixlib.c fixinc/server.c objc/objc-act.c: Remove unnecessary casts. f: * com.c data.c expr.c fini.c g77spec.c global.c lab.c lex.c name.c sta.c stc.c std.c storag.c stt.c stw.c symbol.c target.c type.c: Remove unnecessary casts. cp: * call.c class.c decl.c decl2.c g++spec.c lex.c parser.c pt.c rtti.c semantics.c typeck.c: Remove unnecessary casts. java: * class.c java-tree.h jcf-write.c jvspec.c: Remove unnecessary casts. treelang: * treetree.c: Remove unnecessary casts. From-SVN: r69593
2003-07-19Correct entries informationKriang Lerdsuwanakij1-1/+2
From-SVN: r69583
2003-07-18changelog for previous patchNathan Sidwell1-0/+10
From-SVN: r69565
2003-07-18cp-tree.h (finish_non_static_data_member): Add object param.Nathan Sidwell5-20/+38
cp: * cp-tree.h (finish_non_static_data_member): Add object param. * method.c (hack_identifier): Adjust. * pt.c (tsubst_copy_and_build) <COMPONENT_REF case>: Don't search again for a FIELD_DECL. * semantics.c (finish_non_static_data_member): Add object parameter. Always save the DECL in the COMPONENT_REF. * call.c (resolve_scoped_fn_name): Adjust. testsuite: * g++.dg/parse/non-dependent2.C: New test. From-SVN: r69564
2003-07-17c-decl.c: Fix typos in several comments.Zack Weinberg2-11/+16
* c-decl.c: Fix typos in several comments. Remove all #if 0 blocks; reindent as needed. Remove unused argument to declare_parm_level; all callers changed. * c-parse.in: Update calls to declare_parm_level. Avoid issuing a double warning in some circumstances. * c-typeck.c: Update calls to declare_parm_level. * c-tree.h: Update prototype of declare_parm_level. * c-pragma.c (apply_pragma_weak): Don't complain about a redundant #pragma weak. * objc/objc-act.c (forward_declare_categories, build_selector_reference_decl, build_class_reference_decl, build_objc_string_decl, synth_forward_declarations, build_protocol_reference): Set TREE_PUBLIC on synthetic forward decl to 0, consistent with eventual definition. Correct comments to match. cp: * pt.c (get_bindings): Make definition consistent with forward declaration. From-SVN: r69519
2003-07-17re PR c++/7809 (befriending inaccessible names)Kriang Lerdsuwanakij2-0/+8
PR c++/7809 * friend.c (add_friend): Check access for member functions and templates. * g++.dg/parse/access3.C: New test. From-SVN: r69513
2003-07-17re PR c++/10668 (assigning address of non-static member variable to pointer)Gabriel Dos Reis2-1/+9
PR c++/10668 * typeck.c (build_class_member_access_expr): Improve diagnostic. From-SVN: r69509
2003-07-17re PR c++/11547 (ICE with const temporaries)Mark Mitchell6-93/+177
PR c++/11547 * cp-tree.h (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P): New macro. (DECL_PRETTY_FUNCTION_P): Use VAR_DECL_CHECK. * decl.c (duplicate_decls): Merge DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. * parser.c (cp_parser_postfix_expression): Adjust call to cp_parser_initializer_list and cp_parser_parenthesized_expression_list. (cp_parser_parenthesized_expression_list): Add non_constant_p. (cp_parser_new_placement): Adjust call to cp_parser_parenthesized_expression_list. (cp_parser_direct_new_declarator): Likewise. (cp_parser_conditional_expression): Remove. (cp_parser_constant_expression): Parse an assignment-expression, not a conditional-expression. (cp_parser_simple_declaration): Resolve expression/declaration ambiguity more quickly. (cp_parser_mem_initializer): Adjust call to cp_parser_parenthesized_expression_list. (cp_parser_init_declarator): Keep track of whether or not the initializer is a constant-expression. (cp_parser_initializer): Add non_constant_p parameter. (cp_parser_initializer_clause): Likewise. (cp_parser_initializer_list): Likewise. (cp_parser_attribute_list): Adjust call to cp_parser_parenthesized_expression_list. (cp_parser_functional_cast): Likewise. * pt.c (tsubst_decl): Copy DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. (tsubst_expr): Tweak use of DECL_PRETTY_FUNCTION_P. * semantics.c (finish_id_expression): Use DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. PR c++/11547 * g++.dg/parse/constant3.C: New test. * g++.dg/parse/crash7.C: Likewise. From-SVN: r69493
2003-07-16c.opt: Document more options.Neil Booth2-162/+4
* c.opt: Document more options. cp: * lang-options.h: Remove. From-SVN: r69477