diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 1998-12-01 14:28:02 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 1998-12-01 06:28:02 -0800 |
commit | 82371d41c2e0a1e8c68c43748a71bb9deec0ed1a (patch) | |
tree | 009299b3815a338dbba35958d0320cfdada1c86f /gcc/java/class.c | |
parent | df3ba30ac3667b0ff00d7ae8aa29ffad2d1c68d4 (diff) | |
download | gcc-82371d41c2e0a1e8c68c43748a71bb9deec0ed1a.zip gcc-82371d41c2e0a1e8c68c43748a71bb9deec0ed1a.tar.gz gcc-82371d41c2e0a1e8c68c43748a71bb9deec0ed1a.tar.bz2 |
class.c (layout_class_method): Don't report error on non-static overriding static if the method is private.
Tue Dec 1 13:53:24 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class_method): Don't report error on non-static
overriding static if the method is private.
* java-tree.h (finish_class): Prototype added.
* lex.c (java_get_line_col): Handle col argument -2 value.
* parse.h: All static method declarations moved to parse.y.
* parse.y: Now contains all static method declarations previously
found in parse.h.
(find_expr_with_wfl, missing_return_error,
unreachable_stmt_error): New functions.
(java_get_real_method_name): Identify constructors bearing class
names in source code compiled classes only.
(java_complete_expand_methods): Call missing_return_error.
(invocation_mode): Private methods invoked as static methods.
(java_complete_tree): Call unreachable_stmt_error.
This patch corrects the way unreachable statement and missing return
statement errors are reported. It also fixes random bugs.
From-SVN: r24036
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index 681f8c2..dedff9e 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1588,7 +1588,8 @@ layout_class_method (this_class, super_class, method_decl, dtable_count) if (super_method != NULL_TREE) { DECL_VINDEX (method_decl) = DECL_VINDEX (super_method); - if (DECL_VINDEX (method_decl) == NULL_TREE) + if (DECL_VINDEX (method_decl) == NULL_TREE && + ! TREE_PRIVATE (method_decl)) error_with_decl (method_decl, "non-static method '%s' overrides static method"); #if 0 |