llvm / llvm/llvm-project

[clang-tidy] readability-redundant-casting should support shared pointer casting

Open
#168,280 1 comment 0 reactions 0 assignees View on GitHub
clang-tidy enhancement
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```
std::shared_ptr value = std::make_shared(42);
std::shared_ptr result = std::static_pointer_cast(value); // redindant static_pointer_cast
```

```
boost::shared_ptr value = boost::make_shared(42);
boost::shared_ptr result = boost::static_pointer_cast(value); // redindant static_pointer_cast
```

Contributor guide

Open the contributing guide

Research direction

Start at the clang-tidy readability-redundant-casting check named in the issue and reproduce the std::shared_ptr and boost::shared_ptr examples. Done means redundant static_pointer_cast calls in both examples are recognized by the check, with coverage for the demonstrated cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.