Issue |
68101
|
Summary |
[clang-tidy] performance-noexcept-move-constructor and performance-noexcept-swap do not handle conditional noexcept properly
|
Labels |
clang-tidy
|
Assignees |
|
Reporter |
jpboivin
|
Hello,
I've tested clang-tidy 17 on some codebases, and there seems to be false positives (except if I'm missing something) with `performance-noexcept-move-constructor` and `performance-noexcept-swap` checks, at least in templated code that annotates the move constructor or swap with a conditional `noexcept` (when using traits, otherwise it is properly handled).
I've written an extremely simple piece of code that triggers the issue:
https://godbolt.org/z/59EhaEeda
```
[<source>:7:37: warning: noexcept specifier on the move constructor evaluates to 'false' [performance-noexcept-move-constructor]](_javascript_:;)
7 | Container(Container&&) noexcept(std::is_nothrow_move_constructible_v<T>);
| ^
[<source>:8:42: warning: noexcept specifier on swap function evaluates to 'false' [performance-noexcept-swap]](_javascript_:;)
8 | void swap(Container& other) noexcept(std::is_nothrow_swappable_v<T>);
| ^
2 warnings generated.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs