aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-10-31 12:50:19 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-10-31 12:50:19 +0000
commit137073d34a47fe14f97e35f69d3941b2ef0bb5c1 (patch)
treef744b2bf587a0a0316bd56618e284cc04aa509f4 /gcc/cp/tree.c
parent8a3f457f148b7114dfa37927b73410eecc986a33 (diff)
downloadgcc-137073d34a47fe14f97e35f69d3941b2ef0bb5c1.zip
gcc-137073d34a47fe14f97e35f69d3941b2ef0bb5c1.tar.gz
gcc-137073d34a47fe14f97e35f69d3941b2ef0bb5c1.tar.bz2
[C++ PATCH] overloaded operator fns [1/N]
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg02315.html * cp-tree.h (assign_op_identifier, call_op_identifier): Define. (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS. (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false. (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define. * call.c (add_function_candidate): Use DECL_OVERLOADED_OPERATOR_IS. (build_op_call_1): Use call_op_identifier & DECL_OVERLOADED_OPERATOR_IS. (build_over_call): Likewise. (has_trivial_copy_assign_p): Use assign_op_identifier. (build_special_member_call): Likewise. * class.c (dfs_declare_virt_assop_and_dtor): Likewise. (vbase_has_user_provided_move_assign, classtype_has_move_assign_or_move_ctor_p): Likewise. * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE. (grok_special_member_properties): Use assign_op_identifier. (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS. * decl2.c (mark_used): Use DECL_CONV_FN_P. * dump.c (dump_access): Delete prototype. (dump_op): Delete. (cp_dump_tree): Don't call it. * lambda.c (lambda_function): Use call_op_identifier. (maybe_add_lambda_conv_op): Not an overloaded operator. Remove unneeded braces. * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE. * method.c (do_build_copy_assign): Use assign_op_identifier. (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS. (get_copy_assign): Use assign_op_identifier. (synthesized_method_walk): Likewise. (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS. * parser.c (cp_parser_lambda_declarator_opt): Use call_op_identifier. * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use assign_op_identifier. * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS. * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE. (check_return_expr): Use assign_op_identifier. From-SVN: r254263
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 48d4094..b7d5f3d 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -4847,7 +4847,8 @@ special_function_p (const_tree decl)
return sfk_move_constructor;
if (DECL_CONSTRUCTOR_P (decl))
return sfk_constructor;
- if (DECL_OVERLOADED_OPERATOR_P (decl) == NOP_EXPR)
+ if (DECL_ASSIGNMENT_OPERATOR_P (decl)
+ && DECL_OVERLOADED_OPERATOR_IS (decl, NOP_EXPR))
{
if (copy_fn_p (decl))
return sfk_copy_assignment;