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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54110
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54110&action=edit
gcc13-pr108043.patch

Untested fix.
Both C99 and C2X say for compound literals:
The type name shall specify an object type or an array of unknown size, but not
a variable length array type.
resp.
The type name shall specify a complete object type or an array of unknown size,
but not a variable length array type.
Before the recent changes it actually wasn't that important to diagnose
non-object type because the initializer had to be non-empty in that case and
there was no way to specify initializer expression of function type as it would
promote to function pointer type, so we'd error differently.
But when empty initializers are allowed, there is nothing to diagnose that.

Reply via email to