This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: direct_notype_declarator and constructors
On Fri, Feb 25, 2000 at 04:57:48PM -0800, Jason Merrill wrote:
> >>>>> Clinton Popetz <cpopetz@cygnus.com> writes:
>
> > Removing the precedence declaration from this rule in cp/parse.y:
> > direct_notype_declarator:
> > complex_direct_notype_declarator
> > /* This precedence declaration is to prefer this reduce
> > to the Koenig lookup shift in primary, below. I hate yacc. */
> > | notype_unqualified_id %prec '('
>
> > Can someone post code that exhibits the need for the %prec? If not, is the
> > patch below ok? FWIW, this introduces two shift/reduce conflicts ('(' and
> > LEFT_RIGHT) which bison resolves as reduce.
>
> If the conflicts are resolved as reduce anyway, I don't understand why
> removing the %prec would make a difference.
Oops, I mistakenly read a reverse diff of the verbose output. There were two
conflicts that were _previously_ resolved as reductions, but are now resolved as
shifts:
730,731d729
< Conflict in state 1039 between rule 302 and token LEFT_RIGHT resolved as reduce.
< Conflict in state 1039 between rule 302 and token '(' resolved as reduce.
818c816
< State 1039 contains 4 reduce/reduce conflicts.
---
> State 1039 contains 2 shift/reduce conflicts and 4 reduce/reduce conflicts.
27725a27724,27725
> LEFT_RIGHT shift, and go to state 610
> '(' shift, and go to state 611
27727c27727
< LEFT_RIGHT reduce using rule 302 (direct_notype_declarator)
---
> LEFT_RIGHT [reduce using rule 302 (direct_notype_declarator)]
27729c27729
< '(' reduce using rule 302 (direct_notype_declarator)
---
> '(' [reduce using rule 302 (direct_notype_declarator)]
-Clint