Issue |
83845
|
Summary |
clang-tidy doesn't report missing forward when one parameter is forwarded, but some other parameter isn't
|
Labels |
clang-tidy
|
Assignees |
|
Reporter |
geza-herman
|
In this example, `foo()` doesn't forward `y`, but clang-tidy doesn't report it.
If none of the parameters are forwarded (comment the `use(std::forward<X>(x));` line), then `cppcoreguidelines-missing-std-forward` correctly reports both parameters as non-forwarded. But if one of them is forwarded, then the other one is not reported.
```c++
#include <utility>
template <typename X>
void use(const X &x) {}
template <typename X, typename Y>
void foo(X &&x, Y &&y) {
use(std::forward<X>(x));
use(y);
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs