This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/10207: Empty structure initialization fails under C++ (but works under C)


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]