| // RUN: %check_clang_tidy %s performance-noexcept-move-constructor %t |
| // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: move constructors should be marked noexcept [performance-noexcept-move-constructor] |
| // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: move assignment operators should |
| static constexpr bool kFalse = false; |
| B(B &&) noexcept(kFalse); |
| // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: noexcept specifier on the move constructor evaluates to 'false' [performance-noexcept-move-constructor] |
| OK1 &operator=(OK1 &&) noexcept; |
| static constexpr bool kTrue = true; |
| OK2(OK2 &&) noexcept(true) {} |
| OK2 &operator=(OK2 &&) noexcept(kTrue) { return *this; } |
| OK3(OK3 &&) noexcept(false) {} |
| OK3 &operator=(OK3 &&) = delete; |
| OK4(OK4 &&) noexcept = default; |
| OK4 &operator=(OK4 &&) noexcept = default; |
| OK5(OK5 &&) noexcept(true) = default; |
| OK5 &operator=(OK5 &&) noexcept(true) = default; |