[C++ PATCH] overloaded operator fns [1/N]
commitef8f6502f0189587f03dc31b55fe1b54ec48cda8
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Oct 2017 12:50:19 +0000 (31 12:50 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Oct 2017 12:50:19 +0000 (31 12:50 +0000)
treef744b2bf587a0a0316bd56618e284cc04aa509f4
parent7a5024dcd3f8c7a6211f5226f538088ee6126dbc
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254263 138bc75d-0d04-0410-961f-82ee72b054a4
14 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/dump.c
gcc/cp/lambda.c
gcc/cp/mangle.c
gcc/cp/method.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cp/typeck.c