Skip to content

[clang] compound literals within local structs should not require constant initialization #107562

Open
@ghost

Description

Compiler Explorer

// [clang] error: initializer element is not a compile-time constant
// [ gcc ] ok

/* const */ size_t i;

         static_assert (!! sizeof ((size_t) {i}));    // OK
struct { static_assert (!! sizeof ((size_t) {i})); }; // KO

Metadata

Metadata

Assignees

No one assigned

    Labels

    cclang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions