https://issues.dlang.org/show_bug.cgi?id=7184

--- Comment #10 from RazvanN <razvan.nitu1...@gmail.com> ---
(In reply to timon.gehr from comment #9)
> (In reply to timon.gehr from comment #8)
> > (In reply to RazvanN from comment #1)
> > > Issuing an error is the correct behavior. As you can see in the grammar 
> > > [1], 
> > > *(x)++ is parsed the following way: *UnaryExpression. If a parenthesis is
> > > encountered, then the parser expects a type :
> > > (type).identifier/templateInstance.
> > 
> > That is the bug. The grammar allows the derivation
> > 
> > UnaryExpression
> >       \
> >     PowExpression
> >         \
> >       PostfixExpression
> >           \
> >         PostfixExpression ++
> >             \
> >          ( PrimaryExpression )
> >               \
> >               ...
> >                 \
> >              Identifier
> > 
> 
> Should have been:
> 
> UnaryExpression
>       \
>     PowExpression
>         \
>       PostfixExpression
>           \
>         PostfixExpression ++
>             \
>           PrimaryExpression
>               \
>            ( Expression )
>                 \
>                 ...
>                   \
>                Identifier

That is correct. I looked at the code which tests that the content of the
parentheses is a type and at the UnaryExpression expression grammar so I
presumed that you cannot have the given construct. I understand now that indeed
this is not acceptable behavior. Thanks

--

Reply via email to