Mark LWG issue 2250 as complete

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271475 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-06-02 04:03:31 +00:00
parent 400d356341
commit e98bd2a486
10 changed files with 119 additions and 95 deletions

View File

@@ -17,8 +17,11 @@
#include <thread>
#include <atomic>
#include <system_error>
#include <cassert>
#include "test_macros.h"
std::atomic_bool done(false);
class G
@@ -57,6 +60,8 @@ public:
int G::n_alive = 0;
bool G::op_run = false;
void foo() {}
int main()
{
{
@@ -70,4 +75,16 @@ int main()
assert(G::n_alive == 1);
}
assert(G::n_alive == 0);
#ifndef TEST_HAS_NO_EXCEPTION
{
std::thread t0(foo);
assert(t0.joinable());
t0.detach();
assert(!t0.joinable());
try {
t0.detach();
} catch (std::system_error const& ec) {
}
}
#endif
}

View File

@@ -19,6 +19,9 @@
#include <new>
#include <cstdlib>
#include <cassert>
#include <system_error>
#include "test_macros.h"
class G
{
@@ -42,6 +45,8 @@ public:
int G::n_alive = 0;
bool G::op_run = false;
void foo() {}
int main()
{
{
@@ -50,5 +55,23 @@ int main()
assert(t0.joinable());
t0.join();
assert(!t0.joinable());
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
t0.join();
assert(false);
} catch (std::system_error const&) {
}
#endif
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::thread t0(foo);
t0.detach();
try {
t0.join();
assert(false);
} catch (std::system_error const&) {
}
}
#endif
}

View File

@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// template <class charT>
// explicit bitset(const charT* str,
// typename basic_string<charT>::size_type n = basic_string<charT>::npos,
@@ -18,22 +17,19 @@
#include <algorithm> // for 'min' and 'max'
#include <stdexcept> // for 'invalid_argument'
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
#endif
#include "test_macros.h"
template <std::size_t N>
void test_char_pointer_ctor()
{
{
try
{
std::bitset<N> v("xxx1010101010xxxx");
assert(false);
}
catch (std::invalid_argument&)
{
}
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
std::bitset<N> v("xxx1010101010xxxx");
assert(false);
}
catch (std::invalid_argument&) {}
#endif
}
{

View File

@@ -12,21 +12,26 @@
#include <bitset>
#include <cassert>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
#endif
#include "test_macros.h"
template <std::size_t N>
void test_default_ctor()
{
{
_LIBCPP_CONSTEXPR std::bitset<N> v1;
assert(v1.size() == N);
for (std::size_t i = 0; i < N; ++i)
assert(v1[i] == false);
TEST_CONSTEXPR std::bitset<N> v1;
assert(v1.size() == N);
for (std::size_t i = 0; i < N; ++i)
assert(v1[i] == false);
}
#if TEST_STD_VER >= 11
{
constexpr std::bitset<N> v1;
static_assert(v1.size() == N, "");
}
#endif
}
int main()
{
test_default_ctor<0>();

View File

@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// test bitset(string, pos, n, zero, one);
#include <bitset>
@@ -15,67 +14,60 @@
#include <algorithm> // for 'min' and 'max'
#include <stdexcept> // for 'invalid_argument'
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
#endif
#include "test_macros.h"
template <std::size_t N>
void test_string_ctor()
{
#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
try {
std::string str("xxx1010101010xxxx");
std::bitset<N> v(str, str.size()+1, 10);
assert(false);
}
catch (std::out_of_range&)
{
}
}
{
try {
std::string str("xxx1010101010xxxx");
std::bitset<N> v(str, 2, 10);
assert(false);
}
catch (std::invalid_argument&)
{
}
}
{
try {
std::string str("xxxbababababaxxxx");
std::bitset<N> v(str, 2, 10, 'a', 'b');
assert(false);
}
catch (std::invalid_argument&)
{
}
}
#endif // TEST_HAS_NO_EXCEPTIONS
{
std::string str("xxx1010101010xxxx");
std::bitset<N> v(str, str.size()+1, 10);
assert(false);
std::bitset<N> v(str, 3, 10);
std::size_t M = std::min<std::size_t>(N, 10);
for (std::size_t i = 0; i < M; ++i)
assert(v[i] == (str[3 + M - 1 - i] == '1'));
for (std::size_t i = 10; i < N; ++i)
assert(v[i] == false);
}
catch (std::out_of_range&)
{
}
}
{
try
{
std::string str("xxx1010101010xxxx");
std::bitset<N> v(str, 2, 10);
assert(false);
}
catch (std::invalid_argument&)
{
}
}
{
std::string str("xxx1010101010xxxx");
std::bitset<N> v(str, 3, 10);
std::size_t M = std::min<std::size_t>(N, 10);
for (std::size_t i = 0; i < M; ++i)
assert(v[i] == (str[3 + M - 1 - i] == '1'));
for (std::size_t i = 10; i < N; ++i)
assert(v[i] == false);
}
{
try
{
std::string str("xxxbababababaxxxx");
std::bitset<N> v(str, 2, 10, 'a', 'b');
assert(false);
}
catch (std::invalid_argument&)
{
}
}
{
std::string str("xxxbababababaxxxx");
std::bitset<N> v(str, 3, 10, 'a', 'b');
std::size_t M = std::min<std::size_t>(N, 10);
for (std::size_t i = 0; i < M; ++i)
assert(v[i] == (str[3 + M - 1 - i] == 'b'));
for (std::size_t i = 10; i < N; ++i)
assert(v[i] == false);
std::bitset<N> v(str, 3, 10, 'a', 'b');
std::size_t M = std::min<std::size_t>(N, 10);
for (std::size_t i = 0; i < M; ++i)
assert(v[i] == (str[3 + M - 1 - i] == 'b'));
for (std::size_t i = 10; i < N; ++i)
assert(v[i] == false);
}
}

View File

@@ -13,22 +13,26 @@
#include <cassert>
#include <algorithm> // for 'min' and 'max'
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
#endif
#include "test_macros.h"
template <std::size_t N>
void test_val_ctor()
{
{
_LIBCPP_CONSTEXPR std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
assert(v.size() == N);
unsigned M = std::min<std::size_t>(N, 64);
for (std::size_t i = 0; i < M; ++i)
assert(v[i] == (i & 1));
for (std::size_t i = M; i < N; ++i)
assert(v[i] == false);
TEST_CONSTEXPR std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
assert(v.size() == N);
unsigned M = std::min<std::size_t>(N, 64);
for (std::size_t i = 0; i < M; ++i)
assert(v[i] == (i & 1));
for (std::size_t i = M; i < N; ++i)
assert(v[i] == false);
}
#if TEST_STD_VER >= 11
{
constexpr std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
static_assert(v.size() == N, "");
}
#endif
}
int main()

View File

@@ -14,10 +14,6 @@
#include <cstdlib>
#include <cassert>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
#endif
template <std::size_t N>
std::bitset<N>
make_bitset()

View File

@@ -13,11 +13,6 @@
#include <bitset>
#include <cassert>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
#endif
template <std::size_t N>
void test_reset_one()
{

View File

@@ -14,10 +14,6 @@
#include <cstdlib>
#include <cassert>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
#endif
template <std::size_t N>
std::bitset<N>
make_bitset()

View File

@@ -176,7 +176,7 @@
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2224">2224</a></td><td>Ambiguous status of access to non-live objects</td><td>Kona</td><td>Complete</td></tr>
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2234">2234</a></td><td><tt>assert()</tt> should allow usage in constant expressions</td><td>Kona</td><td>Complete</td></tr>
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2244">2244</a></td><td>Issue on <tt>basic_istream::seekg</tt></td><td>Kona</td><td>Complete</td></tr>
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2250">2250</a></td><td>Follow-up On Library Issue 2207</td><td>Kona</td><td></td></tr>
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2250">2250</a></td><td>Follow-up On Library Issue 2207</td><td>Kona</td><td>Complete</td></tr>
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2259">2259</a></td><td>Issues in 17.6.5.5 rules for member functions</td><td>Kona</td><td>Complete</td></tr>
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2273">2273</a></td><td><tt>regex_match</tt> ambiguity</td><td>Kona</td><td></td></tr>
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2336">2336</a></td><td><tt>is_trivially_constructible/is_trivially_assignable</tt> traits are always false</td><td>Kona</td><td></td></tr>