[Bug c++/12827] New: [3.4 regression] Bad message for forgotten comma in argument list

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Wed Oct 29 15:55:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] Bad message for forgotten comma in
                    argument list
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org,gdr at gcc dot gnu dot
                    org

It took me a while until I saw the real bug in something significantly
larger than the following, but this shows it as well:
-------------------
void f(int x
       int y);
-------------------
Note the forgotten comma at the end of the first line. Now, with
present mainline we get this:

g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:1: error: variable or field `f' declared void
x.cc:1: error: expected primary-expression

I kept wondering what the first line wanted to tell me, since of course
I had declared f as void. The second line of the error message is
also not helpful, since the real but can only be detected on the
second line of the program, i.e. in x.cc:2.

On the other hand, previous versions of gcc were more clear about the
reason:

g/x> c++ -c x.cc
x.cc:2: parse error before `int'

So I rate this as a regression.

W.



More information about the Gcc-bugs mailing list