[clang-tools-extra] Add flag to specify an alternative to std::forward (PR #138755)

Dimitrije Dobrota via cfe-commits cfe-commits at lists.llvm.org
Thu May 8 08:28:21 PDT 2025


DimitrijeDobrota wrote:

> LGTM. It looks similar as #138757. could you add a test for both PR.

I have the issue where I want to test the `custom_move` and I need check to pass only for `-check-suffix=,MOVEFUNCTION` and fail for everything else, since it still expects `::std::move`. I am not sure how to write this. Apart from this, I've managed to add necessary checks for the existing set of test cases.

```c++
void move_with_custom(Obj&& o) {
  // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: rvalue reference parameter 'o' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
  // CHECK-MESSAGES-MOVEFUNCTION: no error in this case

  Obj other{custom_move(o)};
```

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


More information about the cfe-commits mailing list