Skip to content

[clang-tidy] "readability-implicit-bool-conversion" - should catch conversions that occur in a template function #143328

Open
@denzor200

Description

@denzor200
template<typename T1, typename T2>
bool compare(const T1& a, const T2& b) {
    return a == b ; // BAD - no warning
}

int main() {
    int a = 0;
    bool b = false;
    compare(a, b);
    return 0;
}

The full snippet here: https://godbolt.org/z/Yvs77cjej

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-tidyenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions