[libcxx] r265674 - Added a noexcept test
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 7 07:24:16 PDT 2016
Author: marshall
Date: Thu Apr 7 09:24:16 2016
New Revision: 265674
URL: http://llvm.org/viewvc/llvm-project?rev=265674&view=rev
Log:
Added a noexcept test
Modified:
libcxx/trunk/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp
Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp?rev=265674&r1=265673&r2=265674&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp Thu Apr 7 09:24:16 2016
@@ -17,12 +17,18 @@
int main()
{
+
bool a[] = {false, true, false, true};
bool* an = a + sizeof(a)/sizeof(a[0]);
std::vector<bool> v(a, an);
std::vector<bool>::reference r1 = v[0];
std::vector<bool>::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);
More information about the cfe-commits
mailing list