aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-10-31 14:39:44 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-10-31 14:39:44 +0000
commit88a819bee1d2286c8b8c742aa8ac79eda8a9c204 (patch)
treedc1df4321c6847d88a2b11efff77e2d138f03f45 /gcc/cp/parser.c
parentf6a35e8954606007940045101284fbd7c251ed76 (diff)
downloadgcc-88a819bee1d2286c8b8c742aa8ac79eda8a9c204.zip
gcc-88a819bee1d2286c8b8c742aa8ac79eda8a9c204.tar.gz
gcc-88a819bee1d2286c8b8c742aa8ac79eda8a9c204.tar.bz2
[C++ PATCH] overloaded operator fns [2/N]
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg02326.html gcc/cp/ * cp-tree.h (ovl_op_identifier): New. (assign_op_identifier, call_op_identifier): Adjust. (cp_operator_id, cp_assignment_operator_ide): Delete. (SET_OVERLOADED_OPERATOR_CODE): Delete. (OVL_OP_INFO): New. * call.c (op_error): Use OVL_OP_INFO. (build_conditional_expr_1): Use ovl_op_identifier. (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier. (build_op_delete_call): Likewise. * class.c (type_requires_array_cookie): Use ovl_op_identifier. * decl.c (duplicate_decls): Directly copy operator code. (builtin_function_1): Do not set operator code. (build_library_fn): Directly set operator code. (push_cp_library_fn): Use ovl_op_identifier. (grok_op_properties): Directly set operator code. * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier. * error.c (dump_expr): Use OVL_OP_INFO. (op_to_string): Add assop arg. Use OVL_OP_INFO. (assop_to_string): Delete. (args_to_string): Adjust. * init.c (build_new_1): Use ovl_op_identifier. * mangle.c (write_unqualified_name): Use OVL_OP_INFO. (write_expression): Likewise. * method.c (synthesized_method_walk): Use ovl_op_identifier. (implicitly_declare_fn): Use assign_op_identifier. Directly set operator code. * name-lookup.c (get_class_binding): Use assign_op_identifier. * parser.c (cp_parser_operator): Use ovl_op_identifier. (cp_parser_omp_clause_reduction): Likewise. * semantics.c (omp_reduction_id): Likewise. * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO. libcc1/ * libcp1plugin.cc (plugin_build_decl): Use ovl_op_identifier. Directly set operator code. (plugin_build_dependent_expr): Use ovl_op_identifier. From-SVN: r254267
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index a536b808..bcaefde 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -15006,7 +15006,7 @@ cp_parser_operator (cp_parser* parser)
operator token. */
if (op != ERROR_MARK)
{
- id = assop ? cp_assignment_operator_id (op) : cp_operator_id (op);
+ id = ovl_op_identifier (assop, op);
if (!consumed)
cp_lexer_consume_token (parser->lexer);
}
@@ -32588,21 +32588,21 @@ cp_parser_omp_clause_reduction (cp_parser *parser, tree list)
code = MIN_EXPR;
else if (strcmp (p, "max") == 0)
code = MAX_EXPR;
- else if (id == cp_operator_id (PLUS_EXPR))
+ else if (id == ovl_op_identifier (false, PLUS_EXPR))
code = PLUS_EXPR;
- else if (id == cp_operator_id (MULT_EXPR))
+ else if (id == ovl_op_identifier (false, MULT_EXPR))
code = MULT_EXPR;
- else if (id == cp_operator_id (MINUS_EXPR))
+ else if (id == ovl_op_identifier (false, MINUS_EXPR))
code = MINUS_EXPR;
- else if (id == cp_operator_id (BIT_AND_EXPR))
+ else if (id == ovl_op_identifier (false, BIT_AND_EXPR))
code = BIT_AND_EXPR;
- else if (id == cp_operator_id (BIT_IOR_EXPR))
+ else if (id == ovl_op_identifier (false, BIT_IOR_EXPR))
code = BIT_IOR_EXPR;
- else if (id == cp_operator_id (BIT_XOR_EXPR))
+ else if (id == ovl_op_identifier (false, BIT_XOR_EXPR))
code = BIT_XOR_EXPR;
- else if (id == cp_operator_id (TRUTH_ANDIF_EXPR))
+ else if (id == ovl_op_identifier (false, TRUTH_ANDIF_EXPR))
code = TRUTH_ANDIF_EXPR;
- else if (id == cp_operator_id (TRUTH_ORIF_EXPR))
+ else if (id == ovl_op_identifier (false, TRUTH_ORIF_EXPR))
code = TRUTH_ORIF_EXPR;
id = omp_reduction_id (code, id, NULL_TREE);
tree scope = parser->scope;