Skip to content

[clang-tidy] Check request: performance-incorrect-move-with-smart-pointer-cast #146805

@denzor200

Description

@denzor200

Need a check that will find incorrect usage of std::move with smart pointer casts (e.g., std::static_pointer_cast, std::dynamic_pointer_cast, their boost analogues, etc).

BEFORE:

std::shared_ptr<B> b = std::move(std::dynamic_pointer_cast<B>(a));

AFTER:

std::shared_ptr<B> b = std::dynamic_pointer_cast<B>(std::move(a));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions