public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100353] New: Accepts invalid label
@ 2021-04-30 12:02 rguenth at gcc dot gnu.org
  2021-04-30 12:03 ` [Bug c/100353] [11/12 Regression] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-30 12:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100353

            Bug ID: 100353
           Summary: Accepts invalid label
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

GCC 11 started to accept

void b()
{
  int d;
e:
  int f;
}

which was previously rejected as

t.c: In function 'b':
t.c:5:3: error: a label can only be part of a statement and a declaration is
not a statement
    5 |   int f;
      |   ^~~
t.c:4:1: error: label at end of compound statement
    4 | e:
      | ^

and which clang also rejects:

t.c:5:3: error: expected expression
  int f;
  ^
1 error generated.

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

* [Bug c/100353] [11/12 Regression] Accepts invalid label
  2021-04-30 12:02 [Bug c/100353] New: Accepts invalid label rguenth at gcc dot gnu.org
@ 2021-04-30 12:03 ` rguenth at gcc dot gnu.org
  2021-04-30 13:25 ` harald at gigawatt dot nl
  2021-04-30 17:22 ` jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-30 12:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100353

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.2
                 CC|                            |jsm28 at gcc dot gnu.org
           Keywords|                            |accepts-invalid
            Summary|Accepts invalid label       |[11/12 Regression] Accepts
                   |                            |invalid label

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

* [Bug c/100353] [11/12 Regression] Accepts invalid label
  2021-04-30 12:02 [Bug c/100353] New: Accepts invalid label rguenth at gcc dot gnu.org
  2021-04-30 12:03 ` [Bug c/100353] [11/12 Regression] " rguenth at gcc dot gnu.org
@ 2021-04-30 13:25 ` harald at gigawatt dot nl
  2021-04-30 17:22 ` jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: harald at gigawatt dot nl @ 2021-04-30 13:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100353

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #1 from Harald van Dijk <harald at gigawatt dot nl> ---
This was intentional, this will become valid C so this is now only diagnosed
with -pedantic and only in modes before C2x:
https://gcc.gnu.org/onlinedocs/gcc/Mixed-Labels-and-Declarations.html

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

* [Bug c/100353] [11/12 Regression] Accepts invalid label
  2021-04-30 12:02 [Bug c/100353] New: Accepts invalid label rguenth at gcc dot gnu.org
  2021-04-30 12:03 ` [Bug c/100353] [11/12 Regression] " rguenth at gcc dot gnu.org
  2021-04-30 13:25 ` harald at gigawatt dot nl
@ 2021-04-30 17:22 ` jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2021-04-30 17:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100353

Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Joseph S. Myers <jsm28 at gcc dot gnu.org> ---
C2x feature, not a bug.

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

end of thread, other threads:[~2021-04-30 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30 12:02 [Bug c/100353] New: Accepts invalid label rguenth at gcc dot gnu.org
2021-04-30 12:03 ` [Bug c/100353] [11/12 Regression] " rguenth at gcc dot gnu.org
2021-04-30 13:25 ` harald at gigawatt dot nl
2021-04-30 17:22 ` jsm28 at gcc dot gnu.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).