Skip to content

An anonymous union member is not a non-static data member on grammar #4939

@xmh0511

Description

@xmh0511

[class.mem.general] p3 explicitly says

A data member is a non-function member introduced by a member-declarator.

While [class.union.anon] p1 says

A union of the form union { member-specification } ; is called an anonymous union; it defines an unnamed type and an unnamed object of that type called an anonymous union member if it is a non-static data member or an anonymous union variable otherwise.

Such two rules contradict each other. Maybe, we should say

An anonymous union behaves as if it were replaced by

union { member-specification } unnamed;

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-ImportantMisapplication of paper, malformed code, internal inconsistencies

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions