diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-27 11:57:01 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-27 11:57:01 +0000 |
commit | 8560c588b8e703a936e09b8b1c5381289b6fe2a8 (patch) | |
tree | 6551aaedcd3c7893355d5933f81fbb2dce9863de /gcc/cp | |
parent | c3986c7ab5d242067928f202cc5f7c661242ce2a (diff) | |
download | gcc-8560c588b8e703a936e09b8b1c5381289b6fe2a8.tar.gz |
2010-09-27 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 164647
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@164648 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 31 | ||||
-rw-r--r-- | gcc/cp/call.c | 19 | ||||
-rw-r--r-- | gcc/cp/decl.c | 18 | ||||
-rw-r--r-- | gcc/cp/error.c | 17 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 2 | ||||
-rw-r--r-- | gcc/cp/method.c | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 13 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 13 |
8 files changed, 91 insertions, 26 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c412f0c9ece..4b6eb74fe8d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,34 @@ +2010-09-24 Jan Hubicka <jh@suse.cz> + + * decl.c (finish_function): Use decl_replaceable_p + * method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias. + +2010-09-24 Jason Merrill <jason@redhat.com> + + * decl.c (compute_array_index_type): Remember type dependence of + array bound. + * pt.c (dependent_type_p_r): Don't recompute it here. + + * error.c (dump_expr) [CASE_CONVERT]: Print conversion between + reference and pointer to the same type as "*" or "&". + +2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com> + + * typeck.c (warn_args_num): Use warning 'too many arguments to + method [methodname]' for an Objective-C method instead of the less + satisfactory 'too many arguments to function' (with no method + name). + +2010-09-21 Jason Merrill <jason@redhat.com> + + * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1 + special handling if we know the member. + +2010-09-18 Jason Merrill <jason@redhat.com> + + * call.c (compare_ics): Do lvalue/rvalue reference binding + comparison for ck_list, too. + 2010-09-15 Jason Merrill <jason@redhat.com> * semantics.c (finish_id_expression): Diagnose use of function diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 2b9b848a730..89ab75723f4 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -6859,9 +6859,8 @@ compare_ics (conversion *ics1, conversion *ics2) /* We couldn't make up our minds; try to figure it out below. */ } - if (ics1->ellipsis_p || ics1->kind == ck_list) - /* Both conversions are ellipsis conversions or both are building a - std::initializer_list. */ + if (ics1->ellipsis_p) + /* Both conversions are ellipsis conversions. */ return 0; /* User-defined conversion sequence U1 is a better conversion sequence @@ -6870,16 +6869,24 @@ compare_ics (conversion *ics1, conversion *ics2) ond standard conversion sequence of U1 is better than the second standard conversion sequence of U2. */ - if (ics1->user_conv_p) + /* Handle list-conversion with the same code even though it isn't always + ranked as a user-defined conversion and it doesn't have a second + standard conversion sequence; it will still have the desired effect. + Specifically, we need to do the reference binding comparison at the + end of this function. */ + + if (ics1->user_conv_p || ics1->kind == ck_list) { conversion *t1; conversion *t2; for (t1 = ics1; t1->kind != ck_user; t1 = t1->u.next) - if (t1->kind == ck_ambig || t1->kind == ck_aggr) + if (t1->kind == ck_ambig || t1->kind == ck_aggr + || t1->kind == ck_list) break; for (t2 = ics2; t2->kind != ck_user; t2 = t2->u.next) - if (t2->kind == ck_ambig || t2->kind == ck_aggr) + if (t2->kind == ck_ambig || t2->kind == ck_aggr + || t2->kind == ck_list) break; if (t1->kind != t2->kind) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3d1420a23eb..07eddb551df 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -7402,11 +7402,15 @@ compute_array_index_type (tree name, tree size) type = TREE_TYPE (size); } + /* A type is dependent if it is...an array type constructed from any + dependent type or whose size is specified by a constant expression + that is value-dependent. */ /* We can only call value_dependent_expression_p on integral constant expressions; the parser adds a dummy NOP_EXPR with TREE_SIDE_EFFECTS set if this isn't one. */ if (processing_template_decl - && (TREE_SIDE_EFFECTS (size) || value_dependent_expression_p (size))) + && (dependent_type_p (type) + || TREE_SIDE_EFFECTS (size) || value_dependent_expression_p (size))) { /* We cannot do any checking for a SIZE that isn't known to be constant. Just build the index type and mark that it requires @@ -7532,10 +7536,16 @@ compute_array_index_type (tree name, tree size) { tree t = build_index_type (itype); TYPE_CANONICAL (abi_1_itype) = TYPE_CANONICAL (t); - return abi_1_itype; + itype = abi_1_itype; } else - return build_index_type (itype); + itype = build_index_type (itype); + + /* If the index type were dependent, we would have returned early, so + remember that it isn't. */ + TYPE_DEPENDENT_P (itype) = 0; + TYPE_DEPENDENT_P_VALID (itype) = 1; + return itype; } /* Returns the scope (if any) in which the entity declared by @@ -12664,7 +12674,7 @@ finish_function (int flags) if (!processing_template_decl && !cp_function_chain->can_throw && !flag_non_call_exceptions - && !DECL_REPLACEABLE_P (fndecl)) + && !decl_replaceable_p (fndecl)) TREE_NOTHROW (fndecl) = 1; /* This must come after expand_function_end because cleanups might diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 981b71f5452..be3dd2c9ad1 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1949,8 +1949,21 @@ dump_expr (tree t, int flags) case VIEW_CONVERT_EXPR: { tree op = TREE_OPERAND (t, 0); - - if (!same_type_p (TREE_TYPE (op), TREE_TYPE (t))) + tree ttype = TREE_TYPE (t); + tree optype = TREE_TYPE (op); + + if (TREE_CODE (ttype) != TREE_CODE (optype) + && POINTER_TYPE_P (ttype) + && POINTER_TYPE_P (optype) + && same_type_p (TREE_TYPE (optype), + TREE_TYPE (ttype))) + { + if (TREE_CODE (ttype) == REFERENCE_TYPE) + dump_unary_op ("*", t, flags); + else + dump_unary_op ("&", t, flags); + } + else if (!same_type_p (TREE_TYPE (op), TREE_TYPE (t))) { /* It is a cast, but we cannot tell whether it is a reinterpret or static cast. Use the C style notation. */ diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 03e28374810..39001c56a7d 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2491,7 +2491,7 @@ write_expression (tree expr) tree scope = TREE_OPERAND (expr, 0); tree member = TREE_OPERAND (expr, 1); - if (!abi_version_at_least (2)) + if (!abi_version_at_least (2) && DECL_P (member)) { write_string ("sr"); write_type (scope); diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 0ec38264062..1083e16dc55 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -259,9 +259,9 @@ make_alias_for_thunk (tree function) if (!flag_syntax_only) { - bool ok = cgraph_same_body_alias (alias, function); + struct cgraph_node *aliasn = cgraph_same_body_alias (alias, function); DECL_ASSEMBLER_NAME (function); - gcc_assert (ok); + gcc_assert (aliasn != NULL); } return alias; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5a90bdc6ead..f5e09ee1757 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -17479,7 +17479,10 @@ dependent_type_p_r (tree type) } /* -- an array type constructed from any dependent type or whose size is specified by a constant expression that is - value-dependent. */ + value-dependent. + + We checked for type- and value-dependence of the bounds in + compute_array_index_type, so TYPE_DEPENDENT_P is already set. */ if (TREE_CODE (type) == ARRAY_TYPE) { if (TYPE_DOMAIN (type) @@ -17487,14 +17490,6 @@ dependent_type_p_r (tree type) return true; return dependent_type_p (TREE_TYPE (type)); } - else if (TREE_CODE (type) == INTEGER_TYPE - && !TREE_CONSTANT (TYPE_MAX_VALUE (type))) - { - /* If this is the TYPE_DOMAIN of an array type, consider it - dependent. We already checked for value-dependence in - compute_array_index_type. */ - return type_dependent_expression_p (TYPE_MAX_VALUE (type)); - } /* -- a template-id in which either the template name is a template parameter ... */ diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 0ac95d05b69..019c51eed85 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3428,8 +3428,17 @@ warn_args_num (location_t loc, tree fndecl, bool too_many_p) "declared here"); } else - error_at (loc, too_many_p ? G_("too many arguments to function") - : G_("too few arguments to function")); + { + if (c_dialect_objc () && objc_message_selector ()) + error_at (loc, + too_many_p + ? G_("too many arguments to method %q#D") + : G_("too few arguments to method %q#D"), + objc_message_selector ()); + else + error_at (loc, too_many_p ? G_("too many arguments to function") + : G_("too few arguments to function")); + } } /* Convert the actual parameter expressions in the list VALUES to the |