Skip to content

[clang-tidy] Improve documentation of bugprone-return-const-ref-from-parameter #107600

@chrchr-github

Description

@chrchr-github
const std::vector<int>& f(std::vector<int>&&) = delete; // bugprone-return-const-ref-from-parameter without this
const std::vector<int>& f(const std::vector<int>& v) { return v; }

The presence of a deleted overload prevents the warning, so maybe that should be mentioned in the documentation? Currently, there is no indication given to the user on how to address this warning.
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/return-const-ref-from-parameter.html

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