diff options
author | Jason Merrill <jason@redhat.com> | 2012-07-25 10:56:50 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-07-25 10:56:50 -0400 |
commit | 5e7b9f609af51eb9e5523f19e3faea764f634657 (patch) | |
tree | e9ed253664d23e4d70e616c3bceeb87407e461bd /gcc/cp | |
parent | 25a92d2f912c6b5a486bd7625d7e363617e20627 (diff) | |
download | gcc-5e7b9f609af51eb9e5523f19e3faea764f634657.zip gcc-5e7b9f609af51eb9e5523f19e3faea764f634657.tar.gz gcc-5e7b9f609af51eb9e5523f19e3faea764f634657.tar.bz2 |
cp-tree.h (tsubst_flags): Remove tf_no_access_control.
* cp-tree.h (tsubst_flags): Remove tf_no_access_control.
* call.c (standard_conversion): Don't set it.
* class.c (resolve_address_of_overloaded_function): Don't check it.
* decl.c (check_default_argument): Call
perform_implicit_conversion_flags.
From-SVN: r189850
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/call.c | 2 | ||||
-rw-r--r-- | gcc/cp/class.c | 11 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 15 |
5 files changed, 12 insertions, 24 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e9c6cff..e7b4711 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2012-07-25 Jason Merrill <jason@redhat.com> + * cp-tree.h (tsubst_flags): Remove tf_no_access_control. + * call.c (standard_conversion): Don't set it. + * class.c (resolve_address_of_overloaded_function): Don't check it. + * decl.c (check_default_argument): Call + perform_implicit_conversion_flags. + * pt.c (print_candidates_1): Use inform instead of error. 2012-07-24 Paolo Carlini <paolo.carlini@oracle.com> diff --git a/gcc/cp/call.c b/gcc/cp/call.c index cf50e88..5345f2b 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1095,8 +1095,6 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p, && expr && type_unknown_p (expr)) { tsubst_flags_t tflags = tf_conv; - if (!(flags & LOOKUP_PROTECT)) - tflags |= tf_no_access_control; expr = instantiate_type (to, expr, tflags); if (expr == error_mark_node) return NULL; diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 7ccbccb..2f377c8 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -6878,9 +6878,8 @@ pop_lang_context (void) If OVERLOAD is for one or more member functions, then ACCESS_PATH is the base path used to reference those member functions. If - TF_NO_ACCESS_CONTROL is not set in FLAGS, and the address is - resolved to a member function, access checks will be performed and - errors issued if appropriate. */ + the address is resolved to a member function, access checks will be + performed and errors issued if appropriate. */ static tree resolve_address_of_overloaded_function (tree target_type, @@ -7143,12 +7142,10 @@ resolve_address_of_overloaded_function (tree target_type, /* We could not check access to member functions when this expression was originally created since we did not know at that time to which function the expression referred. */ - if (!(flags & tf_no_access_control) - && DECL_FUNCTION_MEMBER_P (fn)) + if (DECL_FUNCTION_MEMBER_P (fn)) { gcc_assert (access_path); - perform_or_defer_access_check (access_path, fn, fn, - tf_warning_or_error); + perform_or_defer_access_check (access_path, fn, fn, flags); } if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type)) diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f1a4b32..3c1a7bf 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4170,8 +4170,6 @@ enum tsubst_flags { conversion might be permissible, not actually performing the conversion. */ - tf_no_access_control = 1 << 7, /* Do not perform access checks, even - when issuing other errors. */ tf_partial = 1 << 8, /* Doing initial explicit argument substitution in fn_type_unification. */ /* Convenient substitution flags combinations. */ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 605058d..c37787b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10602,19 +10602,8 @@ check_default_argument (tree decl, tree arg) A default argument expression is implicitly converted to the parameter type. */ - if (!TREE_TYPE (arg) - || !can_convert_arg (decl_type, TREE_TYPE (arg), arg, LOOKUP_NORMAL, - tf_warning_or_error)) - { - if (decl) - error ("default argument for %q#D has type %qT", - decl, TREE_TYPE (arg)); - else - error ("default argument for parameter of type %qT has type %qT", - decl_type, TREE_TYPE (arg)); - - return error_mark_node; - } + perform_implicit_conversion_flags (decl_type, arg, tf_warning_or_error, + LOOKUP_NORMAL); if (warn_zero_as_null_pointer_constant && c_inhibit_evaluation_warnings == 0 |