public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24907]  New: Invalid Code Accepted
@ 2005-11-16 22:05 joel at gcc dot gnu dot org
  2005-11-16 22:24 ` [Bug c++/24907] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: joel at gcc dot gnu dot org @ 2005-11-16 22:05 UTC (permalink / raw)
  To: gcc-bugs

I am getting a syntax error when compiled as C but not C++.

int f()
{
int x, y, ;
}

Andrew Pinski commented:

I am getting a syntax error with the C front-end but not with the
C++ front-end.  This is definitely a bug as this is invalid C++ also.
This is a regression from at least 3.4.0 as 3.3.3 works but 3.4.0 does
not reject it.


-- 
           Summary: Invalid Code Accepted
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: joel at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/24907] [3.4/4.0/4.1 Regression] Invalid Code Accepted
  2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
@ 2005-11-16 22:24 ` pinskia at gcc dot gnu dot org
  2005-11-19  2:18 ` [Bug c++/24907] [3.4/4.0/4.1 Regression] "int x, ;" accepted mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-16 22:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-16 22:24 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-16 22:24:57
               date|                            |
            Summary|Invalid Code Accepted       |[3.4/4.0/4.1 Regression]
                   |                            |Invalid Code Accepted
   Target Milestone|---                         |4.0.3


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/24907] [3.4/4.0/4.1 Regression] "int x, ;" accepted
  2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
  2005-11-16 22:24 ` [Bug c++/24907] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-11-19  2:18 ` mmitchel at gcc dot gnu dot org
  2005-11-21 15:31 ` [Bug c++/24907] [3.4/4.0/4.1/4.2 " machata at post dot cz
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-11-19  2:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mmitchel at gcc dot gnu dot org  2005-11-19 02:18 -------
Should be an easy fix.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/24907] [3.4/4.0/4.1/4.2 Regression] "int x, ;" accepted
  2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
  2005-11-16 22:24 ` [Bug c++/24907] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
  2005-11-19  2:18 ` [Bug c++/24907] [3.4/4.0/4.1 Regression] "int x, ;" accepted mmitchel at gcc dot gnu dot org
@ 2005-11-21 15:31 ` machata at post dot cz
  2005-11-23 10:26 ` machata at post dot cz
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: machata at post dot cz @ 2005-11-21 15:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from machata at post dot cz  2005-11-21 15:31 -------
Created an attachment (id=10311)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10311&action=view)
Allow comma only on second and further passes of declarator processing loop.

The patch addresses the problem by eating comma at the beginning of loop which
processes declarators, and only eating it when it's second or later pass.

Testcase is in patch, make check-g++ passed on i686-pc-linux-gnu.
I'll do bootstrap and more thorough test tomorrow, and send the patch to
gcc-patches then.


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/24907] [3.4/4.0/4.1/4.2 Regression] "int x, ;" accepted
  2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-11-21 15:31 ` [Bug c++/24907] [3.4/4.0/4.1/4.2 " machata at post dot cz
@ 2005-11-23 10:26 ` machata at post dot cz
  2005-12-13  8:01 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: machata at post dot cz @ 2005-11-23 10:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from machata at post dot cz  2005-11-23 10:26 -------
(In reply to comment #3)
> Testcase is in patch, make check-g++ passed on i686-pc-linux-gnu.
> I'll do bootstrap and more thorough test tomorrow, and send the patch to
> gcc-patches then.

Ok, done today.


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/24907] [3.4/4.0/4.1/4.2 Regression] "int x, ;" accepted
  2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-11-23 10:26 ` machata at post dot cz
@ 2005-12-13  8:01 ` jakub at gcc dot gnu dot org
  2005-12-13  8:16 ` [Bug c++/24907] [3.4/4.0/4.1 " jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-12-13  8:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2005-12-13 08:01 -------
Subject: Bug 24907

Author: jakub
Date: Tue Dec 13 08:01:53 2005
New Revision: 108462

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108462
Log:
2005-12-13  Petr Machata  <machata@post.cz>

        PR c++/24907
        * parser.c (cp_parser_simple_declaration): Require comma at the
        beginning of processing second and later declarators, instead of
        allowing the comma at the end of each iteration.

        * g++.dg/parse/comma2.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/parse/comma2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/24907] [3.4/4.0/4.1 Regression] "int x, ;" accepted
  2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-12-13  8:01 ` jakub at gcc dot gnu dot org
@ 2005-12-13  8:16 ` jakub at gcc dot gnu dot org
  2006-03-11  3:18 ` [Bug c++/24907] [3.4/4.0 " mmitchel at gcc dot gnu dot org
  2007-02-03 16:02 ` [Bug c++/24907] [4.0 " gdr at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-12-13  8:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2005-12-13 08:16 -------
Subject: Bug 24907

Author: jakub
Date: Tue Dec 13 08:16:24 2005
New Revision: 108467

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108467
Log:
2005-12-13  Petr Machata  <machata@post.cz>

        PR c++/24907
        * parser.c (cp_parser_simple_declaration): Require comma at the
        beginning of processing second and later declarators, instead of
        allowing the comma at the end of each iteration.

        * g++.dg/parse/comma2.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/comma2.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/parser.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/24907] [3.4/4.0 Regression] "int x, ;" accepted
  2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-12-13  8:16 ` [Bug c++/24907] [3.4/4.0/4.1 " jakub at gcc dot gnu dot org
@ 2006-03-11  3:18 ` mmitchel at gcc dot gnu dot org
  2007-02-03 16:02 ` [Bug c++/24907] [4.0 " gdr at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11  3:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.3                       |4.0.4


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/24907] [4.0 Regression] "int x, ;" accepted
  2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-03-11  3:18 ` [Bug c++/24907] [3.4/4.0 " mmitchel at gcc dot gnu dot org
@ 2007-02-03 16:02 ` gdr at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 16:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from gdr at gcc dot gnu dot org  2007-02-03 16:02 -------
Fixed in GCC-4.1.0.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.0.4                       |4.1.0


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-02-03 16:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-16 22:05 [Bug c++/24907] New: Invalid Code Accepted joel at gcc dot gnu dot org
2005-11-16 22:24 ` [Bug c++/24907] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-11-19  2:18 ` [Bug c++/24907] [3.4/4.0/4.1 Regression] "int x, ;" accepted mmitchel at gcc dot gnu dot org
2005-11-21 15:31 ` [Bug c++/24907] [3.4/4.0/4.1/4.2 " machata at post dot cz
2005-11-23 10:26 ` machata at post dot cz
2005-12-13  8:01 ` jakub at gcc dot gnu dot org
2005-12-13  8:16 ` [Bug c++/24907] [3.4/4.0/4.1 " jakub at gcc dot gnu dot org
2006-03-11  3:18 ` [Bug c++/24907] [3.4/4.0 " mmitchel at gcc dot gnu dot org
2007-02-03 16:02 ` [Bug c++/24907] [4.0 " gdr at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).