* class.c (finish_struct): Make conflicting use of id a pedwarn.
* decl.c (pushdecl_class_level): Likewise.
From-SVN: r20552
+1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
+
+ * class.c (finish_struct): Make conflicting use of id a pedwarn.
+ * decl.c (pushdecl_class_level): Likewise.
+
1998-06-17 Mark Mitchell <mark@markmitchell.com>
* pt.c (convert_nontype_argument): Issue an error when presented
TREE_PROTECTED (DECL_RESULT (x)) = TREE_PROTECTED (x);
}
- /* Check for inconsistent use of this name in the class body.
+ /* A name N used in a class S shall refer to the same declaration
+ in its context and when re-evaluated in the completed scope of S.
+
Enums, types and static vars have already been checked. */
if (TREE_CODE (x) != TYPE_DECL && TREE_CODE (x) != USING_DECL
&& ! (TREE_CODE (x) == TEMPLATE_DECL
&& !(TREE_CODE (icv) == TYPE_DECL
&& DECL_CONTEXT (icv) == t))
{
- cp_error_at ("declaration of identifier `%D' as `%+#D'",
- name, x);
- cp_error_at ("conflicts with other use in class as `%#D'",
- icv);
+ cp_pedwarn_at ("declaration of identifier `%D' as `%+#D'",
+ name, x);
+ cp_pedwarn_at ("conflicts with other use in class as `%#D'",
+ icv);
}
}
{
if (TYPE_BEING_DEFINED (current_class_type))
{
- /* Check for inconsistent use of this name in the class body.
+ /* A name N used in a class S shall refer to the same declaration
+ in its context and when re-evaluated in the completed scope of S.
+
Types, enums, and static vars are checked here; other
members are checked in finish_struct. */
tree icv = IDENTIFIER_CLASS_VALUE (name);
&& !(DECL_DECLARES_TYPE_P (icv)
&& DECL_CONTEXT (icv) == current_class_type))
{
- cp_error ("declaration of identifier `%D' as `%#D'", name, x);
- cp_error_at ("conflicts with previous use in class as `%#D'",
- icv);
+ cp_pedwarn ("declaration of identifier `%D' as `%#D'", name, x);
+ cp_pedwarn_at ("conflicts with previous use in class as `%#D'",
+ icv);
}
}