Commit 4dacf5bd by Kaveh R. Ghazi Committed by Kaveh Ghazi

decl.c (member_function_or_else): Change third arg from a format specifier to an…

decl.c (member_function_or_else): Change third arg from a format specifier to an `enum overload_flags'.

	* decl.c (member_function_or_else): Change third arg from a format
	specifier to an `enum overload_flags'.  Callers changed.

From-SVN: r31615
parent 2884c41e
2000-01-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* decl.c (member_function_or_else): Change third arg from a format
specifier to an `enum overload_flags'. Callers changed.
2000-01-25 Gabriel Dos Reis <gdr@codesourcery.com> 2000-01-25 Gabriel Dos Reis <gdr@codesourcery.com>
* typeck.c (composite_pointer_type, c_sizeof, expr_sizeof, * typeck.c (composite_pointer_type, c_sizeof, expr_sizeof,
......
...@@ -132,7 +132,7 @@ static void set_identifier_type_value_with_scope ...@@ -132,7 +132,7 @@ static void set_identifier_type_value_with_scope
PROTO((tree, tree, struct binding_level *)); PROTO((tree, tree, struct binding_level *));
static void record_builtin_type PROTO((enum rid, const char *, tree)); static void record_builtin_type PROTO((enum rid, const char *, tree));
static void record_unknown_type PROTO((tree, const char *)); static void record_unknown_type PROTO((tree, const char *));
static int member_function_or_else PROTO((tree, tree, const char *)); static int member_function_or_else PROTO((tree, tree, enum overload_flags));
static void bad_specifiers PROTO((tree, const char *, int, int, int, int, static void bad_specifiers PROTO((tree, const char *, int, int, int, int,
int)); int));
static void lang_print_error_function PROTO((const char *)); static void lang_print_error_function PROTO((const char *));
...@@ -8321,13 +8321,18 @@ complete_array_type (type, initial_value, do_default) ...@@ -8321,13 +8321,18 @@ complete_array_type (type, initial_value, do_default)
message to print in that case. Otherwise, quietly return 1. */ message to print in that case. Otherwise, quietly return 1. */
static int static int
member_function_or_else (ctype, cur_type, string) member_function_or_else (ctype, cur_type, flags)
tree ctype, cur_type; tree ctype, cur_type;
const char *string; enum overload_flags flags;
{ {
if (ctype && ctype != cur_type) if (ctype && ctype != cur_type)
{ {
error (string, TYPE_NAME_STRING (ctype)); if (flags == DTOR_FLAG)
error ("destructor for alien class `%s' cannot be a member",
TYPE_NAME_STRING (ctype));
else
error ("constructor for alien class `%s' cannot be a member",
TYPE_NAME_STRING (ctype));
return 0; return 0;
} }
return 1; return 1;
...@@ -10177,8 +10182,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10177,8 +10182,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
} }
if (decl_context == FIELD) if (decl_context == FIELD)
{ {
if (! member_function_or_else (ctype, current_class_type, if (! member_function_or_else (ctype,
"destructor for alien class `%s' cannot be a member")) current_class_type,
flags))
return void_type_node; return void_type_node;
} }
} }
...@@ -10213,8 +10219,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10213,8 +10219,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
type = build_pointer_type (ctype); type = build_pointer_type (ctype);
if (decl_context == FIELD) if (decl_context == FIELD)
{ {
if (! member_function_or_else (ctype, current_class_type, if (! member_function_or_else (ctype,
"constructor for alien class `%s' cannot be member")) current_class_type,
flags))
return void_type_node; return void_type_node;
TYPE_HAS_CONSTRUCTOR (ctype) = 1; TYPE_HAS_CONSTRUCTOR (ctype) = 1;
if (return_type != return_ctor) if (return_type != return_ctor)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment