[Issue 21961] New: importC: Error: no struct-declarator-list for struct
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon May 24 09:09:29 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21961
Issue ID: 21961
Summary: importC: Error: no struct-declarator-list for struct
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: ibuclaw at gdcproject.org
Empty structs are accepted as valid C, even though the behaviour is undefined.
---
struct agg
{
};
---
C99 6.7.2.1-8:
The presence of a struct-declaration-list in a struct-or-union-specifier
declares a new type, within a translation unit. The struct-declaration-list is
a sequence of declarations for the members of the structure or union. If the
struct-declaration-list does not contain any named members, either directly or
via an anonymous structure or anonymous union, the behavior is undefined. The
type is incomplete until immediately after the } that terminates the list, and
complete thereafter.
--
More information about the Digitalmars-d-bugs
mailing list