Detects instances where std::forward is called with a different type as an
argument compared to the type specified as the template parameter.
Extracted from D144347.
Paths
| Differential D154999
[clang-tidy] Add bugprone-std-forward-type-mismatch check Needs ReviewPublic Authored by PiotrZSL on Jul 11 2023, 11:54 AM.
Details
Diff Detail
Event TimelineEugene.Zelenko added inline comments.
ccotter added inline comments.
Revision Contents
Diff 539226 clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
clang-tools-extra/clang-tidy/bugprone/StdForwardTypeMismatchCheck.h
clang-tools-extra/clang-tidy/bugprone/StdForwardTypeMismatchCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/bugprone/std-forward-type-mismatch.rst
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/checkers/bugprone/std-forward-type-mismatch.cpp
|
How confident are we to suggest a fixit to use static_cast? Although equivalent, the code could be incorrect to begin with and merit manual review to decide what the correct cast really should be.