Skip to content

Pre-C23 check in for declaration is incorrect #149633

@Halalaluyafail3

Description

@Halalaluyafail3

Clang incorrectly rejects the following statement pre-C23 with -pedantic-errors:

for(_Static_assert(1,"");0;);

This is valid, yet Clang rejects it anyways. Additionally, Clang incorrectly allows the following:

for (enum fred { jim, sheila = 10 } i = jim; i < sheila; i++);

This is invalid and is mentioned specifically in DR277.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepts-invalidcclang:frontendLanguage frontend issues, e.g. anything involving "Sema"diverges-from:gccDoes the clang frontend diverge from gcc on this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions