This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/10207: Empty structure initialization fails under C++ (but works under C)
- From: vencain at swbell dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 25 Mar 2003 08:18:32 -0000
- Subject: c++/10207: Empty structure initialization fails under C++ (but works under C)
- Reply-to: vencain at swbell dot net
>Number: 10207
>Category: c++
>Synopsis: Empty structure initialization fails under C++ (but works under C)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Mar 25 08:26:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Marcus VenCain
>Release: gcc version 3.2 20020903
>Organization:
>Environment:
(Red Hat Linux 8.0 3.2-7)
>Description:
Compiling the provided code works under C while producing the following using either gcc or g++:
parse error before `}' token
excess elements in aggregate initializer
The provided code is derived from headers designed for C programs that I must include but am not responsible for maintaining.
>How-To-Repeat:
typedef struct { } EmptyStruct;
typedef struct {EmptyStruct Empty;} DemoStruct;
void Func(void)
{
DemoStruct Demo;
Demo.Empty = (EmptyStruct) {};
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: