Skip to content

[clang] Implement CWG1693 to allow empty declarations in classes. #155538

@keinflue

Description

@keinflue

Clang rejects the following with -pedantic-errors in C++ (https://godbolt.org/z/jbaPKMqhs):

union X{;};
<source>:1:9: error: extra ';' inside a union [-Werror,-Wextra-semi]
    1 | union X{;};
      |         ^

However, I do not see anything prohibiting empty declarations in unions in general. They are only prohibited in anonymous unions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzercwg-issueAn issue that was filed to the Core Working Group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions