Skip to content

Doesn't allow incomplete type in member access #9843

@RealLitb

Description

@RealLitb
mannequin
Bugzilla Link 9471
Version trunk
OS Linux

Extended Description

Clang does not conform to the C Standard, it appears (GCC doesn't either):

struct A {
int a;
int x : (sizeof ((struct A*)0)->a * 8);
};

C doesn't forbid the left operand to be a pointer to incomplete type. The only requirement it has is that it's a pointer to a structure type, and that the right operand shall name a member of that structure. Both conditions are satisfied (C99: 6.5.2.3p2 and 6.2.1p7).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"invalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions