llvm / llvm/llvm-project

[clang-tidy][false-negative] `performance-move-const-arg` does not work in function templates

Open
#174,223 2 comments 0 reactions 0 assignees View on GitHub
clang-tidy false-negative
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Demo: https://godbolt.org/z/bEKdE6Gxs

You'll notice that only the control case was caught.

```
:14:11: warning: std::move of the const variable 'control_case' of the trivially-copyable type 'const int' has no effect; remove std::move() [performance-move-const-arg]
14 | tgt = std::move(control_case);
| ^~~~~~~~~~ ~
1 warning generated.
```

Current trunk: c777c60419080c09d76385568dd00101a76b7c10

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.