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

            Bug ID: 88525
           Summary: gcc thinks that C11 program does not declare anything
                    but it does.
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders.granlund.0 at gmail dot com
  Target Milestone: ---

Consider the following C11 program (prog.c):

  int main()
  {
    struct { enum { a } b; };
  }

This program does NOT violate rule 6.7.2 in the C11 standard since the
declaration declares a member of an enum (a).

I tried to compile it with the following command line:

  gcc prog.c -std=c11 -pedantic-errors

I get the following unexpected error message:

  error: unnamed struct/union that defines no instances

This is wrong. The declaration does declare the enum member  a  and according
to the C11 standard it does not need to declare anything else.

Reply via email to