This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug in cp/parse.y in 3.1 branch
- From: "David O'Brien" <obrien at FreeBSD dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 23 Apr 2002 11:27:45 -0700
- Subject: Bug in cp/parse.y in 3.1 branch
- Organization: The NUXI BSD group
- Reply-to: obrien at FreeBSD dot org
yacc: w - line 2120 of "gcc-3_1-branch/gcc/cp/parse.y", $3 references beyond the end of the current rule
yacc: 33 shift/reduce conflicts
yacc: 58 reduce/reduce conflicts
The YACC rule for this is:
nomods_initdcl0:
notype_declarator maybeasm
{ /* Set things up as initdcl0_innards expects. */
$<ttype>3 = $2;
$2 = $1;
$<ftype>1.t = NULL_TREE;
$<ftype>1.lookups = NULL_TREE; }
initdcl0_innards
{}
| constructor_declarator maybeasm maybe_attribute
{ tree d = parse_decl0 ($1, NULL_TREE, NULL_TREE, $3, 0);
parse_end_decl (d, NULL_TREE, $2); }
;
There is not match for the "$<ttype>3" pseudo-variable above.
This change came in as:
----------------------------
revision 1.211
date: 2001/01/18 13:24:27; author: jakub; state: Exp; lines: +4 -2
branches: 1.211.2;
* parse.y (nomods_initdcl0): Properly set things up for
initdcl0_innards.
----------------------------
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/parse.y,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -r1.210 -r1.211
--- parse.y 11 Jan 2001 12:29:17 -0000 1.210
+++ parse.y 18 Jan 2001 13:24:27 -0000 1.211
@@ -2072,8 +2072,10 @@
nomods_initdcl0:
notype_declarator maybeasm
{ /* Set things up as initdcl0_innards expects. */
- $<ttype>2 = $1;
- $1 = NULL_TREE; }
+ $<ttype>3 = $2;
+ $2 = $1;
+ $<ftype>1.t = NULL_TREE;
+ $<ftype>1.lookups = NULL_TREE; }
initdcl0_innards
{}
| constructor_declarator maybeasm maybe_attribute