return lookup_typename (name, (struct block *) NULL, 0);
}
-struct type *
-check_struct (type)
- struct type *type;
-{
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT)
- error ("This context has %s, not a struct or class.", TYPE_NAME (type));
- return type;
-}
-
/* Lookup a structure type named "struct NAME",
visible in lexical block BLOCK. */
{
error ("No struct type named %s.", name);
}
- return check_struct (SYMBOL_TYPE (sym));
-}
-
-struct type *
-check_union (type)
- struct type *type;
-{
- if (TYPE_CODE (type) != TYPE_CODE_UNION)
- error ("This context has %s, not a union.", TYPE_NAME (type));
- return type;
+ if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
+ {
+ error ("This context has class, union or enum %s, not a struct.", name);
+ }
+ return (SYMBOL_TYPE (sym));
}
/* Lookup a union type named "union NAME",
{
error ("No union type named %s.", name);
}
- return check_union (SYMBOL_TYPE (sym));
-}
-
-struct type *
-check_enum (type)
- struct type *type;
-{
- if (TYPE_CODE (type) != TYPE_CODE_ENUM)
- error ("This context has %s, not an enum.", TYPE_NAME (type));
- return type;
+ if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_UNION)
+ {
+ error ("This context has class, struct or enum %s, not a union.", name);
+ }
+ return (SYMBOL_TYPE (sym));
}
/* Lookup an enum type named "enum NAME",
{
error ("No enum type named %s.", name);
}
- return check_enum (SYMBOL_TYPE (sym));
+ if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_ENUM)
+ {
+ error ("This context has class, struct or union %s, not an enum.", name);
+ }
+ return (SYMBOL_TYPE (sym));
}
/* Lookup a template type named "template NAME<TYPE>",