diff --git a/libcxx/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp index d76d4ed2c680..ff7366993a28 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp @@ -17,12 +17,18 @@ int main() { + bool a[] = {false, true, false, true}; bool* an = a + sizeof(a)/sizeof(a[0]); std::vector v(a, an); std::vector::reference r1 = v[0]; std::vector::reference r2 = v[3]; + +#if __has_feature(cxx_noexcept) + static_assert((noexcept(v.swap(r1,r2))), ""); +#endif + assert(!r1); assert( r2); v.swap(r1, r2);