================
@@ -181,6 +183,25 @@ struct O : virtual IntWrapper, ThrowOnAnything {
   // CHECK-FIXES: O &operator=(O &&)  noexcept = default;
 };
 
+struct P {
+  P() = default;
+
+  P(P &&) = default;
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: move constructors should be 
marked noexcept [performance-noexcept-move-constructor]
+  // CHECK-FIXES: P(P &&)  noexcept = default;
+  P &operator=(P &&) = default;
----------------
zeyi2 wrote:

Nit: The new ·P::operator=· expectation already passes with the pre-patch 
checker ([Godbolt](https://godbolt.org/z/Kx4hcvqdv)). Could we add a 
move-assignment case that fails before this change? For example:

```
#include <string>
#include <vector>

struct WithVectorFirst {
  std::vector<std::string> cache;
  ThrowOnAnything value;
  WithVectorFirst& operator=(WithVectorFirst&&) = default;
  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: move assignment operators should 
be marked noexcept 
};

void use(WithVectorFirst& a, WithVectorFirst& b) {
  a = std::move(b);
}
```

https://github.com/llvm/llvm-project/pull/226488
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to