This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Java: fix to gcj PR #97.
- To: egcs-patches at egcs dot cygnus dot com
- Subject: [PATCH] Java: fix to gcj PR #97.
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Wed, 1 Dec 1999 05:09:07 -0800
The following patch has been checked in in order to fix the gcj PR
#97.
./A
Thu Nov 11 01:57:14 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (lookup_method_invoke): Use lang_printable_name to
reliably build the type name during error report. Fixes PR gcj/97.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -p -r1.120 -r1.121
--- parse.y 1999/11/29 20:43:24 1.120
+++ parse.y 1999/12/01 13:06:10 1.121
@@ -7561,6 +7561,7 @@ lookup_method_invoke (lc, cl, class, nam
tree atl = end_params_node; /* Arg Type List */
tree method, signature, list, node;
const char *candidates; /* Used for error report */
+ char *dup;
/* Fix the arguments */
for (node = arg_list; node; node = TREE_CHAIN (node))
@@ -7610,14 +7611,13 @@ lookup_method_invoke (lc, cl, class, nam
method = make_node (FUNCTION_TYPE);
TYPE_ARG_TYPES (method) = atl;
signature = build_java_argument_signature (method);
- parse_error_context (cl, "Can't find %s `%s(%s)' in class `%s'%s",
+ dup = strdup (lang_printable_name (class, 0));
+ parse_error_context (cl, "Can't find %s `%s(%s)' in type `%s'%s",
(lc ? "constructor" : "method"),
- (lc ?
- IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class))) :
- IDENTIFIER_POINTER (name)),
- IDENTIFIER_POINTER (signature),
- IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class))),
+ (lc ? dup : IDENTIFIER_POINTER (name)),
+ IDENTIFIER_POINTER (signature), dup,
(candidates ? candidates : ""));
+ free (dup);
return NULL_TREE;
}