5 Commits

Author SHA1 Message Date
Danny Mösch
16b3e43a03
[clang-tidy] Ignore non-forwarded arguments if they are unused (#87832) 2024-04-08 23:54:29 +02:00
Qizhi Hu
8b326d5946
[clang-tidy] fix false negative in cppcoreguidelines-missing-std-forward (#83987)
Try to fix https://github.com/llvm/llvm-project/issues/83845
When `std::forward` is invoked in a function, make sure it uses correct
parameter by checking if the bounded `var` equals the parameter.

Co-authored-by: huqizhi <836744285@qq.com>
2024-03-06 09:27:32 +08:00
AMS21
7b11e2ec39
[clang-tidy] Fix cppcoreguidelines-missing-std-forward false positive for deleted functions (#83055)
Improved check by no longer giving false positives for deleted functions.
2024-02-27 19:35:11 +01:00
Qizhi Hu
d08482924e
[clang-tidy] fix false positive in cppcoreguidelines-missing-std-forward (#77056)
Parameter variable which is forwarded in lambda capture list or in body
by reference is reasonable and current version of this check produces
false positive on these cases. This patch try to fix the
[issue](https://github.com/llvm/llvm-project/issues/68105)

Co-authored-by: huqizhi <836744285@qq.com>
2024-01-06 19:50:00 +08:00
Chris Cotter
5902bb9584 [clang-tidy] Implement cppcoreguidelines F.19
Warns when a function accepting a forwarding reference does anything besides
forwarding (with std::forward) the parameter in the body of the function.

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D146921
2023-05-06 10:49:23 +00:00