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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Richard Biener
<rgue...@gcc.gnu.org>:

https://gcc.gnu.org/g:60fed79c1e9a968eaedf292b298d19c9475ad37a

commit r12-8683-g60fed79c1e9a968eaedf292b298d19c9475ad37a
Author: Marek Polacek <pola...@redhat.com>
Date:   Thu Apr 28 16:50:06 2022 -0400

    c++: pedwarn for empty unnamed enum in decl [PR67048]

    [dcl.dcl]/5 says that

      enum { };

    is ill-formed, and since r197742 we issue a pedwarn.  However, the
    pedwarn also fires for

       enum { } x;

    which is well-formed.  So only warn when {} is followed by a ;.  This
    should be correct since you can't have "enum {}, <whatever>" -- that
    produces "expected unqualified-id before ',' token".

            PR c++/67048

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed
enum
            only when it's followed by a semicolon.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/enum42.C: New test.

    (cherry picked from commit fd0d3e9121c5aa65150d242676be6bbdc8d4a92a)

Reply via email to