diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-12-07 14:26:37 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-12-07 14:26:37 +0000 |
commit | 38da603971b2179956379c758f953d9a92f358c5 (patch) | |
tree | 366fc57abd7e14073d8ec805faca9244210ec53a | |
parent | a11d04b523a602dc745c64ea7bd9058822ebd89a (diff) | |
download | gcc-38da603971b2179956379c758f953d9a92f358c5.zip gcc-38da603971b2179956379c758f953d9a92f358c5.tar.gz gcc-38da603971b2179956379c758f953d9a92f358c5.tar.bz2 |
class.c (check_field_decls): Don't special case anonymous fields in error messages.
* class.c (check_field_decls): Don't special case anonymous
fields in error messages.
(note_name_declared_in_class): Use %D on diagnostic.
* tree.c (pod_type_p): Use strip_array_types.
(cp_valid_lang_attribute): Likewise.
* typeck.c (cp_type_quals): Strip arrays separately, to avoid
multiple evaluations.
(cp_has_mutable_p): Use strip_array_types.
From-SVN: r38112
-rw-r--r-- | gcc/cp/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/cp/class.c | 18 | ||||
-rw-r--r-- | gcc/cp/tree.c | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 6 |
4 files changed, 21 insertions, 21 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 923158ab..00f9549 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,17 @@ 2000-12-07 Nathan Sidwell <nathan@codesourcery.com> + * class.c (check_field_decls): Don't special case anonymous + fields in error messages. + (note_name_declared_in_class): Use %D on diagnostic. + + * tree.c (pod_type_p): Use strip_array_types. + (cp_valid_lang_attribute): Likewise. + * typeck.c (cp_type_quals): Strip arrays separately, to avoid + multiple evaluations. + (cp_has_mutable_p): Use strip_array_types. + +2000-12-07 Nathan Sidwell <nathan@codesourcery.com> + * cp-tree.h (sufficient_parms_p): Declare new function. * call.c (sufficient_parms_p): New function, broken out of ... (add_function_candidate): ... here. Use it. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index ff3d264..60041c5 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -3537,12 +3537,7 @@ check_field_decls (t, access_decls, empty_p, TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1; if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings) - { - if (DECL_NAME (x)) - cp_warning_at ("non-static reference `%#D' in class without a constructor", x); - else - cp_warning_at ("non-static reference in class without a constructor", x); - } + cp_warning_at ("non-static reference `%#D' in class without a constructor", x); } type = strip_array_types (type); @@ -3574,12 +3569,7 @@ check_field_decls (t, access_decls, empty_p, TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1; if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings) - { - if (DECL_NAME (x)) - cp_warning_at ("non-static const member `%#D' in class without a constructor", x); - else - cp_warning_at ("non-static const member in class without a constructor", x); - } + cp_warning_at ("non-static const member `%#D' in class without a constructor", x); } /* A field that is pseudo-const makes the structure likewise. */ else if (IS_AGGR_TYPE (type)) @@ -6533,8 +6523,8 @@ note_name_declared_in_class (name, decl) in its context and when re-evaluated in the completed scope of S. */ cp_error ("declaration of `%#D'", decl); - cp_error_at ("changes meaning of `%s' from `%+#D'", - IDENTIFIER_POINTER (DECL_NAME (OVL_CURRENT (decl))), + cp_error_at ("changes meaning of `%D' from `%+#D'", + DECL_NAME (OVL_CURRENT (decl)), (tree) n->value); } } diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 653930e..f59aef8 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2242,8 +2242,7 @@ int pod_type_p (t) tree t; { - while (TREE_CODE (t) == ARRAY_TYPE) - t = TREE_TYPE (t); + t = strip_array_types (t); if (INTEGRAL_TYPE_P (t)) return 1; /* integral, character or enumeral type */ @@ -2310,8 +2309,7 @@ cp_valid_lang_attribute (attr_name, attr_args, decl, type) pri = TREE_INT_CST_LOW (initp_expr); - while (TREE_CODE (type) == ARRAY_TYPE) - type = TREE_TYPE (type); + type = strip_array_types (type); if (decl == NULL_TREE || TREE_CODE (decl) != VAR_DECL diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index b426e76..762f552 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6983,7 +6983,8 @@ int cp_type_quals (type) tree type; { - return TYPE_QUALS (strip_array_types (type)); + type = strip_array_types (type); + return TYPE_QUALS (type); } /* Returns non-zero if the TYPE contains a mutable member */ @@ -6992,8 +6993,7 @@ int cp_has_mutable_p (type) tree type; { - while (TREE_CODE (type) == ARRAY_TYPE) - type = TREE_TYPE (type); + type = strip_array_types (type); return CLASS_TYPE_P (type) && CLASSTYPE_HAS_MUTABLE (type); } |