re GNATS gcj/310 (illegal type "long" accepted for "switch" expression)
authorTom Tromey <tromey@cygnus.com>
Sun, 20 Aug 2000 16:24:31 +0000 (16:24 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Sun, 20 Aug 2000 16:24:31 +0000 (16:24 +0000)
* parse.y (patch_switch_statement): Disallow `long' in switch
expressions.  Fixes PR gcj/310.

From-SVN: r35819

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

index 99578ff..805b4b9 100644 (file)
@@ -1,3 +1,8 @@
+2000-08-09  Tom Tromey  <tromey@cygnus.com>
+
+       * parse.y (patch_switch_statement): Disallow `long' in switch
+       expressions.  Fixes PR gcj/310.
+
 2000-08-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * decl.c (finit_leg_identifier_node): New global.
index 56edc6c..514ecbb 100644 (file)
@@ -14413,7 +14413,7 @@ patch_switch_statement (node)
   se_type = TREE_TYPE (se);
   /* The type of the switch expression must be char, byte, short or
      int */
-  if (!JINTEGRAL_TYPE_P (se_type))
+  if (! JINTEGRAL_TYPE_P (se_type) || se_type == long_type_node)
     {
       EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node);
       parse_error_context (wfl_operator,