deprecated_state = DEPRECATED_NORMAL;
- if (decl == NULL_TREE || TREE_CODE (decl) == VOID_TYPE)
+ if (decl == NULL_TREE || TREE_CODE (decl) == VOID_TYPE
+ || decl == error_mark_node)
return error_mark_node;
type = TREE_TYPE (decl);
- if (type == error_mark_node)
- return error_mark_node;
-
context = DECL_CONTEXT (decl);
if (context)
if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),
integer_type_node))
{
+ tree oldtypeargs = TYPE_ARG_TYPES (TREE_TYPE (decl));
+ tree newtype;
error ("%<::main%> must return %<int%>");
- TREE_TYPE (TREE_TYPE (decl)) = integer_type_node;
+ newtype = build_function_type (integer_type_node,
+ oldtypeargs);
+ TREE_TYPE (decl) = newtype;
}
inlinep = 0;
publicp = 1;
}
if (ctype == current_class_type)
- pedwarn ("extra qualification %<%T::%> on member %qs ignored",
+ pedwarn ("extra qualification %<%T::%> on member %qs",
ctype, name);
else if (TREE_CODE (type) == FUNCTION_TYPE)
{