diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp index c9c1bac2fb4a..e2b0d691889c 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp @@ -49,13 +49,14 @@ struct ThrowingT { --throw_after_n; } - ThrowingT(const ThrowingT&) { + ThrowingT(const ThrowingT& rhs) : throw_after_n_(rhs.throw_after_n_) { if (throw_after_n_ == nullptr || *throw_after_n_ == 0) throw 1; --*throw_after_n_; } - ThrowingT& operator=(const ThrowingT&) { + ThrowingT& operator=(const ThrowingT& rhs) { + throw_after_n_ = rhs.throw_after_n_; if (throw_after_n_ == nullptr || *throw_after_n_ == 0) throw 1; --*throw_after_n_;