summaryrefslogtreecommitdiffstats
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-03 16:45:18 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-03 16:45:18 +0000
commit491906d3e005efb7c4a73cad8e58d7761fe44b35 (patch)
tree8fb769c8af7ecd1d605d1670f56dff248455c114 /gcc/java/class.c
parenta9072460cb6d1a8ee11bc7e310ee7f8c75a1701b (diff)
downloadppe42-gcc-491906d3e005efb7c4a73cad8e58d7761fe44b35.tar.gz
ppe42-gcc-491906d3e005efb7c4a73cad8e58d7761fe44b35.zip
Fri Apr 30 17:54:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* check-init.c (check_init): Exclude a case of error when doing xrefs. * class.c (layout_class_method): Don't generate the error message twice when compiling from source. * lang-options.h: Added `-Wredundant-modifers' and `-Wunusupported-jdk11' flags and help text. * lang.c (lang_decode_option): Added support for `-Wunsupported-jdk11' and `-Wredundant-modifiers'. flag_static_local_jdk11 and flag_redundant set accordingly. * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK. * parse.h (EXPR_WFL_ADD_COL): New macro. (DECL_END_SOURCE_LINE): Likewise. (DECL_INHERITED_SOURCE_LINE): Likewise. * parse.y (static_ref_err): New function, prototyped. (CCB_TK): Now tagged <operator>. (class_body:): Remember the location of the closing '}' of a class definition when doing xrefs. (block:): Likewise. (block_end:): Likewise. (create_class): Remember the location of the inherited class identifier when doing xrefs. (register_fields): Added test on first operand of `init' before testing it TREE_CODE. (method_header): Store the location of the class identifier in the class decl when doing xrefs. (finish_method_declaration): Don't combine first/last method line when doing xref. (java_check_regular_methods): Warning check on not overriding methods with default access on other packages move before check on static methods. Initialization of `aflags' also moved up. (resolve_expression_name): Call static_ref_err to report the error. (static_ref_err): New function, implemented. (resolve_field_access): Returned simplified static field access when doing xrefs. (resolve_qualified_expression_name): Check for illegal use of static fields in a non static context. Call static_ref_err to report error in various places. (java_complete_tree): To not fold initialized static fields when doing xrefs. (java_complete_lhs): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26758 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 6cb3dfcb265..e7f72ae1170 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -1655,7 +1655,8 @@ layout_class_method (this_class, super_class, method_decl, dtable_count)
if (super_method != NULL_TREE && ! METHOD_PRIVATE (super_method))
{
DECL_VINDEX (method_decl) = DECL_VINDEX (super_method);
- if (DECL_VINDEX (method_decl) == NULL_TREE)
+ if (DECL_VINDEX (method_decl) == NULL_TREE
+ && !CLASS_FROM_SOURCE_P (this_class))
error_with_decl (method_decl,
"non-static method '%s' overrides static method");
#if 0
OpenPOWER on IntegriCloud