This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/15682] New: Parser does not report error when *+ are used together in an exp.


I was writing a small program(Prog1.c) given below.I compiled this on linux9.0
using the gcc compiler 3.2.2.

Prog1.c
main()
{
    int a = 1 *+ 1;

}

Here *+ are used together which is illegal since no *+ operator exists and as 
C/C++  parser  works on maximum-munching rule ..it should report an error.
Actually, here the compiler is treating *+ as binary operator * followed 
by a unary operator....
But if one changes the above code to int a = 1 +* 1 it gives error since no
unary * operator is defined.

-- 
           Summary: Parser does not report error when *+ are used together
                    in an exp.
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: u_238 at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15682


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]