Skip to content

struct A { int a; }; struct A { int a; }; is rejected by clang -std=c23 #154096

@pascal-cuoq

Description

@pascal-cuoq

I have read #149965 but this seems like a different issue.

I understand that the program struct A { int a; }; struct A { int a; }; is valid C23. GCC 15.2 accepts it with -std=c23 and rejects it with -std=c17. It is rejected by Clang 20.1.0 with -std=c23:

<source>:5:8: error: redefinition of 'A'
    5 | struct A { int a; };
      |        ^
<source>:3:8: note: previous definition is here
    3 | struct A { int a; };
      |        ^
1 error generated.
Compiler returned: 1

CE link: https://gcc.godbolt.org/z/Ej7vzY4z5

Metadata

Metadata

Assignees

No one assigned

    Labels

    c23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"obsoleteIssues with old (unsupported) versions of LLVM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions