Skip to content

[clang-tidy] Add new check to find redundant explicit constructor calls in function declarationsΒ #165328

@vbvictor

Description

@vbvictor

We already have check to catch these cases:

Foo bar() {
  Baz baz;
  return Foo(baz);
}

// transforms to:

Foo bar() {
  Baz baz;
  return {baz};
}

But we do not have check to catch these, see https://godbolt.org/z/1bdK7MG67:

void bar(Baz baz = Baz()) {
}

// transforms to:

void bar(Baz baz = {}) {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions