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

            Bug ID: 88477
           Summary: Variable with type completed in initializer not
                    allowed.
           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 program (prog.c):

  int main()
  {
    struct S s = (struct S { int x; }) { .x = 1 };
  }

The type of s is completed in the initializer, so this should be legit.

I get an unexpected error however when compiling with the following command
line:

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

Note that clang compiles this program without any errors.

Link to online compiler:

  https://wandbox.org/permlink/WyMDk6tDyTwORPVp

Reply via email to