[clang-tools-extra] [clang-tidy] fix false positive in cppcoreguidelines-missing-std-forward (PR #77056)

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 15:18:06 PST 2024


HerrCai0907 wrote:

I agree to fix false positive reported in #68105. But for capturing in lambda be reference and do forward in lambda, It is just like create a record by ref instead of using forward and do forward in some member function. I don't think it is an expected false positive.
```c++
template<typename T>
void lambda_value_reference_capture_list_ref_2(T&& t) {
    [&t] { T other = std::forward<T>(t); };
}
```

@jcsxky @PiotrZSL Could you think again about this PR?

https://github.com/llvm/llvm-project/pull/77056


More information about the cfe-commits mailing list