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
This commit is contained in:
parent
a11d04b523
commit
38da603971
@ -1,3 +1,15 @@
|
||||
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.
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user