Skip to content

[clang-tidy] False negative readability-redundant-casting for cast to underlying enum type #111137

@chrchr-github

Description

@chrchr-github
#include <cstdint>

enum E : uint8_t { E0, E1 };
void g(uint8_t);

void f(uint8_t u, E e) {
    g((uint8_t)e); // FN

    g((uint8_t)u); // warning
}

https://godbolt.org/z/7Gcjrj64c

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