Skip to content

[clang-tidy] readability-simplify-boolean-expr should handle if statements with init statements #172180

@denzor200

Description

@denzor200

Problem: readability-simplify-boolean-expr doesn't simplify conditions in if statements with init statements.

Examples:

  • if (auto x = f(); x != nullptr)if (auto x = f())
  • if (bool b = g(); b == true)if (bool b = g())

Request: Extend the check to handle C++17 if-with-initializer syntax.

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