Skip to content

[clang-tidy] False negative readability-redundant-casting with function pointer #170476

@chrchr-github

Description

@chrchr-github
int f();
int g() {
    int (*fp)() = (int(*)())f; // redundant cast
    return fp();
}

https://godbolt.org/z/h8brsnq4z

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions