From 2575281f7bf20899702b79ad20edd50abb9d75e1 Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 16 Apr 2015 20:57:46 +0000 Subject: [PATCH] 2015-04-16 Paolo Carlini * class.c (resolve_address_of_overloaded_function, instantiate_type): Rename tsubst_flags_t parameter flags -> complain. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222159 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/class.c | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 65b5ed9792b..b3feab14b09 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2015-04-16 Paolo Carlini + * class.c (resolve_address_of_overloaded_function, instantiate_type): + Rename tsubst_flags_t parameter flags -> complain. + +2015-04-16 Paolo Carlini + * call.c (build_op_delete_call, build_over_call): Check mark_used return value. * class.c (resolve_address_of_overloaded_function): Likewise. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index fde51c5753d..d80d312e7d2 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -7471,7 +7471,7 @@ pop_lang_context (void) static tree resolve_address_of_overloaded_function (tree target_type, tree overload, - tsubst_flags_t flags, + tsubst_flags_t complain, bool template_only, tree explicit_targs, tree access_path) @@ -7531,7 +7531,7 @@ resolve_address_of_overloaded_function (tree target_type, target_type = build_reference_type (target_type); else { - if (flags & tf_error) + if (complain & tf_error) error ("cannot resolve overloaded function %qD based on" " conversion to type %qT", DECL_NAME (OVL_FUNCTION (overload)), target_type); @@ -7667,7 +7667,7 @@ resolve_address_of_overloaded_function (tree target_type, if (matches == NULL_TREE) { /* There were *no* matches. */ - if (flags & tf_error) + if (complain & tf_error) { error ("no matches converting function %qD to type %q#T", DECL_NAME (OVL_CURRENT (overload)), @@ -7695,7 +7695,7 @@ resolve_address_of_overloaded_function (tree target_type, if (match) { - if (flags & tf_error) + if (complain & tf_error) { error ("converting overloaded function %qD to type %q#T is ambiguous", DECL_NAME (OVL_FUNCTION (overload)), @@ -7717,11 +7717,11 @@ resolve_address_of_overloaded_function (tree target_type, fn = TREE_PURPOSE (matches); if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn) - && !(flags & tf_ptrmem_ok) && !flag_ms_extensions) + && !(complain & tf_ptrmem_ok) && !flag_ms_extensions) { static int explained; - if (!(flags & tf_error)) + if (!(complain & tf_error)) return error_mark_node; permerror (input_location, "assuming pointer to member %qD", fn); @@ -7742,7 +7742,7 @@ resolve_address_of_overloaded_function (tree target_type, if (fn == NULL) return error_mark_node; /* Mark all the versions corresponding to the dispatcher as used. */ - if (!(flags & tf_conv)) + if (!(complain & tf_conv)) mark_versions_used (fn); } @@ -7750,12 +7750,12 @@ resolve_address_of_overloaded_function (tree target_type, determining conversion sequences, we should not consider the function used. If this conversion sequence is selected, the function will be marked as used at this point. */ - if (!(flags & tf_conv)) + if (!(complain & tf_conv)) { /* Make =delete work with SFINAE. */ - if (DECL_DELETED_FN (fn) && !(flags & tf_error)) + if (DECL_DELETED_FN (fn) && !(complain & tf_error)) return error_mark_node; - if (!mark_used (fn, flags) && !(flags & tf_error)) + if (!mark_used (fn, complain) && !(complain & tf_error)) return error_mark_node; } @@ -7765,11 +7765,11 @@ resolve_address_of_overloaded_function (tree target_type, if (DECL_FUNCTION_MEMBER_P (fn)) { gcc_assert (access_path); - perform_or_defer_access_check (access_path, fn, fn, flags); + perform_or_defer_access_check (access_path, fn, fn, complain); } if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type)) - return cp_build_addr_expr (fn, flags); + return cp_build_addr_expr (fn, complain); else { /* The target must be a REFERENCE_TYPE. Above, cp_build_unary_op @@ -7783,7 +7783,7 @@ resolve_address_of_overloaded_function (tree target_type, /* This function will instantiate the type of the expression given in RHS to match the type of LHSTYPE. If errors exist, then return - error_mark_node. FLAGS is a bit mask. If TF_ERROR is set, then + error_mark_node. COMPLAIN is a bit mask. If TF_ERROR is set, then we complain on errors. If we are not complaining, never modify rhs, as overload resolution wants to try many possible instantiations, in the hope that at least one will work. @@ -7792,16 +7792,16 @@ resolve_address_of_overloaded_function (tree target_type, function, or a pointer to member function. */ tree -instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) +instantiate_type (tree lhstype, tree rhs, tsubst_flags_t complain) { - tsubst_flags_t flags_in = flags; + tsubst_flags_t complain_in = complain; tree access_path = NULL_TREE; - flags &= ~tf_ptrmem_ok; + complain &= ~tf_ptrmem_ok; if (lhstype == unknown_type_node) { - if (flags & tf_error) + if (complain & tf_error) error ("not enough type information"); return error_mark_node; } @@ -7819,7 +7819,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) ; else { - if (flags & tf_error) + if (complain & tf_error) error ("cannot convert %qE from type %qT to type %qT", rhs, TREE_TYPE (rhs), fntype); return error_mark_node; @@ -7836,7 +7836,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) deduce any type information. */ if (TREE_CODE (rhs) == NON_DEPENDENT_EXPR) { - if (flags & tf_error) + if (complain & tf_error) error ("not enough type information"); return error_mark_node; } @@ -7859,7 +7859,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) { tree member = TREE_OPERAND (rhs, 1); - member = instantiate_type (lhstype, member, flags); + member = instantiate_type (lhstype, member, complain); if (member != error_mark_node && TREE_SIDE_EFFECTS (TREE_OPERAND (rhs, 0))) /* Do not lose object's side effects. */ @@ -7871,7 +7871,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) case OFFSET_REF: rhs = TREE_OPERAND (rhs, 1); if (BASELINK_P (rhs)) - return instantiate_type (lhstype, rhs, flags_in); + return instantiate_type (lhstype, rhs, complain_in); /* This can happen if we are forming a pointer-to-member for a member template. */ @@ -7885,7 +7885,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) tree args = TREE_OPERAND (rhs, 1); return - resolve_address_of_overloaded_function (lhstype, fns, flags_in, + resolve_address_of_overloaded_function (lhstype, fns, complain_in, /*template_only=*/true, args, access_path); } @@ -7893,7 +7893,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) case OVERLOAD: case FUNCTION_DECL: return - resolve_address_of_overloaded_function (lhstype, rhs, flags_in, + resolve_address_of_overloaded_function (lhstype, rhs, complain_in, /*template_only=*/false, /*explicit_targs=*/NULL_TREE, access_path); @@ -7901,9 +7901,9 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) case ADDR_EXPR: { if (PTRMEM_OK_P (rhs)) - flags |= tf_ptrmem_ok; + complain |= tf_ptrmem_ok; - return instantiate_type (lhstype, TREE_OPERAND (rhs, 0), flags); + return instantiate_type (lhstype, TREE_OPERAND (rhs, 0), complain); } case ERROR_MARK: -- 2.11.4.GIT