Closed
Description
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]]
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]]
8 | void swap(Container& other) noexcept(std::is_nothrow_swappable_v<T>);
| ^
2 warnings generated.