aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-04-06 00:43:27 +0000
committerTom Tromey <tromey@gcc.gnu.org>2000-04-06 00:43:27 +0000
commite0fc4118fea69036438dc790c529a68e183f24fe (patch)
tree1e8724cd9b278c8353f39e72d4fb6ad66b16565c /gcc
parent24969f074e21f4aecec90c16348537b3b4a5f5a1 (diff)
downloadgcc-e0fc4118fea69036438dc790c529a68e183f24fe.zip
gcc-e0fc4118fea69036438dc790c529a68e183f24fe.tar.gz
gcc-e0fc4118fea69036438dc790c529a68e183f24fe.tar.bz2
re GNATS gcj/164 (compiler permits "volatile final" variables)
* parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter. * parse.y (check_modifiers_consistency): Check for final/volatile clash. Fixes PR gcj/164. From-SVN: r32955
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/parse.c28
-rw-r--r--gcc/java/parse.h2
-rw-r--r--gcc/java/parse.y18
4 files changed, 41 insertions, 13 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 1a0edc8..f16dd5d 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2000-04-05 Tom Tromey <tromey@cygnus.com>
+
+ * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
+ * parse.y (check_modifiers_consistency): Check for final/volatile
+ clash. Fixes PR gcj/164.
+
2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
diff --git a/gcc/java/parse.c b/gcc/java/parse.c
index d476617..e15e571 100644
--- a/gcc/java/parse.c
+++ b/gcc/java/parse.c
@@ -2387,7 +2387,7 @@ static const short yycheck[] = { 3,
#define YYPURE 1
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/home/apbianco/install/intel-java-alpha/install-x86//share/bison.simple"
+#line 3 "/usr/share/misc/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -2404,7 +2404,7 @@ static const short yycheck[] = { 3,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
@@ -2538,8 +2538,10 @@ int yydebug; /* nonzero means print parse trace */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
+#ifndef YYPARSE_PARAM
int yyparse (void);
#endif
+#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
@@ -2580,7 +2582,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/home/apbianco/install/intel-java-alpha/install-x86//share/bison.simple"
+#line 196 "/usr/share/misc/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -4976,7 +4978,7 @@ case 503:
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/home/apbianco/install/intel-java-alpha/install-x86//share/bison.simple"
+#line 498 "/usr/share/misc/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -7200,12 +7202,22 @@ check_modifiers_consistency (flags)
int acc_count = 0;
tree cl = NULL_TREE;
- THIS_MODIFIER_ONLY (flags, ACC_PUBLIC, 0, acc_count, cl);
- THIS_MODIFIER_ONLY (flags, ACC_PRIVATE, 1, acc_count, cl);
- THIS_MODIFIER_ONLY (flags, ACC_PROTECTED, 2, acc_count, cl);
+ THIS_MODIFIER_ONLY (flags, ACC_PUBLIC, PUBLIC_TK, acc_count, cl);
+ THIS_MODIFIER_ONLY (flags, ACC_PRIVATE, PRIVATE_TK, acc_count, cl);
+ THIS_MODIFIER_ONLY (flags, ACC_PROTECTED, PROTECTED_TK, acc_count, cl);
if (acc_count > 1)
parse_error_context
- (cl, "Inconsistent member declaration. At most one of `public', `private', or `protected' may be specified");
+ (cl, "Inconsistent member declaration. At most one of `public', `private', or `protected' may be specified");
+
+ acc_count = 0;
+ cl = NULL_TREE;
+ THIS_MODIFIER_ONLY (flags, ACC_FINAL, FINAL_TK - PUBLIC_TK,
+ acc_count, cl);
+ THIS_MODIFIER_ONLY (flags, ACC_VOLATILE, VOLATILE_TK - PUBLIC_TK,
+ acc_count, cl);
+ if (acc_count > 1)
+ parse_error_context (cl,
+ "Inconsistent member declaration. At most one of `final' or `volatile' may be specified");
}
/* Check the methode header METH for abstract specifics features */
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index bea4b70..b19edbe 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -89,7 +89,7 @@ extern tree stabilize_reference PARAMS ((tree));
#define THIS_MODIFIER_ONLY(f, m, v, count, l) \
if ((f) & (m)) \
{ \
- tree node = ctxp->modifier_ctx [v]; \
+ tree node = MODIFIER_WFL (v); \
if ((l) \
&& ((EXPR_WFL_COLNO (node) > EXPR_WFL_COLNO (l)) \
|| (EXPR_WFL_LINENO (node) > EXPR_WFL_LINENO (l)))) \
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index bfb7242..cac9a3a9 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -4570,12 +4570,22 @@ check_modifiers_consistency (flags)
int acc_count = 0;
tree cl = NULL_TREE;
- THIS_MODIFIER_ONLY (flags, ACC_PUBLIC, 0, acc_count, cl);
- THIS_MODIFIER_ONLY (flags, ACC_PRIVATE, 1, acc_count, cl);
- THIS_MODIFIER_ONLY (flags, ACC_PROTECTED, 2, acc_count, cl);
+ THIS_MODIFIER_ONLY (flags, ACC_PUBLIC, PUBLIC_TK, acc_count, cl);
+ THIS_MODIFIER_ONLY (flags, ACC_PRIVATE, PRIVATE_TK, acc_count, cl);
+ THIS_MODIFIER_ONLY (flags, ACC_PROTECTED, PROTECTED_TK, acc_count, cl);
if (acc_count > 1)
parse_error_context
- (cl, "Inconsistent member declaration. At most one of `public', `private', or `protected' may be specified");
+ (cl, "Inconsistent member declaration. At most one of `public', `private', or `protected' may be specified");
+
+ acc_count = 0;
+ cl = NULL_TREE;
+ THIS_MODIFIER_ONLY (flags, ACC_FINAL, FINAL_TK - PUBLIC_TK,
+ acc_count, cl);
+ THIS_MODIFIER_ONLY (flags, ACC_VOLATILE, VOLATILE_TK - PUBLIC_TK,
+ acc_count, cl);
+ if (acc_count > 1)
+ parse_error_context (cl,
+ "Inconsistent member declaration. At most one of `final' or `volatile' may be specified");
}
/* Check the methode header METH for abstract specifics features */