Issue 145032
Summary performance-unnecessary-value-param.AllowedTypes has inconsistent behavior when namespaces and type aliases are involved
Labels new issue
Assignees
Reporter nvartolomei
    Example:

```yaml
---
Checks: '-*,performance-*'
CheckOptions:
  - key: performance-unnecessary-value-param.AllowedTypes
    value: a::dt;
```

```cpp
namespace a {

struct dt {
  ~dt(){};
};

using a_dt_alias = a::dt;

} // namespace a

void f1(a::dt in) {};

void f2(a::a_dt_alias in) {};

```

```
warning: the parameter 'in' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
   13 | void f2(a::a_dt_alias in) {};
      |                       ^
      | const        &
```

If namespace is removed from code and from clang-tidy config then no warnings are generated.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to