Skip to content

[clang-tidy] readability-use-std-min-max drops comments #121613

Open
@LegalizeAdulthood

Description

@LegalizeAdulthood

Suppose you have the following code:

        if (box_depth > max_depth) // limit the depth to max
        {
            box_depth = max_depth;
        }

after applying readability-use-std-min-max, the code is:

        box_depth = std::min(box_depth, max_depth);

the explaining comment is dropped.

The expected code is:

        box_depth = std::min(box_depth, max_depth); // limit the depth to max

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorclang-tidy

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions