summaryrefslogtreecommitdiff
path: root/gcc/cp/operators.def
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright years.jakub2015-01-051-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219188 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright years in gcc/rsandifo2014-01-021-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206289 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright years in gcc/rsandifo2013-01-101-2/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195098 138bc75d-0d04-0410-961f-82ee72b054a4
* Update Copyright years for files modified in 2011 and/or 2012.jakub2013-01-041-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194903 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/6057jason2012-01-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/48051 PR c++/50855 PR c++/51322 gcc/cp/ * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR, THROW_EXPR, CONSTRUCTOR, OVERLOAD. Fix PREINCREMENT_EXPR and PREDECREMENT_EXPR. (write_template_arg): Fix mangling of class-scope functions and argument packs. (mangle_decl): Update suggested -fabi-version argument. * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR, DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR. * tree.c (dependent_name): No longer static. * cp-tree.h: Declare it. * pt.c (unify): Defer handling of unconverted functions. include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_INITIALIZER_LIST, DEMANGLE_COMPONENT_NULLARY. libiberty/ * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_NULLARY and DEMANGLE_COMPONENT_INITIALIZER_LIST. (d_make_comp): Likewise. Allow null right arg for DEMANGLE_COMPONENT_TRINARY_ARG2. (cplus_demangle_operators): Adjust new/delete; add .*, :: and throw. (d_template_args, d_template_arg): Handle 'J' for argument packs. (d_exprlist): Add terminator parm. (d_expression, d_print_comp): Handle initializer lists, nullary expressions, prefix/suffix operators, and new. (d_print_subexpr): Avoid parens around DEMANGLE_COMPONENT_QUAL_NAME and DEMANGLE_COMPONENT_INITIALIZER_LIST. * testsuite/demangle-expected: Add tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182970 138bc75d-0d04-0410-961f-82ee72b054a4
* cp/:jason2009-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * decl.c (grokfndecl): Set DECL_CONTEXT on parms. (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms. * pt.c (check_explicit_specialization): Likewise. (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a local specialization. * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name. * decl2.c (parm_index): New fn. * semantics.c (finish_decltype_type): Don't use describable_type. * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR. Give a sorry for unsupported codes rather than crash. Mangle conversions with other than 1 operand. New mangling for PARM_DECL. * operators.def (ALIGNOF_EXPR): Mangle as az. * include/demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_FUNCTION_PARAM. * libiberty/cp-demangle.c (d_make_function_param): new fn. (cplus_demangle_mangled_name): Work around abi v2 bug. (d_expr_primary): Likewise. (cplus_demangle_operators): Add alignof ops. (d_expression): Handle function parameters and conversions with other than 1 operand. (d_print_comp): Handle function parameters. Fix bug with function used in type of function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144924 138bc75d-0d04-0410-961f-82ee72b054a4
* Update Copyright years for files modified in 2008 and/or 2009.jakub2009-02-201-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144324 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/39095jakub2009-02-041-2/+1
| | | | | | | | | | | | | * operators.def: Use COMPONENT_REF code for ->/pt operator again, remove ./dt operator. * mangle.c (write_expression): Handle COMPONENT_REF after handling ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it write_string ("dt") instead of using operators.def. * g++.dg/abi/mangle31.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143933 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/cp/:jason2008-10-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/37376, other mangling issues * mangle.c (write_type): Update TYPE_PACK_EXPANSION mangling. (write_member_name): Break out from... (write_expression): ...here. Handle dependent COMPONENT_REF. (write_template_arg): Wrap an argument pack in 'I'/'E'. (write_builtin_type): Update char16/32_t mangling. (write_nested_name, write_prefix): Don't forget template args for typename types. * operators.def: Add ARROW_EXPR, update COMPONENT_REF and EXPR_PACK_EXPANSION. libstdc++-v3/: * config/abi/pre/gnu.ver: Update char16/32_t manglings. include/: * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_PACK_EXPANSION. libiberty/: * cp-demangle.c (struct d_print_info): Add pack_index. (d_dump): Add DEMANGLE_COMPONENT_PACK_EXPANSION. (d_make_comp): Likewise. DEMANGLE_COMPONENT_ARGLIST and DEMANGLE_COMPONENT_TEMPLATE_ARGLIST can have two null args. (cplus_demangle_builtin_types): Add char16/32_t. (cplus_demangle_type): Recognize them. (d_template_args): Handle empty argument packs. (d_template_arg): Handle argument packs. (d_expression): Handle dependent name. (d_index_template_argument): New fn. (d_lookup_template_argument): New fn. (d_find_pack, d_pack_length): New fn. (d_print_subexpr): Split out... (d_print_comp): ...from here. Use d_*_template_argument. Handle empty arg lists. Support pack expansions. * cp-demangle.h (D_BUILTIN_TYPE_COUNT): Increase to 32. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140916 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/objc/rwild2008-07-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | * objc-act.c: Fix comment typos. gcc/cp/ * call.c: Fix comment typos. * class.c: Likewise. * cp-tree.h: Likewise. * cxx-pretty-print.c: Likewise. * decl.c: Likewise. * init.c: Likewise. * name-lookup.c: Likewise. * operators.def: Likewise. * parser.c: Likewise. * pt.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138042 138bc75d-0d04-0410-961f-82ee72b054a4
* * typeck.c: Change copyright header to refer to version 3 of the GNU General nickc2007-08-021-5/+5
| | | | | | | | | | | | | | | Public License and to point readers at the COPYING3 file and the FSF's license web page. * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, config-lang.in, cp-tree.def, call.c, decl.h, ptree.c, Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c, cp-objcp-common.h, except.c, error.c, operators.def, cvt.c, tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c, cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c, cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c, name-lookup.h, parser.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127154 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>dgregor2007-03-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122788 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/28288sje2006-08-141-6/+0
| | | | | | | | | | | | | | | | | | 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 <. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116140 138bc75d-0d04-0410-961f-82ee72b054a4
* Update FSF address.kcook2005-06-251-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101312 138bc75d-0d04-0410-961f-82ee72b054a4
* Remove extra white spacing at end of lines.mrs2005-06-141-6/+6
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100952 138bc75d-0d04-0410-961f-82ee72b054a4
* * operators.def, optimize.c: Update copyright.kazu2005-05-301-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100363 138bc75d-0d04-0410-961f-82ee72b054a4
* * cp-tree.def (UNARY_PLUS_EXPR): New C++ unary tree code.sayle2005-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * parser.c (cp_parser_unary_expression): Use UNARY_PLUS_EXPR instead of CONVERT_EXPR. (cp_parser_unary_expression): Likewise. * typeck.c (build_unary_op): Likewise. * call.c (add_builtin_candidate, build_new_op): Likewise. * error.c (dump_expr): Likewise. * pt.c (tsubst_copy, tsubst_copy_and_build): Likewise. * decl.c (ambi_op_p, grok_op_properties): Likewise. * dump.c (dump_op): Likewise. * lex.c (init_operators): Likewise. * operators.def ("+"): Likewise. * cp-gimplify.c (cp_gimplify_expr): Handle UNARY_PLUS_EXPR like a conversion, if the result and argument types differ. * tree.c (fold_if_not_in_template): Fold UNARY_PLUS_EXPR much like a NOP_EXPR when !processing_template_decl. * cxx-pretty-print.c (pp_cxx_cast_expression): Prototype. (pp_cxx_unary_expression): Handle new UNARY_PLUS_EXPR tree code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100285 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/11437neroden2003-07-111-1/+3
| | | | | | | * operators.def: Add definitions for __imag__, __real__. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69254 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc:ghazi2003-04-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65201 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/7129mmitchel2003-02-041-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62370 138bc75d-0d04-0410-961f-82ee72b054a4
* * config-lang.in, Make-lang.in, operators.def, cp-tree.def:neroden2002-12-301-5/+5
| | | | | | | GCC, not GNU CC. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60638 138bc75d-0d04-0410-961f-82ee72b054a4
* * ChangeLog: Follow spelling conventions.kazu2002-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57387 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/7112mmitchel2002-07-021-5/+1
| | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55169 138bc75d-0d04-0410-961f-82ee72b054a4
* * ChangeLog.1, ChangeLog.2, ChangeLog, NEWS, call.c, class.c,jsm282001-12-161-3/+3
| | | | | | | | cp-tree.h, decl.c, decl2.c, except.c, operators.def, optimize.c, pt.c, rtti.c, semantics.c, typeck.c: Fix spelling errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48072 138bc75d-0d04-0410-961f-82ee72b054a4
* * mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR,lerdsuwa2001-11-181-0/+3
| | | | | | | | CONST_CAST_EXPR. * operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47135 138bc75d-0d04-0410-961f-82ee72b054a4
* * cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove.mmitchel2001-04-041-60/+60
| | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41076 138bc75d-0d04-0410-961f-82ee72b054a4
* * operators.def (ALIGNOF_EXPR, MAX_EXPR, MIN_EXPR): Changemmitchel2000-09-041-3/+3
| | | | | | | new ABI mangling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36125 138bc75d-0d04-0410-961f-82ee72b054a4
* revert mangling patchjason2000-06-091-60/+64
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34471 138bc75d-0d04-0410-961f-82ee72b054a4
* * invoke.texi: Remove documentation for -fsquangle andmmitchel2000-06-081-64/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34458 138bc75d-0d04-0410-961f-82ee72b054a4
* * Make-lang.in (CXX_SRCS): Add mangle.c.mmitchel2000-06-041-3/+4
| | | | | | | | * Makefile.in (CXX_OBJS): Add mangle.o. (mangle.o): New rule. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34394 138bc75d-0d04-0410-961f-82ee72b054a4
* * operators.def (<?): Duplicated, should have been...aoliva2000-05-281-1/+1
| | | | | | | (>?): this. Fixed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34232 138bc75d-0d04-0410-961f-82ee72b054a4
* 2000-05-27 Alex Samuel <samuel@codesourcery.com>mmitchel2000-05-281-0/+153
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34223 138bc75d-0d04-0410-961f-82ee72b054a4