diff options
| author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-25 18:40:05 +0000 |
|---|---|---|
| committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-25 18:40:05 +0000 |
| commit | 017fafd458f2dd2a37abc767693615c36bbbac28 (patch) | |
| tree | fd8eff172a4f2ad80e5a613457bb57d1b78ef690 | |
| parent | 8e6f8d9d87c8f97f50c1fe18e04273b9538dc023 (diff) | |
| download | ppe42-gcc-017fafd458f2dd2a37abc767693615c36bbbac28.tar.gz ppe42-gcc-017fafd458f2dd2a37abc767693615c36bbbac28.zip | |
* decl.c (member_function_or_else): Change third arg from a format
specifier to an `enum overload_flags'. Callers changed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31615 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 23 |
2 files changed, 20 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 27353026596..0b5c2ff527c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> * typeck.c (composite_pointer_type, c_sizeof, expr_sizeof, diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3b2fb85b9f4..ed4a07183a2 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -132,7 +132,7 @@ static void set_identifier_type_value_with_scope PROTO((tree, tree, struct binding_level *)); static void record_builtin_type PROTO((enum rid, const char *, tree)); 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, int)); static void lang_print_error_function PROTO((const char *)); @@ -8321,13 +8321,18 @@ complete_array_type (type, initial_value, do_default) message to print in that case. Otherwise, quietly return 1. */ static int -member_function_or_else (ctype, cur_type, string) +member_function_or_else (ctype, cur_type, flags) tree ctype, cur_type; - const char *string; + enum overload_flags flags; { 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 1; @@ -10177,8 +10182,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) } if (decl_context == FIELD) { - if (! member_function_or_else (ctype, current_class_type, - "destructor for alien class `%s' cannot be a member")) + if (! member_function_or_else (ctype, + current_class_type, + flags)) return void_type_node; } } @@ -10213,8 +10219,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) type = build_pointer_type (ctype); if (decl_context == FIELD) { - if (! member_function_or_else (ctype, current_class_type, - "constructor for alien class `%s' cannot be member")) + if (! member_function_or_else (ctype, + current_class_type, + flags)) return void_type_node; TYPE_HAS_CONSTRUCTOR (ctype) = 1; if (return_type != return_ctor) |

