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

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).