[libcxx] r300417 - Cleanup one more <forward_list> test
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 15 21:05:15 PDT 2017
Author: ericwf
Date: Sat Apr 15 23:05:15 2017
New Revision: 300417
URL: http://llvm.org/viewvc/llvm-project?rev=300417&view=rev
Log:
Cleanup one more <forward_list> test
Removed:
libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp
Modified:
libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
Removed: libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp?rev=300416&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp (removed)
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <forward_list>
-
-// explicit forward_list(size_type n);
-
-#include <forward_list>
-#include <cassert>
-
-#include "DefaultOnly.h"
-
-int main()
-{
- {
- typedef DefaultOnly T;
- typedef std::forward_list<T> C;
- unsigned N = 10;
- C c = N;
- unsigned n = 0;
- for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- assert(*i == T());
-#else
- ;
-#endif
- assert(n == N);
- }
-}
Modified: libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp?rev=300417&r1=300416&r2=300417&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp Sat Apr 15 23:05:15 2017
@@ -36,6 +36,11 @@ void check_allocator(unsigned n, Allocat
int main()
{
+ { // test that the ctor is explicit
+ typedef std::forward_list<DefaultOnly> C;
+ static_assert((std::is_constructible<C, size_t>::value), "");
+ static_assert((!std::is_convertible<size_t, C>::value), "");
+ }
{
typedef DefaultOnly T;
typedef std::forward_list<T> C;
More information about the cfe-commits
mailing list