[libcxx] r348660 - Update a couple of vector<bool> tests that were testing libc++-specific bahavior. Thanks to Andrey Maksimov for the catch.
Marshall Clow
mclow.lists at gmail.com
Fri Dec 7 14:16:26 PST 2018
Author: marshall
Date: Fri Dec 7 14:16:26 2018
New Revision: 348660
URL: http://llvm.org/viewvc/llvm-project?rev=348660&view=rev
Log:
Update a couple of vector<bool> tests that were testing libc++-specific bahavior. Thanks to Andrey Maksimov for the catch.
Modified:
libcxx/trunk/test/std/containers/sequences/vector.bool/construct_default.pass.cpp
libcxx/trunk/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
libcxx/trunk/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/construct_default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/construct_default.pass.cpp?rev=348660&r1=348659&r2=348660&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/construct_default.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/construct_default.pass.cpp Fri Dec 7 14:16:26 2018
@@ -7,10 +7,15 @@
//
//===----------------------------------------------------------------------===//
-// <vector>
// vector<bool>
-// vector(const Alloc& = Alloc());
+// vector();
+// vector(const Alloc&);
+
+// This tests a conforming extension
+// For vector<>, this was added to the standard by N4258,
+// but vector<bool> was not changed.
+
#include <vector>
#include <cassert>
@@ -24,9 +29,9 @@ void
test0()
{
#if TEST_STD_VER > 14
- static_assert((noexcept(C{})), "" );
+ LIBCPP_STATIC_ASSERT((noexcept(C{})), "" );
#elif TEST_STD_VER >= 11
- static_assert((noexcept(C()) == noexcept(typename C::allocator_type())), "" );
+ LIBCPP_STATIC_ASSERT((noexcept(C()) == noexcept(typename C::allocator_type())), "" );
#endif
C c;
LIBCPP_ASSERT(c.__invariants());
@@ -45,9 +50,9 @@ void
test1(const typename C::allocator_type& a)
{
#if TEST_STD_VER > 14
- static_assert((noexcept(C{typename C::allocator_type{}})), "" );
+ LIBCPP_STATIC_ASSERT((noexcept(C{typename C::allocator_type{}})), "" );
#elif TEST_STD_VER >= 11
- static_assert((noexcept(C(typename C::allocator_type())) == std::is_nothrow_copy_constructible<typename C::allocator_type>::value), "" );
+ LIBCPP_STATIC_ASSERT((noexcept(C(typename C::allocator_type())) == std::is_nothrow_copy_constructible<typename C::allocator_type>::value), "" );
#endif
C c(a);
LIBCPP_ASSERT(c.__invariants());
Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp?rev=348660&r1=348659&r2=348660&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp Fri Dec 7 14:16:26 2018
@@ -6,6 +6,7 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
// <vector>
@@ -13,8 +14,9 @@
// noexcept(is_nothrow_default_constructible<allocator_type>::value);
// This tests a conforming extension
+// For vector<>, this was added to the standard by N4258,
+// but vector<bool> was not changed.
-// UNSUPPORTED: c++98, c++03
#include <vector>
#include <cassert>
@@ -40,7 +42,6 @@ int main()
typedef std::vector<bool, test_allocator<bool>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
-#endif // _LIBCPP_VERSION
{
typedef std::vector<bool, other_allocator<bool>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
@@ -49,4 +50,5 @@ int main()
typedef std::vector<bool, some_alloc<bool>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp?rev=348660&r1=348659&r2=348660&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp Fri Dec 7 14:16:26 2018
@@ -6,15 +6,15 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
// <vector>
// vector()
// noexcept(is_nothrow_default_constructible<allocator_type>::value);
-// This tests a conforming extension
+// This *was* a conforming extension, but it was adopted in N4258.
-// UNSUPPORTED: c++98, c++03
#include <vector>
#include <cassert>
More information about the libcxx-commits
mailing list