public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/107164] No pedantic warning for declaration just referring to a previously-declared enum type
Date: Tue, 18 Oct 2022 23:26:37 +0000	[thread overview]
Message-ID: <bug-107164-4-YnQlytoHFP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107164-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joseph Myers <jsm28@gcc.gnu.org>:

https://gcc.gnu.org/g:f5f1d92fe2e1d75c3fae34497929a1965af704ae

commit r13-3366-gf5f1d92fe2e1d75c3fae34497929a1965af704ae
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Oct 18 23:25:47 2022 +0000

    c: Diagnose "enum tag;" after definition [PR107164]

    As noted in bug 101764, a declaration "enum tag;" is invalid in
    standard C after a definition, as well as when no definition is
    visible; we had a pedwarn-if-pedantic for the forward declaration
    case, but were missing one for the other case.  Add that missing
    diagnostic (if pedantic only).

    (These diagnostics will need to be appropriately conditioned when
    support is added for C2x enums with fixed underlying type, since "enum
    tag : type;" is OK both before and after a definition.)

    Bootstrapped with no regressions for x86_64-pc-linux-gnu.

            PR c/107164

    gcc/c/
            * c-decl.cc (shadow_tag_warned): If pedantic, diagnose "enum tag;"
            with previous declaration visible.

    gcc/testsuite/
            * gcc.dg/c99-tag-4.c, gcc.dg/c99-tag-5.c, gcc.dg/c99-tag-6.c: New
            tests.

  parent reply	other threads:[~2022-10-18 23:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 21:57 [Bug c/107164] New: " stephenheumann at gmail dot com
2022-10-05 22:05 ` [Bug c/107164] " pinskia at gcc dot gnu.org
2022-10-18 23:26 ` cvs-commit at gcc dot gnu.org [this message]
2022-10-18 23:27 ` jsm28 at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107164-4-YnQlytoHFP@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).