Skip to content

[Clang][C23] Compound literal with constexpr (or any other) storage specifier emits syntax error #129365

@euclidianAce

Description

@euclidianAce

I couldn't find a specific issue on this, but it is part of C23. See 6.5.3.6p7 and 6.6.3p6

Simple repro

int main() {
	int x = (constexpr int){1};
}
$ clang repro.c -std=c23 -Wall -Wextra -pedantic
repro.c:2:11: error: expected expression
    2 |         int x = (constexpr int){1};
      |                  ^
1 error generated.
$ clang --version
clang version 19.1.7
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/azdqrk7n19ipjh2yav5kllzll7a49phn-clang-19.1.7/bin

Looking through clang/test/Sema/constexpr.c this case wasn't covered

Metadata

Metadata

Assignees

No one assigned

    Labels

    c23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions