Skip to content

[clang-tidy] Extend modernize-use-designated-initializers to cover per-member initialization #165210

@chrchr-github

Description

@chrchr-github
struct S {
    int a;
    int b;
};

S f() {
    S s;
    s.a = 0;
    s.b = 1;
    //S s{ .a = 0, .b = 1 }; // fix-it
    return s;
}

https://godbolt.org/z/rGvrzasYn

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions