aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorPer Bothner <bothner@cygnus.com>1999-03-08 13:34:12 +0000
committerPer Bothner <bothner@gcc.gnu.org>1999-03-08 05:34:12 -0800
commit30ca27b4751fd68cb31758d01f309b13144b1cc2 (patch)
treed51147db527f31da8d998c1a963c2cbb9027228f /gcc/java/class.c
parentc0d87ff6f9eaecba3c1e1936cd52074385131a96 (diff)
downloadgcc-30ca27b4751fd68cb31758d01f309b13144b1cc2.zip
gcc-30ca27b4751fd68cb31758d01f309b13144b1cc2.tar.gz
gcc-30ca27b4751fd68cb31758d01f309b13144b1cc2.tar.bz2
lex.c (java_parse_end_comment): Take extra parameter (next char).
� * lex.c (java_parse_end_comment): Take extra parameter (next char). * class.c (build_utf8_ref): Fix possible name class/ambiguity. * class.c (layout_class_method): A static method in a base class is never overridden, so treat it like it doesn't exist. However, do complain about private non-static method overriding public static method. * parse.y: Don't set unused INITIALIZED_P flag. * java-tree.h (INITIALIZED_P): Removed no-longer needed flag. * parse.y (find_expr_with_wfl): Optimize tail-calls. (build_array_from_name): Re-order &index[string] to &string[index]. * parse.y (java_complete_tree): Don't call patch_assignment if rhs is error_mark (it might catch more errors, but it is more likely to lose). From-SVN: r25641
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index d92d4c3..e4f4224 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -569,6 +569,8 @@ build_utf8_ref (name)
/* Build a unique identifier based on buf. */
sprintf(buf, "_Utf%d", ++utf8_count);
buf_ptr = &buf[strlen (buf)];
+ if (name_len > 0 && name_ptr[0] >= '0' && name_ptr[0] <= '9')
+ *buf_ptr++ = '_';
while (--name_len >= 0)
{
unsigned char c = *name_ptr++;
@@ -1627,11 +1629,10 @@ layout_class_method (this_class, super_class, method_decl, dtable_count)
build_java_argument_signature (TREE_TYPE (method_decl));
tree super_method = lookup_argument_method (super_class, method_name,
method_sig);
- if (super_method != NULL_TREE)
+ if (super_method != NULL_TREE && ! METHOD_PRIVATE (super_method))
{
DECL_VINDEX (method_decl) = DECL_VINDEX (super_method);
- if (DECL_VINDEX (method_decl) == NULL_TREE &&
- ! TREE_PRIVATE (method_decl))
+ if (DECL_VINDEX (method_decl) == NULL_TREE)
error_with_decl (method_decl,
"non-static method '%s' overrides static method");
#if 0