Issue |
64303
|
Summary |
performance-noexcept-swap is missing a method signature check
|
Labels |
clang-tidy
|
Assignees |
|
Reporter |
SunBlack
|
Clang-Tidy 17 will introduce a new check (see D148697) `performance-noexcept-swap`. I tried this check on our code and it has one correct hint and one false positive:
```cpp
void MyClass::swap() // Warning here: "swap functions should be marked noexcept"
{
m_swapped = !m_swapped;
}
```
It is correct that this method could be `noexcept`, but we have disabled `modernize-use-noexcept`, so my expectation would be, that here no warning is generated - and only in case of real swap methods the warning will be triggered.
Basically I would except, that the check tests the method signature whether it's matches sth. like `void swap( T& a, T& b )` (so has two parameter of same type like the [std::swap](https://en.cppreference.com/w/cpp/algorithm/swap) expects)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs