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.
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);
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))
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);
}
}
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 */
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
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 */
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);
}