Commit Graph

20 Commits

Author SHA1 Message Date
Steve Ellcey
b52dbbf865 re PR c++/28288 (ICE with min/max operator)
PR c++/28288
	PR c++/14556
	* operators.def: Remove <?, ?>, <?=, and >?= operators.
	* parser.c: Remove CPP_MIN, CPP_MAX, CPP_MIN_EQ, and CPP_MAX_EQ.
	(cp_parser_warn_min_max): Remove.
	* include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
	(CPP_LAST_EQ): Change.
	(CPP_LAST_PUNCTUATOR): Change.
	* expr.c (cpp_operator): Remove MIN and MAX.
	(reduce): Remove CPP_MIN and CPP_MAX.
	(num_binary_op): Ditto.
	* lex.c (_cpp_lex_direct): Ditto.
	(cpp_avoid_paste): Remove ? as legal symbol after > or <.

From-SVN: r116140
2006-08-14 23:13:54 +00:00
Kelley Cook
1788952fea Update FSF address.
From-SVN: r101312
2005-06-25 00:59:41 +00:00
Mike Stump
c8094d835f Remove extra white spacing at end of lines.
From-SVN: r100952
2005-06-14 20:01:59 +00:00
Kazu Hirata
2a8a8f8fc2 * operators.def, optimize.c: Update copyright.
From-SVN: r100363
2005-05-30 15:44:28 +00:00
Roger Sayle
392e3d5102 cp-tree.def (UNARY_PLUS_EXPR): New C++ unary tree code.
* cp-tree.def (UNARY_PLUS_EXPR): New C++ unary tree code.
	* 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.

Co-Authored-By: Giovanni Bajo <giovannibajo@gcc.gnu.org>

From-SVN: r100285
2005-05-27 23:17:21 +00:00
Nathanael Nerode
e05f79742f re PR c++/11437 (ICE in lookup_name_real)
PR c++/11437
	* operators.def: Add definitions for __imag__, __real__.

From-SVN: r69254
2003-07-11 23:01:53 +00:00
Kaveh R. Ghazi
de94b46c5c gengtype-lex.l (IWORD): Add CHAR_BITFIELD.
gcc:
	* gengtype-lex.l (IWORD): Add CHAR_BITFIELD.
	* system.h (CHAR_BITFIELD): New.
cp:
	* operators.def (DEF_SIMPLE_OPERATOR, DEF_ASSN_OPERATOR,
	DEF_ASSN_OPERATOR): Delete spurious semi-colon.
	* rtti.c (dfs_class_hint_mark): Likewise.

	* decl.c (push_local_name, push_class_level_binding,
	maybe_inject_for_scope_var): Don't use POP_TIMEVAR_AND_RETURN in
	functions returning void.
	* decl2.c (add_using_namespace): Likewise.

	* decl.c (print_binding_level, print_other_binding_stack,
	print_binding_stack): Cast argument of %p specifier to void*.
	* ptree.c (cxx_print_decl): Likewise.

	* cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
	VAR_FUNCTION_OR_PARM_DECL_CHECK,
	VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
	BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK, LANG_TYPE_CLASS_CHECK,
	LANG_TYPE_PTRMEM_CHECK, LANG_DECL_U2_CHECK): Add __extension__.

	* decl.c (set_current_binding_level): New macro.  Use throughout
	when setting the current binding level.

	* cp-tree.h (cp_lvalue_kind, base_access): Delete trailing comma
	in enum.
	* method.c (mangling_flags): Likewise.

	* cp-tree.h (lang_type_header): Add __extension__ and use
	CHAR_BITFIELD for members.

From-SVN: r65201
2003-04-03 15:42:16 +00:00
Mark Mitchell
b80f8ef302 re PR c++/7129 (ICE with min/max assignment operators (<?= and >?=))
PR c++/7129
	* call.c (z_candidate): Add args.
	(convert_class_to_reference): Set it.
	(implicit_conversion): Tidy.
	(add_candidate): Add args parameter.
	(add_function_candidate): Adjust call to add_candidate.
	(add_conv_candidate): Likewise.
	(build_builtin_candidate): Likewise.
	(build_user_type_conversion_1): Eliminate wasteful tree_cons
	usage.
	(build_new_function_call): Likewise.
	(build_object_call): Likewise.
	(add_candidates): New function.
	(build_new_op): Use it.
	(covert_like_real): Adjust call to build_over_call.
	(build_over_call): Remove args parameter.
	* operators.def: Add <?= and >?=.

	PR c++/7129
	* testsuite/g++.dg/ext/max.C: New test.

From-SVN: r62370
2003-02-04 07:23:14 +00:00
Nathanael Nerode
b599b13591 config-lang.in, [...]: GCC, not GNU CC.
* config-lang.in, Make-lang.in, operators.def, cp-tree.def:
	GCC, not GNU CC.

From-SVN: r60638
2002-12-30 18:06:39 +00:00
Kazu Hirata
838dfd8a4e ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.2: Likewise.
	* call.c: Likewise.
	* class.c: Likewise.
	* cp-tree.h: Likewise.
	* cvt.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* except.c: Likewise.
	* friend.c: Likewise.
	* g++spec.c: Likewise.
	* init.c: Likewise.
	* lex.c: Likewise.
	* mangle.c: Likewise.
	* method.c: Likewise.
	* operators.def: Likewise.
	* optimize.c: Likewise.
	* pt.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.
	* semantics.c: Likewise.
	* spew.c: Likewise.
	* tree.c: Likewise.
	* typeck.c: Likewise.

From-SVN: r57387
2002-09-21 12:51:56 +00:00
Mark Mitchell
5d69ba1faa re PR c++/7112 (Regression: ICE on C++ code involving templates and sizeof)
PR c++/7112
	* g++.dg/template/sizeof2.C: New test.

	PR c++/7112
	* mangle.c (write_expression): Add mangling for sizeof when
	applied to a type.
	* operators.def: Remove stale comment.

	* cp-demangle.c (demangle_operator_name): Add type_arg parameter.
	Set it for the "st" operator.
	(demangle_expression): Handle expressions with types as arguments.

From-SVN: r55169
2002-07-02 03:19:22 +00:00
Joseph Myers
aba649ba4d ChangeLog.1, [...]: Fix spelling errors.
* ChangeLog.1, ChangeLog.2, ChangeLog, NEWS, call.c, class.c,
	cp-tree.h, decl.c, decl2.c, except.c, operators.def, optimize.c,
	pt.c, rtti.c, semantics.c, typeck.c: Fix spelling errors.

From-SVN: r48072
2001-12-16 16:07:01 +00:00
Kriang Lerdsuwanakij
873ff98777 mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR.
* mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR,
	CONST_CAST_EXPR.
	* operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR.

From-SVN: r47135
2001-11-18 06:24:45 +00:00
Mark Mitchell
0c918ce59c cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove.
* cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove.
	(OPERATOR_FORMAT): Likewise.
	(OPERATOR_TYPENAME_FORMAT): Likewise.
	* operators.def: Remove old name-mangling information.
	* decl.c (grok_op_properties): Adjust accordingly.
	* lex.c (init_operators): Likewise.
	* rtti.c (get_tinfo_decl): Issue error messages about types that
	have variable size.

From-SVN: r41076
2001-04-04 04:45:23 +00:00
Mark Mitchell
1b84dc3709 operators.def (ALIGNOF_EXPR, [...]): Change new ABI mangling.
* operators.def (ALIGNOF_EXPR, MAX_EXPR, MIN_EXPR): Change
	new ABI mangling.

From-SVN: r36125
2000-09-04 03:22:54 +00:00
Jason Merrill
669ec2b4f0 revert mangling patch
From-SVN: r34471
2000-06-09 12:26:24 -04:00
Mark Mitchell
657c130a99 invoke.texi: Remove documentation for -fsquangle and -fname-mangling-version.
* invoke.texi: Remove documentation for -fsquangle and
	-fname-mangling-version.

	Remove old ABI mangling code.
	* cp-tree.h (cp_tree_index): Remove CPTI_TINFO_DECL_ID and
	CPTI_TINFO_VAR_ID.
	(tinfo_decl_id): Remove.
	(tinfo_var_id): Likewise.
	(name_mangling_version): Likewise.
	(flag_do_squangling): Likewise.
	(get_vtt_name): Likewise.
	(init_method): Likewise.
	(build_overload_name): Likewise.
	(build_static_name): Likewise.
	(build_decl_overload_real): Likewise.
	(build_overload_with_type): Likewise.
	(build_destructor_name): Likewise.
	(get_id_2): Likewise.
	(get_ctor_vtbl_name): Likewise.
	(mangle_typeinfo_fn_for_type): New function.
	(mangle_java_reflection_var_for_type): Likewise.
	* call.c (build_new_method_call): Use mangle_vtt_for_type.
	* class.c (get_vtable_name): Remove.
	(get_vtt_name): Remove.
	(get_vtable_decl): Use mangle_vtbl_for_type.
	(build_vtt): Likewise.
	(build_ctor_vtbl_group): Remove old ABI mangling support.
	* decl.c (pushtag): Likewise.
	(maybe_commonize_var): Use set_mangled_name_for_decl.
	(grokfndecl): Remove old ABI mangling support.
	(grokvardecl): Likewise.
	(grokdeclarator): Likewise.
	(grok_op_properties): Adjust use of DEF_OPERATOR.
	* decl2.c (name_mangling_version): Remove.
	(lang_f_options): Remove squangle.
	(unsupported_options): Add squangle.
	(lang_decode_options): Don't set flag_do_squangling.  Issue a
	warning for -fname-mangling-version.
	(grokclassfn): Remove old ABI mangling support.
	(finish_static_data_member_decl): Likewise.
	(grokfield): Likewise.
	(grokoptypename): Likewise.
	(get_sentry): Likewise.
	* init.c (build_java_class_ref): Use
	mangle_java_reflection_var_for_type.
	* lex.c (init_operators): Adjust use of DEF_OPERATOR.
	(init_parse): Call init_mangle, not init_method.
	* mangle.c (write_special_name_constructor): Handle
	maybe-in-charge constructors.
	(write_special_name_destructor): Handle
	maybe-in-charge destructors.
	(write_expression): Tweak code to handle non-type template
	arguments with reference type.
	(mangle_typeinfo_fn_for_type): New function.
	(mangle_java_reflection_var_for_type): Likewise.
	(mangle_conv_op_name_for_type): Don't use a name that the user
	could type.
	* method.c (enum mangling_flags): Remove.
	(mangling_flags): Likewise.
	(obstack_chunk_alloc): Likewise.
	(obstack_chunk_free): Likewise.
	(OB_INIT): Likewise.
	(OB_PUTC): Likewise.
	(OB_PUTC2): Likewise.
	(OB_PUTS): Likewise.
	(OB_PUTID): Likewise.
	(OB_PUTCP): Likewise.
	(OB_FINISH): Likewise.
	(OB_LAST): Likewise.
	(btypelist): Likewise.
	(ktypelist): Likewise.
	(maxbtype): Likewise.
	(maxktype): Likewise.
	(typevec): Likewise.
	(maxtype): Likewise.
	(init_method): Likewise.
	(digit_buffer): Likewise.
	(nofold): Likewise.
	(start_squangling): Likewise.
	(end_squangling): Likewise.
	(icat): Likewise.
	(dicat): Likewise.
	(old_backref_index): Likewise.
	(flush_repeats): Likewise.
	(is_back_referenceable_type): Likewise.
	(issue_nrepeats): Likewise.
	(check_ktype): Likewise.
	(issue_ktype): Likewise.
	(build_overload_nested_name): Likewise.
	(build_underscore_int): Likewise.
	(build_overload_scope_ref): Likewise.
	(mangle_expression): Likewise.
	(build_overload_int): Likewise.
	(mangled_C9x_name): Likewise.
	(build_overload_value): Likewise.
	(build_template_template_parm_names): Likewise.
	(build_template_parm_names): Likewise.
	(build_overload_identifier): Likewise.
	(build_qualified_name): Likewise.
	(build_mangled_name_for_type_with_Gcode): Likewise.
	(build_mangled_name_for_type): Likewise.
	(build_overload_name): Likewise.
	(build_mangled_name): Likewise.
	(process_modifiers): Likewise.
	(check_btype): Likewise.
	(process_overload_item): Likewise.
	(build_static_name): Likewise.
	(build_decl_overload_real): Likewise.
	(set_mangled_name_for_decl): Remove old ABI mangling support.
	(build_typename_overload): Remove.
	(build_overload_with_type): Remove.
	(get_id_2): Remove.
	(get_ctor_vtbl_name): Remove.
	(build_destructor_name): Likewise.
	(set_mangled_name_for_decl): Likewise.
	(make_thunk): Remove old ABI mangling support.
	* operators.def: Likewise.
	* pt.c (check_explicit_specialization): Don't call
	set_mangled_name_for_template_decl.
	(lookup_template_class): Remove old ABI mangling support.
	(tsubst_friend_function): Update comment.
	(tsubst_decl): Remove old ABI mangling support.
	(tsubst_copy): Likewise.
	(set_mangled_name_for_template_decl): Remove.
	* rtti.c (init_rtti_processing): Use std_identifier.  Don't set
	tinfo_decl_id or tinfo_var_id.
	(get_tinfo_var): Use mangle_typeinfo_for_type.
	(tinfo_name): Remove old ABI mangling support.
	(get_tinfo_decl): Likewise.
	(tinfo_base_init): Likewise.
	(create_real_tinfo_var): Use a name that the user can't type.

	* tinfo2.cc (BUILTIN): Adjust to use new mangling.

From-SVN: r34458
2000-06-08 17:34:33 +00:00
Alex Samuel
1f6e1acc0f Make-lang.in (CXX_SRCS): Add mangle.c.
* Make-lang.in (CXX_SRCS): Add mangle.c.
	* Makefile.in (CXX_OBJS): Add mangle.o.
	(mangle.o): New rule.

Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r34394
2000-06-04 21:12:27 +00:00
Alexandre Oliva
9193780a0e operators.def (<?): Duplicated, should have been...
* operators.def (<?): Duplicated, should have been...
(>?): this.  Fixed.

From-SVN: r34232
2000-05-28 13:24:58 +00:00
Alex Samuel
596ea4e574 cp-tree.h (ansi_opname): Make it a macro.
2000-05-27  Alex Samuel    <samuel@codesourcery.com>
	    Mark Mitchell  <mark@codesourcery.com>

	* cp-tree.h (ansi_opname): Make it a macro.
	(ansi_assopname): Likewise.
	(struct lang_decl_flags): Add assignment_operator_p.
	(struct lang_decl): Add operator_code.
	(DECL_VTT_PARM): Adjust.
	(DECL_OVERLOADED_OPERATOR_P): Return the operator_code for an
	overloaded operator.
	(SET_OVERLOADED_OPERATOR_CODE): New macro.
	(DECL_ASSIGNMENT_OPERATOR_P): New macro.
	(DECL_ARRAY_DELETE_OPERATOR_P): Adjust.
	(opname_tab): Remove.
	(assignop_tab): Likewise.
	(operator_name_info_t): New type.
	(operator_name_info): New variable.
	(assignment_operator_name_info): Likewise.
	(build_cp_library_fn): Remove declaration.
	(push_cp_library_fn): Likewise.
	(operator_name_string): Likewise.
	(build_decl_overload): Likewise.
	* call.c (print_z_candidates): Simplify.
	(build_object_call): Adjust usage of ansi_opname.  Use
	DECL_OVERLOADED_OPERATOR_P.
	(op_error): Adjust operator name lookup.
	(build_conditional_expr): Adjust usage of ansi_opname.
	(build_new_op): Likewise.
	(build_op_delete_call): Likewise.
	(build_over_call): Likewise.
	(joust): Use DECL_OVERLOADED_OPERATOR_P.
	* decl.c (duplicate_decls): Copy operator_code.
	(init_decl_processing): Adjust parameters to push_cp_library_fn.
	(builtin_function): Adjust parameters to build_library_fn_1.
	(build_library_fn_1): Accept an overloaded operator code.
	(build_library_fn): Pass ERROR_MARK.
	(build_cp_library_fn): Accept an overloaded operator code.
	(push_cp_library_fn): Likewise.
	(grokfndecl): Tweak.
	(grokdeclarator): Simplify code to compute names of overloaded
	operators.  Adjust use of ansi_opname.
	(ambi_op_p): Work on tree_codes, not identifiers.
	(unary_op_p): Likewise.
	(grok_op_properties): Likewise.
	(start_function): Use DECL_OVERLOADED_OPERATOR_P.
	(lang_mark_tree): Don't try to mark the operator_code.
	* decl2.c (grok_function_init): Use DECL_OVERLOADED_OPERATOR_P.
	* error.c (dump_decl): Remove special handling for operator
	names.
	(dump_function_name): Likewise.
	(dump_expr): Adjust name lookup of operators.
	(op_to_string): Simplify.
	(assop_to_string): Likewise.
	* init.c (build_new_1): Adjust use of ansi_opname.
	* lex.c (opname_tab): Remove.
	(assignop_tab): Likewise.
	(ansi_opname): Likewise.
	(ansi_assopname): Likewise.
	(operator_name_string): Likewise.
	(reinit_lang_specific): Likewise.
	(operator_name_info): New variable.
	(assignment_operator_name_info): Likewise.
	(init_operators): New function.
	(init_parse): Use it.
	(do_identifier): Adjust use of ansi_opname.
	* method.c (mangle_expression): Don't use ansi_opname for
	mangling.
	(build_decl_overload_real): Use DECL_OVERLOADED_OPERATOR_P.
	(build_decl_overload): Remove.
	(build_typename_overload): Use OPERATOR_TYPENAME_FORMAT directly.
	(do_build_assign_ref): Adjust use of ansi_opname.
	(synthesize_method): Likewise.
	(implicitly_declare_fn): Likewise.
	* operators.def: New file.
	* parse.y (operator): Adjust use of ansi_opname.
	* pt.c (tsubst_decl): Use IDENTIFIER_OPNAME_P.
	(set_mangled_name_for_template_decl): Don't play games with
	current_namespace.
	(special_function_p): Adjust use of ansi_opname.
	* typeck.c (check_return_expr): Likewise.
	* Make-lang.in (cc1plus): Depend on operators.def.
	* Makefile.in (lex.o): Likewise.
	(decl.o): Likewise.

Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r34223
2000-05-28 02:58:19 +00:00