isocpp / isocpp/CppCoreGuidelines
Flagging all uses of static downcasts seems overly draconian, and produces false positives.
Open
@hsutter is already working on this.
Since Dec 21, 2015.
- Dominant language
- CSS
- Stars
- 45.3k
- Forks
- 5.6k
- PR merge metrics
- No merged PRs in 30d
Description
In its enforcement,
C.146: Use dynamic_cast where class hierarchy navigation is unavoidable
states
"Enforcement: Flag all uses of static_cast for downcasts, including C-style casts that perform a static_cast."
What about static downcasts that are on the scale between almost-always-safe to guaranteed-to-be-safe?
I'm specifically talking about CRTP base templates. The enforcement of this rule is a false positive
there.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.