+1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
+
+ * typeck.c (build_component_ref): Diagnose ref to nested type.
+
1998-06-10 Brendan Kehoe <brendan@cygnus.com>
* decl.c (grokparms): Check that INIT isn't an error_mark_node
hierarchy, the compiler will abort (because vptr lookups are
not supposed to be ambiguous. */
field = CLASSTYPE_VFIELD (basetype);
- else if (TREE_CODE (component) == FIELD_DECL
- || TREE_CODE (component) == TYPE_DECL)
+ else if (TREE_CODE (component) == FIELD_DECL)
+ field = component;
+ else if (TREE_CODE (component) == TYPE_DECL)
{
- field = component;
+ cp_pedwarn ("invalid use of type decl `%#D' as expression", component);
+ return component;
}
else
{
if (TREE_CODE (field) != FIELD_DECL)
{
if (TREE_CODE (field) == TYPE_DECL)
- {
- cp_error ("invalid use of type decl `%#D' as expression", field);
- return error_mark_node;
- }
+ cp_pedwarn ("invalid use of type decl `%#D' as expression", field);
else if (DECL_RTL (field) != 0)
mark_used (field);
else