public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32121]  New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations
@ 2007-05-28  7:27 pinskia at gcc dot gnu dot org
  2007-05-28  7:28 ` [Bug c++/32121] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-28  7:27 UTC (permalink / raw)
  To: gcc-bugs

According to our documentation, __label__ declarations have to come first but
the C++ accepts code where they don't which can be shown to be a bit weird with
two labels with the same name.
Here is a testcase which shows that the C++ front-end can accept a case where
we have two labels with the same name:
int f(void)
{
  a:;
  __label__ a;
  int b;
  __label__ c;
  a:;
  c:;
}

This should be rejected, the C front-end rejects this code with the following
errors:
t56.c: In function 'f':
t56.c:4: error: expected expression before '__label__'
t56.c:6: error: expected expression before '__label__'
t56.c:7: error: duplicate label 'a'
t56.c:3: error: previous definition of 'a' was here


This bug was originally found by Chris Lattner.


-- 
           Summary: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid
                    __label__ declarations
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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

* [Bug c++/32121] [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
@ 2007-05-28  7:28 ` pinskia at gcc dot gnu dot org
  2007-05-28  7:36 ` sabre at nondot dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-28  7:28 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.0.1 4.1.0 4.2.0 4.3.0
      Known to work|                            |3.3.3
   Target Milestone|---                         |4.1.3


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


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

* [Bug c++/32121] [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
  2007-05-28  7:28 ` [Bug c++/32121] " pinskia at gcc dot gnu dot org
@ 2007-05-28  7:36 ` sabre at nondot dot org
  2007-05-28  7:54 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sabre at nondot dot org @ 2007-05-28  7:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from sabre at nondot dot org  2007-05-28 07:36 -------
isn't this also likely a 3.4 regression?


-- 


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


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

* [Bug c++/32121] [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
  2007-05-28  7:28 ` [Bug c++/32121] " pinskia at gcc dot gnu dot org
  2007-05-28  7:36 ` sabre at nondot dot org
@ 2007-05-28  7:54 ` pinskia at gcc dot gnu dot org
  2007-05-28 19:53 ` fang at csl dot cornell dot edu
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-28  7:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-05-28 07:54 -------
(In reply to comment #1)
> isn't this also likely a 3.4 regression?

Yes but I don't have 3.4 to test with right now.  Also the summary only
includes information about the currently maintained branches.  The known to
work/fail contain the full information about what versions this worked in and
failed in.


-- 


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


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

* [Bug c++/32121] [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-05-28  7:54 ` pinskia at gcc dot gnu dot org
@ 2007-05-28 19:53 ` fang at csl dot cornell dot edu
  2007-06-29 18:36 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fang at csl dot cornell dot edu @ 2007-05-28 19:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from fang at csl dot cornell dot edu  2007-05-28 19:53 -------
Yup, also fails with 3.4.0 (accepts-invalid).


-- 


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


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

* [Bug c++/32121] [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-05-28 19:53 ` fang at csl dot cornell dot edu
@ 2007-06-29 18:36 ` mmitchel at gcc dot gnu dot org
  2007-09-27 13:31 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-06-29 18:36 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/32121] [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-06-29 18:36 ` mmitchel at gcc dot gnu dot org
@ 2007-09-27 13:31 ` jakub at gcc dot gnu dot org
  2007-10-12  7:08 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-09-27 13:31 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-27 13:30:54
               date|                            |


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


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

* [Bug c++/32121] [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-09-27 13:31 ` jakub at gcc dot gnu dot org
@ 2007-10-12  7:08 ` jakub at gcc dot gnu dot org
  2007-10-12  8:36 ` [Bug c++/32121] [4.1/4.2 " jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-12  7:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2007-10-12 07:08 -------
Subject: Bug 32121

Author: jakub
Date: Fri Oct 12 07:07:46 2007
New Revision: 129253

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129253
Log:
        PR c++/32121
        * parser.c (cp_parser_compound_statement): Handle label-declarations
        at the beginning of the compound statement.
        (cp_parser_block_declaration): Issue diagnostics about __label__
        not at the beginning of a block.

        * g++.dg/ext/label4.C: Adjust error regexp.
        * g++.dg/ext/label6.C: Adjust error regexp.
        * g++.dg/ext/label7.C: New test.
        * g++.dg/ext/label8.C: New test.
        * g++.dg/ext/label9.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/label7.C
    trunk/gcc/testsuite/g++.dg/ext/label8.C
    trunk/gcc/testsuite/g++.dg/ext/label9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/label4.C
    trunk/gcc/testsuite/g++.dg/ext/label6.C


-- 


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


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

* [Bug c++/32121] [4.1/4.2 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-10-12  7:08 ` jakub at gcc dot gnu dot org
@ 2007-10-12  8:36 ` jakub at gcc dot gnu dot org
  2008-07-04 22:13 ` [Bug c++/32121] [4.2 " jsm28 at gcc dot gnu dot org
  2009-03-30 21:49 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-12  8:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2007-10-12 08:36 -------
Fixed on the trunk.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.0.1 4.1.0 4.2.0 4.3.0     |4.0.1 4.1.0 4.2.0
      Known to work|3.3.3                       |3.3.3 4.3.0
            Summary|[4.1/4.2/4.3 Regression] C++|[4.1/4.2 Regression] C++
                   |front-end accepts invalid   |front-end accepts invalid
                   |__label__ declarations      |__label__ declarations


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


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

* [Bug c++/32121] [4.2 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-10-12  8:36 ` [Bug c++/32121] [4.1/4.2 " jakub at gcc dot gnu dot org
@ 2008-07-04 22:13 ` jsm28 at gcc dot gnu dot org
  2009-03-30 21:49 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 22:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jsm28 at gcc dot gnu dot org  2008-07-04 22:12 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 Regression] C++    |[4.2 Regression] C++ front-
                   |front-end accepts invalid   |end accepts invalid
                   |__label__ declarations      |__label__ declarations
   Target Milestone|4.1.3                       |4.2.5


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


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

* [Bug c++/32121] [4.2 Regression] C++ front-end accepts invalid __label__ declarations
  2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-07-04 22:13 ` [Bug c++/32121] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-30 21:49 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 21:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2009-03-30 21:49 -------
Closing 4.2 branch, fixed in 4.3.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to fail|4.0.1 4.1.0 4.2.0           |4.0.1 4.1.0 4.2.0 4.2.5
         Resolution|                            |FIXED
   Target Milestone|4.2.5                       |4.3.0


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


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

end of thread, other threads:[~2009-03-30 21:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-28  7:27 [Bug c++/32121] New: [4.1/4.2/4.3 Regression] C++ front-end accepts invalid __label__ declarations pinskia at gcc dot gnu dot org
2007-05-28  7:28 ` [Bug c++/32121] " pinskia at gcc dot gnu dot org
2007-05-28  7:36 ` sabre at nondot dot org
2007-05-28  7:54 ` pinskia at gcc dot gnu dot org
2007-05-28 19:53 ` fang at csl dot cornell dot edu
2007-06-29 18:36 ` mmitchel at gcc dot gnu dot org
2007-09-27 13:31 ` jakub at gcc dot gnu dot org
2007-10-12  7:08 ` jakub at gcc dot gnu dot org
2007-10-12  8:36 ` [Bug c++/32121] [4.1/4.2 " jakub at gcc dot gnu dot org
2008-07-04 22:13 ` [Bug c++/32121] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 21:49 ` jsm28 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).