parse.y (java_check_regular_methods): Warning check on not overriding methods with...
authorAlexandre Petit-Bianco <apbianco@cygnus.com>
Thu, 13 May 1999 19:01:19 +0000 (19:01 +0000)
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>
Thu, 13 May 1999 19:01:19 +0000 (12:01 -0700)
Thu May 13 18:30:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
* parse.y (java_check_regular_methods): Warning check on not
  overriding methods with default access in other packages does not
  apply to `<clinit>'.
(java_complete_lhs): If block body is an empty_stmt_node, replace
  it by NULL_TREE. This avoid gcc generating an irrelevant warning.

From-SVN: r26930

gcc/java/ChangeLog
gcc/java/parse.c
gcc/java/parse.y

index a589edab3b1150d0226a4dac3cf3aae6f5754982..cf33bd553398a82b08ea9c328cf04c2236aca4b7 100644 (file)
@@ -1,3 +1,11 @@
+Thu May 13 18:30:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * parse.y (java_check_regular_methods): Warning check on not
+       overriding methods with default access in other packages does not
+       apply to `<clinit>'.
+       (java_complete_lhs): If block body is an empty_stmt_node, replace
+       it by NULL_TREE. This avoid gcc generating an irrelevant warning.
+
 Thu May 13 13:23:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * check-init.c (check_init): Removed code accepting to see things
index 56e30d3c2cf3fded470fd98481960e0c795b3512..92ed988cf243bcc141d2886c11cc675bb3dfe92e 100644 (file)
@@ -7222,6 +7222,7 @@ java_check_regular_methods (class_decl)
       if (DECL_CONTEXT (found) != object_type_node
          && ((aflags & 0x7) == 0)
          && !class_in_current_package (DECL_CONTEXT (found))
+         && DECL_NAME (found) != clinit_identifier_node
          && flag_not_overriding)
         {
          parse_warning_context 
@@ -10473,7 +10474,10 @@ java_complete_lhs (node)
        COMPLETE_CHECK_OP_1 (node);
       TREE_TYPE (node) = void_type_node;
       POP_LABELED_BLOCK ();
-      if (CAN_COMPLETE_NORMALLY (LABELED_BLOCK_BODY (node)))
+
+      if (LABELED_BLOCK_BODY (node) == empty_stmt_node)
+       LABELED_BLOCK_BODY (node) = NULL_TREE;
+      else if (CAN_COMPLETE_NORMALLY (LABELED_BLOCK_BODY (node)))
        CAN_COMPLETE_NORMALLY (node) = 1;
       return node;
 
index dbf7fe42d23f3adbf24efdeef8b66221ab7874ba..64f7e182c14e815eaa2158eb7ebd5f93aaaf2525 100644 (file)
@@ -4618,6 +4618,7 @@ java_check_regular_methods (class_decl)
       if (DECL_CONTEXT (found) != object_type_node
          && ((aflags & 0x7) == 0)
          && !class_in_current_package (DECL_CONTEXT (found))
+         && DECL_NAME (found) != clinit_identifier_node
          && flag_not_overriding)
         {
          parse_warning_context 
@@ -7869,7 +7870,10 @@ java_complete_lhs (node)
        COMPLETE_CHECK_OP_1 (node);
       TREE_TYPE (node) = void_type_node;
       POP_LABELED_BLOCK ();
-      if (CAN_COMPLETE_NORMALLY (LABELED_BLOCK_BODY (node)))
+
+      if (LABELED_BLOCK_BODY (node) == empty_stmt_node)
+       LABELED_BLOCK_BODY (node) = NULL_TREE;
+      else if (CAN_COMPLETE_NORMALLY (LABELED_BLOCK_BODY (node)))
        CAN_COMPLETE_NORMALLY (node) = 1;
       return node;