aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
AgeCommit message (Collapse)AuthorFilesLines
2003-12-08Give the anonymous namespace a null DECL_NAME.Jason Merrill1-1/+1
* cp-tree.h: Don't declare anonymous_namespace_name. * decl.c: Don't define it. * dump.c (cp_dump_tree): Don't check for it. * cxx-pretty-print.c (pp_cxx_original_namespace_definition): Likewise. * error.c (dump_decl): Likewise. * name-lookup.c: Define it here. (push_namespace): Put it in DECL_ASSEMBLER_NAME instead. * mangle.c (write_unqualified_name): Adjust. From-SVN: r74433
2003-10-08cp_tree.h: Added TFF_NO_FUNCTION_ARGUMENTS.Giovanni Bajo1-2/+2
* cp_tree.h: Added TFF_NO_FUNCTION_ARGUMENTS. * error.c (dump_function_decl): Use it to skip the dump of the arguments. (dump_expr): When dumping a declaration found within an expression, always set TFF_NO_FUNCTION_ARGUMENTS in the flags. From-SVN: r72215
2003-09-21Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.Richard Henderson1-1/+1
From-SVN: r71641
2003-09-21tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.Richard Henderson1-1/+1
* tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const. (TREE_FILENAME, TREE_LINENO): Likewise. (set_tree_locus, copy_tree_locus, set_tree_file_line): New. (TREE_LOCUS_SET_P): New. * c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c, diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c, print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c, tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c, config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match. ada/ * trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and change to const. cp/ * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, method.c, optimize.c, pt.c, semantics.c, tree.c: Update for DECL_SOURCE_LOCATION rename and change to const. f/ * com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and change to const. java/ * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, resource.c: Update for DECL_SOURCE_LOCATION rename and change to const. treelang/ * treetree.c: Update for DECL_SOURCE_LOCATION rename and change to const. From-SVN: r71636
2003-09-18c-pretty-print.h (pp_type_specifier_seq): Fix thinko.Gabriel Dos Reis1-35/+4
* c-pretty-print.h (pp_type_specifier_seq): Fix thinko. * c-pretty-print.c: Fix formatting. (pp_c_integer_constant): Append type annotation to literals. Tidy. (pp_c_type_specifier): Tidy. (pp_c_compound_literal): New function. (pp_c_initializer): Simplify.. (pp_c_initializer_list): Likewise. (pp_c_brace_enclosed_initializer_list): New function. (pp_c_postfix_expression): Simplify. cp/ * error.c (dump_type): Simplify. Use pp_type_specifier_seq for "C" types. * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko. From-SVN: r71511
2003-09-07re PR c++/11762 (namespace aliasing ICE in warn_extern_redeclared_static)Gabriel Dos Reis1-4/+9
* c-pretty-print.h (pp_c_left_brace): Declare. (pp_c_right_brace): Likewise. * c-pretty-print.c (pp_c_left_brace): Now a function (pp_c_right_brace): Likewise. cp/ PR c++/11762 * error.c (dump_decl): Handle namespace-alias-definition. * decl.c (warn_extern_redeclared_static): There is no point in checking changes in storage class specifier for a namespace declaration. (duplicate_decls): Tidy diagnostic message. * cxx-pretty-print.c (pp_cxx_left_brace): New macro. (pp_cxx_right_brace): Likewise. (pp_cxx_original_namespace_definition): New function. (pp_cxx_namespace_alias_definition): Likewise. (pp_cxx_declaration): Use them. Handle NAMESPACE_DECLs. From-SVN: r71175
2003-09-01c-typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR.Josef Zlomek1-1/+0
* c-typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR. * convert.c (convert_to_integer): Kill BIT_ANDTC_EXPR. * fold-const.c (int_const_binop): Kill BIT_ANDTC_EXPR. (fold): Kill BIT_ANDTC_EXPR and label bit_and. * tree.def (BIT_ANDTC_EXPR): Kill. * error.c (dump_expr): Kill BIT_ANDTC_EXPR. * lex.c (init_operators): Kill BIT_ANDTC_EXPR. * pt.c (tsubst_copy): Kill BIT_ANDTC_EXPR. * typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR. (tsubst_copy_and_build): Kill BIT_ANDTC_EXPR. * com.c (ffecom_overlap_): Kill BIT_ANDTC_EXPR. (ffecom_tree_canonize_ref_): Kill BIT_ANDTC_EXPR. From-SVN: r70972
2003-08-29re PR c++/11811 (Weird message with default template arguments)Gabriel Dos Reis1-3/+4
PR c++/11811 * cxx-pretty-print.c (pp_cxx_canonical_template_parameter): New function. * cxx-pretty-print.h: Declare. * error.c (dump_template_parameter): Use it. (dump_type): Likewise. From-SVN: r70905
2003-08-15cp-tree.def (NON_DEPENDENT_EXPR): Add operand.Nathan Sidwell1-3/+1
* cp-tree.def (NON_DEPENDENT_EXPR): Add operand. * decl2.c (build_offset_ref_call_from_tree): Use build_non_dependent_expr. * error.c (dump_expr) <NON_DEPENDENT_EXPR case>: Dump the operand. * pt.c (build_non_dependent_expr): Set operand. From-SVN: r70478
2003-08-10pretty-print.c (pp_base_indent): Rename from pp_indent.Gabriel Dos Reis1-35/+2
* pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (pp_c_right_paren): Likewise. (pp_c_left_brace): Likewise. (pp_c_right_brace): Likewise. (pp_c_left_bracket): Likewise. (pp_c_right_bracket): Likewise. (pp_c_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): non-NULL NODE is always a ↵Nathan Sidwell1-33/+12
TREE_VEC of non-zero size. cp: * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): non-NULL NODE is always a TREE_VEC of non-zero size. (NUM_TMPL_ARGS): NODE is always a TREE_VEC. * decl2.c (arg_assoc): Template args will be a vec. * error.c (dump_decl) <TEMPLATE_ID_EXPR case>: Call dump_template_argument_list. (dump_template_parms): Args will be a vec. * parser.c (cp_parser_template_argument_list): Produce a vector, not a list. * pt.c (coerce_template_parms): Args are always vectors. (mangle_class_name_for_template): Likewise. (lookup_template_function): Likewise. (lookup_template_class): Likewise. (tsubst_template_args): Likewise. (tsubst_baselink): Use tsubst_template_args. (tsubst_qualified_id): Likewise. (tsubst_copy) <TEMPLATE_ID_EXPR case>: Likewise. (tsubst_copy_and_build) <TEMPLATE_ID_EXPR case>: Likewise. (any_dependent_template_args_p): Args are always vectors. * tree.c (cp_tree_equal): Add TEMPLATE_ID_EXPR case. From-SVN: r70295
2003-08-10re PR c++/11670 (ICE in convert_like_real on illegal code)Nathan Sidwell1-3/+21
cp: PR c++/11670 * call.c (convert_like_real): Add rvalue binding error message. * error.c (dump_expr) <NOP_EXPR case>: Detect when the no expr is really a cast. testsuite: PR c++/11670 * g++.dg/expr/cast2.C: New test. From-SVN: r70294
2003-08-05pretty-print.h (pp_set_line_maximum_length): Make macro.Gabriel Dos Reis1-113/+21
* pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-07-28cp-tree.h (begin_compound_stmt): No scope arg is a bool.Nathan Sidwell1-14/+3
* 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-25Remove pedwarn_with_decl, warning_with_decl and error_with_decl from GCC.Gabriel Dos Reis1-360/+313
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-22fold-const.c (force_fit_type): Handle OFFSET_TYPE.Mark Mitchell1-11/+6
* 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-16cp-tree.def (LOOKUP_EXPR): Remove.Mark Mitchell1-8/+0
* cp-tree.def (LOOKUP_EXPR): Remove. * cp-tree.h (cp_id_kind): Add CP_ID_KIND_UNQUALIFIED_DEPENDENT. (LOOKUP_EXPR_GLOBAL): Remove. (get_bindings): Remove. (is_aggr_type_2): Remove. * call.c (resolved_scoped_fn_name): Remove support for LOOKUP_EXPR. * decl.c (grokfndecl): Likewise. (grokdeclarator): Likewise. * error.c (dump_decl): Likewise. (dump_expr): Likewise. * friend.c (do_friend): Likewise. * init.c (build_offset_ref): Likewise. * lex.c (unqualified_fn_lookup_error): Use pedwarn. Do not create LOOKUP_EXPRs * mangle.c (write_expression): Remove support for LOOKUP_EXPR. * parser.c (cp_parser_postfix_expression): Modify Koenig lookup test. * pt.c (get_bindings): Give it internal linkage. (check_explicit_specialization): Remove support for LOOKUP_EXPR. (lookup_template_function): Likewise. (for_each_tempalte_parm_r): Likewise. (tsubst_decl): Likewise. (tsubst_qualified_id): Handle template template parameters. (tsubst_copy): Remove support for LOOKUP_EXPR. (tsubst_copy_and_build): Likewise. (most_general_template): Likewise. (value_dependent_expression_p): Likewise. (type_dependent_expression_p): Note that IDENTIFIER_NODEs are always dependent. * semantics.c (perform_koenig_lookup): Do not create IDENTIFIER_NODEs. (finish_fname): Likewise. (finish_id_expression): Likewise. * tree.c (is_aggr_type_2): Remove. From-SVN: r69427
2003-07-14re PR c++/11510 (Error message with operator __imag__ is missing spaces)Gabriel Dos Reis1-0/+8
PR c++/11510 * call.c (op_error): Properly handle REALPART_EXPR and IMAGPART_EXPR. * error.c (dump_expr): Likewise. From-SVN: r69340
2003-07-14* error.c (dump_expr): Handle EMPTY_CLASS_EXPR.Gabriel Dos Reis1-0/+6
From-SVN: r69338
2003-07-10re PR c++/10032 (-pedantic converts some errors to warnings)Mark Mitchell1-1/+1
PR c++/10032 * doc/invoke.texi (C++ Dialect Options): Change documentation of -fpermissive. PR c++/10032 * decl.c (cxx_init_decl_processing): With -pedantic, pedwarns are still errors. PR c++/10527 * error.c (decl_to_string): Do not print default argument expressions. * cp-tree.h (break_out_calls): Remove declaration. * tree.c (break_out_calls): Remove. * typeck.c (build_modify_expr): Avoid invalid sharing of trees. PR c++/10032 * g++.dg/warn/pedantic1.C: New test. From-SVN: r69191
2003-07-09fold-const.c (make_range): Do not access operand 1 for a zero-operand operator.Mark Mitchell1-1/+9
* fold-const.c (make_range): Do not access operand 1 for a zero-operand operator. 2003-07-08 Mark Mitchell <mark@codesourcery.com> * cp-tree.def (NON_DEPENDENT_EXPR): New node. * cp-tree.h (build_call_from_tree): Remove. (build_member_call): Likewise. (dependent_template_arg_p): Remove. (any_dependent_template_arguments_p): New function. (dependent_template_id_p): Likewise. (any_type_dependent_arguments_p): Likewise. (build_non_dependent_expr): Likewise. (build_non_dependent_args): Likewise. (build_x_compound_expr): Adjust prototype. * call.c (build_new_method_call): Handle non-dependent expressions correctly. * decl2.c (grok_array_decl): Likewise. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Remove. * error.c (dump_decl): Handle NON_DEPENDENT_EXPR. (dump_expr): Likewise. * init.c (build_member_call): Remove. * mangle.c (write_expression): Update handling for template-ids. * parser.c (cp_parser_primary_expression): Use any_dependent_template_arguments_p. Update constant-expression handling. (cp_parser_postfix_expression): Use any_type_dependent_arguments_p. Simplify call processing. (cp_parser_unary_expression): Simplify. (cp_parser_expression): Adjust for changes to build_x_compound_expr. (cp_parser_template_argument): Implement standard-conforming parsing of non-type template arguments. (cp_parser_direct_declarator): Use cp_parser_fold_non_dependent_expr. (cp_parser_fold_non_dependent_expr): New function. (cp_parser_next_token_ends_template_argument_p): Likewise. * pt.c (convert_template_argument): Do not call maybe_fold_nontype_arg. (tsubst_baselink): Likewise. (tsubst_copy_and_build): Share common code. Make sizeof/alignof processing work correctly for non-dependent expressions. Adjust handling of COMPOUND_EXPR. Simplify call processing. (value_dependent_expression_p): Deal with functional casts and sizeof/alignof correctly. (type_dependent_expression_p): Handle overloaded functions. (any_type_dependent_arguments_p): New function. (any_dependent_template_arguments_p): Likewise. (dependent_template_p): Treat SCOPE_REFs as dependent. (dependent_template_id_p): Simplify. (build_non_dependent_expr): New function. (build_non_dependent_args): Likewise. * semantics.c (finish_stmt_expr): Don't make dependent statement-expresions have void type. (finish_call_expr): Handle non-dependent expressions correctly. * tree.c (lvalue_p_1): Treat NON_DEPENDENT_EXPRs as lvalues. * typeck.c (cxx_sizeof_or_alignof_type): Give the expression type size_t, even in templates. (expr_sizeof): Likewise. (finish_class_member_access_expr): Handle non-dependent expressions correctly. (build_x_indirect_ref): Likewise. (build_x_binary_op): Likewise. (build_x_unary_op): Likewise. (build_x_conditional_expr): Likewise. (build_x_compound_expr): Likewise. * typeck2.c (build_x_arrow): Likewise. 2003-07-08 Mark Mitchell <mark@codesourcery.com> * g++.dg/abi/mangle17.C: Make sure template expressions are dependent. * g++.dg/abi/mangle4.C: Mark erroneous casts. * g++.dg/debug/debug7.C: Mark erronous new-declarator. * g++.dg/opt/stack1.C: Remove erroneous code. * g++.dg/parse/template7.C: New test. * g++.dg/template/dependent-expr1.C: Mark erroneous code. * g++.old-deja/g++.pt/crash4.C: Likewise. 2003-07-09 Mark Mitchell <mark@codesourcery.com> * gcj/array.h (JvPrimClass): Don't parenthesize the output. From-SVN: r69130
2003-07-08cp-tree.h (build_scoped_method_call): Remove.Mark Mitchell1-0/+2
* cp-tree.h (build_scoped_method_call): Remove. (lookup_qualified_name): Remove parameter. (tsubst_copy_and_build): Declare. (finish_qualified_object_call_expr): Remove. (check_accessibility_of_qualified_id): New function. (finish_qualified_id_expr): Likewise. (non_reference): Likewise. (build_expr_from-tree): Remove. * call.c (non_reference): Remove. (build_scoped_method_call): Likewise. (build_method_call): Use error_operand_p. Assert that we are not processing a template. (standard_conversion): Use non_reference. * class.c (build_vtbl_entry_ref): Likewise. (build_vtbl_ref_1): Likewise. * cvt.c (build_expr_type_conversion): Use non_reference. * decl.c (lookup_qualified_name): Remove flags parameter. (grok_op_properties): Use non_reference. * decl2.c (grok_array_decl): Likewise. (build_expr_from_tree): Remove. (build_offset_ref_call_from_tree): Update comment. * error.c (parm_to_string): Call reinit_global_formatting_buffer. * except.c (prepare_eh_types): Use non_reference. (can_convert_eh): Likewise. * init.c (build_dtor_call): Avoid using build_method_call. * mangle.c (write_template_param): Remove misleading comment. * method.c (locate_copy): Use non_reference. * parser.c (cp_parser_scope_through_which_access_occurs): Remove. (cp_parser_primary_expression): Do not create SCOPE_REFs is non-dependent contexts. (cp_parser_postfix_expression): Use finish_qualified_id_expr. (cp_parser_direct_declarator): Use tsubst_copy_and_build, not build_expr_from_tree. (cp_parser_lookup_name): Adjust call to lookup_qualified_name. Use check_accessibility_of_qualified_id. * pt.c (maybe_fold_nontype_arg): Use tsubst_copy_and_build, not build_expr_from_tree. (tsubst_baselink): New function. (tsubst_qualified_id): Likewise. (tsubst_copy): Use them. Remove support for METHOD_CALL_EXPR. (tsubst_expr): Adjust call to lookup_qualified_name. (tsubst_copy_and_build): Handle SCOPE_REFs specially. Adjust handling of CALL_EXPRs. (value_dependent_expression_p): Use INTEGRAL_OR_ENUMERATION_TYPE_P. * rtti.c (get_tinfo_decl_dynamic): Use non_reference. * search.c (check_final_overrider): Likewise. * semantics.c (check_accessibility_of_qualified_id): New function. (finish_qualified_object_call_expr): Remove. * typeck.c (target_type): Use non_reference. (cxx_sizeof_or_alignof_type): Likewise. (dubious_conversion_warnings): Likewise. (convert_for_initialization): Likewise. (non_reference): New function. From-SVN: r69063
2003-07-06call.c: Fix comment formatting.Kazu Hirata1-1/+1
* call.c: Fix comment formatting. * class.c: Likewise. * cp-tree.h: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * error.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * typeck.c: Likewise. From-SVN: r69022
2003-07-02Fix a typo.Wolfgang Bangerth1-1/+1
From-SVN: r68856
2003-07-02* error.c (locate_error): %P takes an `int', not a `tree'.Kaveh R. Ghazi1-1/+1
From-SVN: r68809
2003-07-01re PR c++/8046 (ICE on illegal code involving destructor being treated as ↵Giovanni Bajo1-0/+7
bit-not expression) 2003-07-01 Giovanni Bajo <giovannibajo@libero.it> PR c++/8046 * error.c (dump_decl): Handle BIT_NOT_EXPR as pseudo destructor calls. From-SVN: r68775
2003-06-30re PR c++/4933 (tree_list not supported by dump_expr)Giovanni Bajo1-4/+15
2003-06-30 Giovanni Bajo <giovannibajo@libero.it> PR c++/4933 * error.c (dump_expr): Support correctly the COMPOUND_EXPR tree generated within a template. Use dump_expr to dump an expression sizeof. From-SVN: r68733
2003-06-30re PR c++/11106 (Error message gives partially mangled operator name)Giovanni Bajo1-1/+1
2003-06-10 Giovanni Bajo <giovannibajo@libero.it> PR c++/11106 * error.c (dump_decl): Call dump_decl to dump the DECL_NAME for a USING_DECL, instead of print_tree_identifier. From-SVN: r68711
2003-06-29cp-tree.h (language_to_string): Adjust declaration.Gabriel Dos Reis1-35/+32
* cp-tree.h (language_to_string): Adjust declaration. * dump.c (cp_dump_tree): Adjust usage. * error.c (dump_char): Use output_formatted_scalar. Tidy. (parm_to_string): Lose unused parameter. Tidy. (expr_to_string): Likewise. (code_to_string): Likewise. (language_to_string): Likewise. (op_to_string): Likewise. (assop_to_string): Likewise. (digit_buffer): Remove. (dump_type): Format builtin vector type as __vector__. From-SVN: r68668
2003-06-29error.c (print_integer): Remove.Gabriel Dos Reis1-10/+2
* error.c (print_integer): Remove. (dump_type_suffix): Adjust. (dump_expr): Likewise. From-SVN: r68665
2003-06-28error.c (print_instantiation_partial_context): Take a location_t.Nathan Sidwell1-10/+12
* error.c (print_instantiation_partial_context): Take a location_t. (print_instantiation_full_context): Adjust. (print_instantiation_context): Adjust. From-SVN: r68644
2003-06-28diagnostic.h (diagnostic_set_info): Replace file and lineno parameters with ↵Nathan Sidwell1-34/+11
a location_t. * diagnostic.h (diagnostic_set_info): Replace file and lineno parameters with a location_t. * diagnostic.c (diagnostic_set_info): Replace file and lineno parameters with a location_t. (inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl): Adjust. * c-error.c (pedwarn_c99): Adjust. * c-format.c (status_warning): Adjust. * rtl-error.c (file_and_line_for_asm): Rename to ... (location_for_asm): Return a location_t. (diagnostic_for_asm): Adjust. * cp/cp-tree.h (cp_line_of, cp_file_of): Remove. * cp/error.c (cp_line_of, cp_file_of): Merge into ... (location_of): ... here. Make static, return a location_t. (cp_error_at, cp_warning_at, cp_pedwarn_at): Adjust. * testsuite/g++.old-deja/g++.robertl/eb133.C: Set expected line number. * testsuite/g++.old-deja/g++.robertl/eb133a.C: Likewise. * testsuite/g++.old-deja/g++.robertl/eb133b.C: Likewise. From-SVN: r68643
2003-05-21c-pretty-print.c (pp_c_integer_literal): Use HOST_WIDE_INT_PRINT_DOUBLE_HEX.Kaveh R. Ghazi1-10/+3
gcc: * c-pretty-print.c (pp_c_integer_literal): Use HOST_WIDE_INT_PRINT_DOUBLE_HEX. cp: * error.c (dump_expr): Use HOST_WIDE_INT_PRINT_DOUBLE_HEX. From-SVN: r67055
2003-05-17builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use ↵Kaveh R. Ghazi1-24/+18
stdarg. gcc: * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-semantics.c (build_stmt): Likewise. * calls.c (emit_library_call, emit_library_call_value): Likewise. * collect2.c (notice, fatal_perror, fatal, error): Likewise. * cpperror.c (cpp_error, cpp_error_with_line): Likewise. * diagnostic.c (build_message_string, output_printf, output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl, fnotice): Likewise. * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_nstring, dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, dw2_asm_output_encoded_addr_rtx): Likewise. * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. * errors.c (warning, error, fatal, internal_error): Likewise. * final.c (output_operand_lossage, asm_fprintf): Likewise. * fix-header.c (fatal): Likewise. * gcc.c (fatal, error, notice): Likewise. * gcov.c (fnotice): Likewise. * genattrtab.c (attr_rtx, attr_printf): Likewise. * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c (fatal, error): Likewise. * protoize.c (notice): Likewise. * ra-debug.c (ra_debug_msg): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c (error_for_asm, warning_for_asm): Likewise. * tree.c (build, build_nt, build_function_type_list): Likewise. cp: * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate libiberty VA_ macros, always use stdarg. * rtti.c (create_pseudo_type_info): Likewise. * tree.c (build_min_nt, build_min): Likewise. From-SVN: r66919
2003-05-03class.c (finish_struct): Use location_t and input_location directly.Nathan Sidwell1-7/+7
* class.c (finish_struct): Use location_t and input_location directly. * decl.c (make_label_decl): Likewise. (use_label): Likewise. * decl2.c (warn_if_unknown_interface): Likewise. (start_static_initialization_or_destruction): Likewise. (generate_ctor_or_dtor_function): Likewise. (finish_file): Likewise. * error.c (print_instantiation_full_context): Likewise. * init.c (create_temporary_var): Likewise. * method.c (synthesize_method): Likewise. * parser.c (cp_token): Likewise. (cp_lexer_set_source_position_from_token): Likewise. (cp_lexer_get_preprocessor_token): Likewise. (cp_parser_statement): Likewise. * pt.c (tsubst_friend_function): Likewise. (instantiate_class_template): Likewise. (tsubst_decl): Likewise. (tsubst): Likewise. (instantiate_decl): Likewise. * semantics.c (begin_class_definition): Likewise. (expand_body): Likewise. From-SVN: r66423
2003-05-01input.h (lineno): Rename to ...Nathan Sidwell1-5/+5
* input.h (lineno): Rename to ... (input_line): ... here. * tree.h (lineno): Rename to ... (input_line): ... here. * scan.h (lineno): Rename to ... (input_line): ... here. * toplev.c (lineno): Rename to ... (input_line): ... here. (push_srcloc, pop_srcloc): Rename lineno to input_line. * c-common.c (c_expand_start_cond, fname_decl): Likewise. * c-decl.c (poplevel, pop_label_level, lookup_label, lookup_tag, store_parm_decls, c_expand_body_1): Likewise. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-lex.c (fe_file_change, cb_def_pragma, c_lex): Likewise. * c-opts.c (c_common_post_options, c_common_parse_file): Likewise. * c-parse.in (save_filename, maybe_type_qual, ifc): Likwise. * c-semantics.c (finish_stmt_tree, build_stmt, emit_local_var, gentrtl_goto_stmt, genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt, genrtl_while_stmt, genrtl_do_stmt, genrtl_return_stmt, genrtl_for_stmt, build_break_stmt, build_continue_stmt, genrtl_switch_stmt, genrtl_asm_stmt, prep_stmt, find_reachable_label, expand_unreachable_stmt): Likewise. * coverage.c (create_coverage): Likewise. * diagnostic.c (pedwarn, sorry, error, fatal_error, internal_error, warning, diagnostic_report_current_module, inform): Likewise. * expr.c (expand_expr): Likewise. * integrate.c (expand_inline_function, output_inline_function): Likewise. * rtl-error.c (file_and_line_for_asm): Likewise. * tree-inline.c (find_alloca_call, find_builtin_longjmp_call, walk_tree): Likewise. * tree.c (make_node): Likewise. * ada, cp, f, java, objc, treelang: Likewise. ada * trans.c (build_unit_elab, set_lineno): Rename lineno to input_line. * utils.c (pushdecl, create_label_decl, begin_subprog_body, end_subprog_body): Likewise. * utils2.c (build_call_raise): Likewise. cp * class.c (finish_struct): Rename lineno to input_line. * decl.c (push_binding_level, pop_binding_level, suspend_binding_level, resume_binding_level, make_label_decl, use_label, start_function): Likewise. * decl2.c (warn_if_unknown_interface, start_static_initialization_or_destruction, generate_ctor_or_dtor_function, finish_file): Likewise. * error.c (cp_line_of, print_instantiation_full_context, print_instantiation_context): Likewise. * except.c (check_handlers_1, check_handlers): Likewise. * init.c (create_temporary_var): Likewise. * method.c (use_thunk, synthesize_method): Likewise. * parser.c (cp_lexer_set_source_position_from_token, cp_lexer_get_preprocessor_token): Likewise. * pt.c (push_tinst_level, pop_tinst_level, tsubst_friend_function, instantiate_class_template, tsubst_decl, tsubst, tsubst_expr, instantiate_decl): Likewise. * semantics.c (genrtl_try_block, finish_label_stmt, begin_class_definition, expand_body, genrtl_finish_function): Likewise. * tree.c (build_min_nt, build_min): Likewise. f * ansify.c (die_unless): Rename lineno to input_line. * com.c (ffecom_subscript_check_, ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_, bison_rule_pushlevel_, bison_rule_compstmt_, finish_function, store_parm_decls): Likewise. * intrin.c (ffeintrin_fulfill_generic): Likewise. * lex.c (ffelex_hash_, ffelex_include_, ffelex_next_line_, ffelex_file_fixed, ffelex_file_free): Likewise. * std.c (ffestd_exec_end): Likewise. * ste.c (ffeste_emit_line_note_, ffeste_start_block_, ffeste_start_stmt_): Likewise. * ste.h (ffeste_filelinenum, ffeste_set_line): Likewise. java * lex.h (lineno): Rename to ... (input_line): ... here * parse-scan.y (lineno): Rename to ... (input_line): ... here. (reset_report): Rename lineno to input_line. * check-init.c (check_init): Likewise. * class.c (push_class): Likewise. * decl.c (complete_start_java_method, end_java_method): Likewise. * expr.c (expand_byte_code): Likewise. * jcf-parse.c (give_name_to_class, parse_class_file): Likewise. * jcf-write.c (generate_bytecode_insns): Likewise. * lex.c (java_init_lex, java_allocate_new_line, do_java_lex): Likewise. * parse.h (YYNOT_TWICE): Likewise. * parse.y (empty_statement, expression_statement, java_pop_parser_context, java_parser_context_save_global, yyerror, register_fields, method_header, safe_layout_class, find_in_imports_on_demand, create_artificial_method, source_end_java_method, start_complete_expand_method, build_thisn_assign, java_complete_lhs, maybe_absorb_scoping_block): Likewise. objc * objc-act.c (objc_init): Rename lineno to input_line. (build_module_descriptor, build_selector_translation_table, build_protocol_template, build_method_prototype_list_template, build_category_template, build_selector_table, build_class_template, build_super_template, build_ivar_template, build_ivar_list_template, build_method_list_template, build_method_template, add_instance_variable): Likewise. treelang * tree1.c (treelang_init): Rename lineno to input_line. From-SVN: r66333
2003-04-29re PR c++/10527 (confused error message with "new int()" parameter initializer)Mark Mitchell1-2/+10
PR c++/10527 * error.c (dump_expr): Correctly handling of NEW_EXPR.4 PR c++/10527 * g++.dg/init/new7.C: New test. From-SVN: r66247
2003-03-28error.c (dump_expr): Add 0x to printed hex numbers to make output match ↵Mike Stump1-2/+2
source code better. * error.c (dump_expr): Add 0x to printed hex numbers to make output match source code better. From-SVN: r64997
2003-03-24Changelog commit escaped earlierNathan Sidwell1-1/+1
Changelog commit escaped earlier cp: PR c++/10119 * error.c (dump_expr) [BASELINK]: Use dump_expr. * pt.c (maybe_fold_nontype_args): New function. (tsubst_copy) [SCOPE_REF]: Subst any template_id args. [TEMPLATE_ID_EXPR]: Break out folding code, call it. (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Call maybe_fold_nontype_args. testsuite: PR c++/10119 * g++.dg/template/ptrmem5.C: New test. From-SVN: r64819
2003-03-21re PR c++/9898 (Template reference cast operator of template class)Nathan Sidwell1-4/+14
cp: PR c++/9898 * error.c (dump_decl) [CONST_DECL]: Print '<enumerator>'. (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call. testsuite: PR c++/9898 * g++.dg/other/error4.C: New test. From-SVN: r64667
2003-03-07error.c (init_error): Use C90 prototype style.Gabriel Dos Reis1-222/+113
* error.c (init_error): Use C90 prototype style. (dump_scope): Likewise. (dump_qualifiers): Likewise. (dump_template_argument): Likewise. (dump_template_argument_list): Likewise. (dump_template_parameter): Likewise. (dump_template_bindings): Likewise. (dump_type): Likewise. (dump_typename): Likewise. (class_key_or_enum): Likewise. (dump_aggr_type): Likewise. (dump_type_prefix): Likewise. (dump_type_suffix): Likewise. (dump_global_iord): Likewise. (dump_simple_decl): Likewise. (dump_decl): Likewise. (dump_template_decl): Likewise. (dump_function_decl): Likewise. (dump_parameters): Likewise. (dump_exception_spec): Likewise. (dump_function_name): Likewise. (dump_template_parms): Likewise. (dump_char): Likewise. (dump_expr_list): Likewise. (dump_expr): Likewise. (dump_binary_op): Likewise. (dump_unary_op): Likewise. (type_as_string): Likewise. (expr_as_string): Likewise. (decl_as_string): Likewise. (context_as_string): Likewise. (lang_decl_name): Likewise. (cp_file_of): Likewise. (cp_line_of): Likewise. (decl_to_string): Likewise. (expr_to_string): Likewise. (fndecl_to_string): Likewise. (code_to_string): Likewise. (language_to_string): Likewise. (parm_to_string): Likewise. (op_to_string): Likewise. (type_to_string): Likewise. (assop_to_string): Likewise. (args_to_string): Likewise. (cv_to_string): Likewise. (cxx_print_error_function): Likewise. (cp_diagnostic_starter): Likewise. (cp_diagnostic_finalizer): Likewise. (cp_print_error_function): Likewise. (function_category): Likewise. (print_instantiation_full_context): Likewise. (print_instantiation_partial_context): Likewise. (maybe_print_instantiation_context): Likewise. (print_instantiation_context): Likewise. (cp_printer): Likewise. (print_integer): Likewise. (print_non_consecutive_character): Likewise. (locate_error): Likewise. From-SVN: r63928
2003-02-16re PR c++/9459 (typeof in return type specification of template not supported)Kriang Lerdsuwanakij1-0/+2
PR c++/9459 * error.c (dump_type_prefix): Handle TYPEOF_TYPE. (dump_type_suffix): Likewise. * g++.dg/ext/typeof4.C: New test. From-SVN: r62973
2003-01-30c-common.c (builtin_define_float_constants): Define __<TYPE>_HAS_INFINITY__ ↵Mark Mitchell1-0/+1
and __<TYPE>_HAS_QUIET_NAN__. * c-common.c (builtin_define_float_constants): Define __<TYPE>_HAS_INFINITY__ and __<TYPE>_HAS_QUIET_NAN__. * call.c (build_field_call): Use build_new_op, not build_opfncall. (prep_operand): New function. (build_new_op): Use it. Remove dead code. * class.c (pushclass): Change "modify" parameter type from int to bool. (currently_open_class): Use same_type_p, not pointer equality. (push_nested_class): Adjust calls to pushclass, remove modify parameter. * cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro. (pushclass): Change prototype. (push_nested_class): Likewise. (grokoptypename): Remove. (build_opfncall): Remove. (value_dependent_expression_p): Declare. (resolve_typename_type): Likewise. (resolve_typename_type_in_current_instantiation): Likewise. (enter_scope_of): Remove. (tsubst): Remove. (tsubst_expr): Likewise. (tsubst_copy): Likewise. (tsubst_copy_and_build): Likewise. * decl.c (warn_about_implicit_typename_lookup): Remove. (finish_case_label): Return error_mark_node for erroneous labels. (start_decl): Adjust calls to push_nested_class. (grokfndecl): Call push_scope/pop_scope around call to duplicate_decls. (grokdeclarator): Do not call tsubst. (start_function): Adjust calls to push_nested_class. * decl2.c (grok_array_decl): Use build_new_op, not build_opfncall. (check_classfn): Use push_scope/pop_scope around type comparisions. (grokoptypename): Remove. (push_sscope): Adjust call to push_nested_class. * error.c (dump_type): Show cv-qualification of typename types. * init.c (build_member_call): Use build_new_op, not build_opfncall. * method.c (build_opfncall): Remove. * parser.c (cp_parser): Add allow_non_constant_expression_p and non_constant_expression_p. (cp_parser_constant_expression): Adjust prototype. (cp_parser_resolve_typename_type): Remove. (cp_parser_non_constant_expression): New function. (cp_parser_non_constant_id_expression): Likewise. (cp_parser_new): Set allow_non_constant_expression_p and non_constant_expression_p. (cp_parser_primary_expression): Reject `this' and `va_arg' in constant-expressions. Note that dependent names aren't really constant. (cp_parser_postfix_expression): Reject conversions to non-integral types in constant-expressions. Neither are increments or decrements. (cp_parser_unary_expression): Reject increments and decrements in constant-expressions. (cp_parser_direct_new_declarator): Adjust call to cp_parser_constant_expression. (cp_parser_cast_expression): Reject conversions to non-integral types in constant-expressions. (cp_parser_assignment_expression): Rejects assignments in constant-expressions. (cp_parser_expression): Reject commas in constant-expressions. (cp_parser_labeled_statement): Adjust call to cp_parser_constant_expression. (cp_parser_direct_declarator): Simplify array bounds, even in templates, when they are non-dependent. Use resolve_typename_type, not cp_parser_resolve_typename_type. (cp_parser_class_head): Use resolve_typename_type, not cp_parser_resolve_typename_type. (cp_parser_member_declaration): Adjust call to cp_parser_constant_expression. (cp_parser_constant_initializer): Likewise. (cp_parser_constructor_declarator): Use resolve_typename_type, not cp_parser_resolve_typename_type. (cp_parser_late_parsing_default_args): Adjust call to push_nested_class. * pt.c (tsubst): Give it internal linkage. (tsubst_expr): Likewise. (tsubst_copy): Likewise. (tsubst_copy_and_build): Likewise. (push_access_scope_real): Likewise. (tsubst_friend_class): Likewise. (instantiate_class_template): Adjust call to pushclass. (value_dependent_expression_p): Give it external linkage. Robustify. (resolve_typename_type): New function. * semantics.c (finish_call_expr): Use build_new_op, not build_opfncall. (begin_constructor_declarator): Remove. (begin_class_definition): Adjust call to pushclass. (enter_scope_of): Remove. * typeck.c (comptypes): Resolve typename types as appropriate. (build_x_indirect_ref): Use build_new_op, not build_opfncall. (build_x_compound_expr): Likewise. (build_modify_expr): Likewise. (build_x_modify_expr): Likewise. * typeck2.c (build_x_arrow): Likewise. * g++.dg/parser/constant1.C: New test. * include/std/std_limits.h (numeric_limits<float>::has_infinity): Use __FLT_HAS_INIFINITY__ to initialize. (numeric_limits<float>::has_quiet_NaN): Likewise. (numeric_limits<double>::has_infinity): Use __DBL_HAS_INIFINITY__ to initialize. (numeric_limits<double>::has_quiet_NaN): Likewise. (numeric_limits<long double>::has_infinity): Use __LDBL_HAS_INIFINITY__ to initialize. (numeric_limits<long_double>::has_quiet_NaN): Likewise. From-SVN: r62130
2003-01-23re PR c++/9328 (ICE with templates and namespace std members)Mark Mitchell1-0/+19
PR c++/9328 * g++.dg/ext/typeof3.C: New test. PR c++/9328 * error.c (dump_decl): For an OVERLOAD, just print the name of the function; it doesn't make sense to try to print its type. * semantics.c (finish_typeof): Issue errors about invalid uses. From-SVN: r61631
2003-01-16cp-tree.h (lang_type_class): Remove is_partial_instantiation.Mark Mitchell1-2/+1
* cp-tree.h (lang_type_class): Remove is_partial_instantiation. (PARTIAL_INSTANTIATION_P): Remove. (IMPLICIT_TYPENAME_P): Likewise. (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise. (build_typename_type): Remove declaration. (parmlist_is_exprlist): Likewise. * decl.c (build_typename_type): Make it static, remove third parameter. (push_class_binding): Don't do implicit typename stuff. (make_typename_type): Likewise. (lookup_name_real): Likewise. (grokdeclarator): Don't try to convert declarations into initializations. Don't do implicit typename stuff. (parmlist_is_exprlist): Remove. (xref_basetypes): Simplify. * decl2.c (grokfield): Don't try to convert declarations into initializations. (build_anon_union_vars): Do this while processing templates, too. (finish_anon_union): Likewise. * error.c (dump_type): Remove implicit typename handling. * parser.c (cp_parser_diagnose_invalid_type_name): New method. (cp_parser_primary_expression): Correct handling of names not found by unqualified name lookup in templates. (cp_parser_nested_name_specifier_opt): Avoid checking dependency of types when possible. (cp_parser_simple_declaration): Complain intelligently about some invalid declarations. (cp_parser_member_declaration): Likewise. (cp_parser_constructor_declarator_p): Don't check when we're in a function scope. * pt.c (instantiate_class_template): Remove PARTIAL_INSTANTIATION_P gunk. * search.c (lookup_field_r): Don't build implicit typenames. (marked_pushdecls_p): Don't enter dependent base types. (unmarked_pushdecls_p): Likewise. * semantics.c (begin_class_definition): Remove implicit typename stuff. * config/locale/gnu/messages_members.h: Use this-> to refer to unqualified members of base clasess. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Likewise. * include/bits/codecvt.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/list.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/sstream.tcc: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/stdio_filebuf.h: Likewise. * include/ext/stl_rope.h: Likewise. * include/std/std_fstream.h: Likewise. * include/std/std_sstream.h: Likewise. Co-Authored-By: Jeffrey Oldham <oldham@codesourcery.com> From-SVN: r61403
2003-01-01call.c, [...]: Replace "GNU CC" with "GCC" in the copyright header.Steven Bosscher1-4/+4
* call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c, except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h, lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c, pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c, typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the copyright header. * lex.h: parse.y is dead, so don't mention it. Also replace the copyright header with the default GNU copyright header. From-SVN: r60738
2002-12-28Make-lang.in (po-generated): Remove parse.c.Mark Mitchell1-10/+5
* Make-lang.in (po-generated): Remove parse.c. (CXX_OBJS): Remove parse.o and spew.o. Add parser.o. ($(srcdir)/cp/parse.h): Remove target. ($(srcdir)/cp/parse.c): Likewise. (gt-cp-parse.h): Likewise. (gt-cp-parser.h): New target. (c++.distclean): Do not remove parse.output. (c++.maintainer-clean): Do not remove parse.c or parse.h. (cp/spew.o): Remove target. (cp/lex.o): Adjust dependencies. (cp/pt.o): Likewise. (cp/parse.o): Likewise. (cp/TAGS): Do not mention parse.c. (cp/parser.o): New target. * NEWS: Mention the new parser. * call.c (build_scoped_method_call): Simplify. (build_method_call): Likewise. (build_new_function_call): Adjust calls to add_function_candidate and add_template_candidate. (build_new_op): Improve handling of erroroneous operands. (convert_default_arg): Remove circular argument processing. (name_as_c_string): New function. (build_new_method_call): Use it. (perform_implicit_conversion): Use error_operand_p. * class.c (finish_struct_anon): Use constructor_name_p. (check_field_decls): Likewise. (pop_nested_class): Use OVL_NEXT, not OVL_CHAIN. (resolve_address_of_overloaded_function): Likewise. (instantiate_type): Tweak pointer-to-member handling. (get_primary_binfo): Remove incorrect assertion. * config-lang.in (gtfiles): Add parser.c, remove parse.c. * cp-tree.h (DEFARG_TOKENS): New macro. (default_arg): New structure. (cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG. (lang_tree_node): Add default_arg. (cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE. (type_info_ref_type): New macro. (saved_scope): Make processing_explicit_instantiation a boolean. (check_access): New field. (unparsed_text): Remove. (language_function): Remove unparsed_inlines. (error_operand_p): New macro. (lang_decl): Adjust pending_inline_info. (DEFARG_POINTER): Remove. (tag_types): Add typenames. (lookup_ualified_name): Declare. (lookup_name_real): Likewise. (shadow_tag): Adjust prototype. (get_scope_of_declarator): Declare it. (process_next_inline): Remove it. (check_for_missing_semicolon): Likewise. (maybe_get_template_decl_from_type_decl): Declare it. (finish_label_stmt): Adjust prototype. (finish_non_static_data_meber): Declare it. (finish_pseudo_destructor_call_expr): Rename to ... (finish_pseudo_destructor_expr): ... this. (finish_compound_literal): Declare it. (begin_inline_definitions): Remove it. (init_spew): Remove. (peekyylex): Likewise. (arbitrate_lookup): Likewise. (frob_opname): Likewise. (maybe_snarf_defarg): Likewise. (add_defarg_fn): Likewise. (do_pending_defargs): Likewise. (done_pending_defargs): Likewise. (unprocessed_defarg_fn): Likewise. (replace_defarg): Likewise. (end_input): Likewise. (get_overloaded_fn): Likewise. * cvt.c (convert_to_reference): Improve error handling. * decl.c (lookup_name_real): Do not declare it static. (maybe_push_to_top_level): Set check_access. (identifier_type_value): Adjust call to lookup_name_real. (lookup_qualified_name): New method. (lookup_name_real): Remove special-case parsing code. (lookup_name-nonclass): Adjust call to lookup_name_real. (lookup_name_namespace_only): Likewise. (lookup_name): Likewise. (check_tag_decl): Return the type declared. (shadow_tag): Likewise. (register_dtor_fn): Tweak check_access. (grokfndecl): Use constructor_name_p. (get_scope_of_declarator): New function. (grokdeclarator): Obscure tweaks for slightly different declarator representations. (start_method): Return error_mark_node to indicate failure. (cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs. * decl2.c (constructor_name_full): Simplify. (constructor_name): Use it. (build_expr_from_tree): Adjust for changes to do new parser. (push_scope): Improve robustness. (validate_nonmember_using_decl): Process declarations, not names. (do_class_using_decl): Likewise. (handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS here. * error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs. * expr.c (cxx_expand_expr): Handle BASELINKs. * init.c (member_init_ok_or_else): Issue more errors. (build_offset_ref): Tweak handling of FUNCTION_DECLs. * lex.c: Do not include parse.h. (yypring): Do not declare. (yylval): Likewise. (make_reference_declarator): Remove error-generating code. (rid_to_yy): Remove. (cxx_init): Do not call init_spew. (yypring): Remove. (check_for_missing_semicolon): Remove. * lex.h (got_scope): Remove. (got_object): Remove. * method.c (hack_identifier): Use finish_non_static_data_member. (implicitly_declare_fn): Adjust use of constructor_name. * parser.c: New file. * pt.c (parse.h): Do not include it. (maybe_get_template_decl_from_template): Do not declare it. (finish_member_template_decl): Tweak. (begin_explicit_instantiation): Adjust for processing_explicit_instantiation being boolean. (end_explicit_instantiation): Likewise. (maybe_process_partial_specialization): Tighten specialization test. (retrieve_local_specialization): Adjust ue of hash table. (eq_local_specializations): New function. (register_local_specialization): Likewise. (push_template_decl_real): Remove unnecessary test. (maybe_get_template_decl_from_type_decl): Don't make it static. (for_each_template_parm_r): Handle TYPEOF_TYPE. (tsubst_copy): Use retrieive_local_specialization to handle PARM_DECL. Adjust handling of CONST_DECLs. Handle BASELINKs. Handle COMPONENT_REFs with pseudo-destructor-expressions. Simplify handling of CALL_EXPR and METHOD_CALL_EXPR. (tsubst_expr): Pass decls, not names, to do_local_using_decl. (unify): Tweak handling of CONST_DECLs. (regenerate_decl_from_template): Use push_nested_class. (template_for_substitution): New funciton. (instantiate_decl): Use it. Register parameters as local specializations. * rtti.c (init_rtti_processing): Set type_info_ref_type. (build_typeid): Use it. (get_typeid): Likeise. * search.c (accessible_p): Use check_access, not flag_access_control. (adjust_result_of_qualified_name_lookup): Pay attention to the context_class. * semantics.c (finish_asm_stmt): Adjust error handling. (finish_label_stmt): Return the statement. (finish_non_static_data_member): New function. (finish_class_expr): Handle BASELINKs. (finish_call_expr): Handle PSEUDO_DTOR_EXPR. (finish_object_call_expr): Simplify handling during templates. (finish_pseudo_destructor_call_expr): Rename to ... (finish_pseudo_dtor_expr): ... this. (finish_compound_literal): New function. (begin_inline_definitions): Remove. (finish_sizeof): Remove special template handling. * spew.c: Do not include parse.h. * tree.c (get_overloaded_fn): Remove. * typeck.c (build_class_member_access_expr): Handle PSEUDO_DTOR_EXPR. Adjust handling of static member functions. (lookup_destructor): New function. (finish_class_member_access_expr): Use it. (convert_arguments): Simplify. (build_unary_op): Handle BASELINKs. From-SVN: r60560
2002-12-16Merge basic-improvements-branch to trunkZack Weinberg1-0/+2
From-SVN: r60174
2002-12-05* error.c (dump_expr): Fix format specifier warning.Kaveh R. Ghazi1-1/+2
From-SVN: r59867
2002-12-04re PR c++/8799 (ICE: Error reporting routines re-entered.)Gabriel Dos Reis1-0/+3
PR C++/8799 * error.c (dump_expr): Don't ever try to dump a non-existent expression. From-SVN: r59814