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:
@@ -17,8 +17,11 @@
|
|||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <system_error>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
std::atomic_bool done(false);
|
std::atomic_bool done(false);
|
||||||
|
|
||||||
class G
|
class G
|
||||||
@@ -57,6 +60,8 @@ public:
|
|||||||
int G::n_alive = 0;
|
int G::n_alive = 0;
|
||||||
bool G::op_run = false;
|
bool G::op_run = false;
|
||||||
|
|
||||||
|
void foo() {}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@@ -70,4 +75,16 @@ int main()
|
|||||||
assert(G::n_alive == 1);
|
assert(G::n_alive == 1);
|
||||||
}
|
}
|
||||||
assert(G::n_alive == 0);
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
#include <new>
|
#include <new>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <system_error>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
class G
|
class G
|
||||||
{
|
{
|
||||||
@@ -42,6 +45,8 @@ public:
|
|||||||
int G::n_alive = 0;
|
int G::n_alive = 0;
|
||||||
bool G::op_run = false;
|
bool G::op_run = false;
|
||||||
|
|
||||||
|
void foo() {}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@@ -50,5 +55,23 @@ int main()
|
|||||||
assert(t0.joinable());
|
assert(t0.joinable());
|
||||||
t0.join();
|
t0.join();
|
||||||
assert(!t0.joinable());
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// XFAIL: libcpp-no-exceptions
|
|
||||||
// template <class charT>
|
// template <class charT>
|
||||||
// explicit bitset(const charT* str,
|
// explicit bitset(const charT* str,
|
||||||
// typename basic_string<charT>::size_type n = basic_string<charT>::npos,
|
// typename basic_string<charT>::size_type n = basic_string<charT>::npos,
|
||||||
@@ -18,22 +17,19 @@
|
|||||||
#include <algorithm> // for 'min' and 'max'
|
#include <algorithm> // for 'min' and 'max'
|
||||||
#include <stdexcept> // for 'invalid_argument'
|
#include <stdexcept> // for 'invalid_argument'
|
||||||
|
|
||||||
#if defined(__clang__)
|
#include "test_macros.h"
|
||||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
void test_char_pointer_ctor()
|
void test_char_pointer_ctor()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
try
|
#ifndef TEST_HAS_NO_EXCEPTIONS
|
||||||
{
|
try {
|
||||||
std::bitset<N> v("xxx1010101010xxxx");
|
std::bitset<N> v("xxx1010101010xxxx");
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
catch (std::invalid_argument&)
|
catch (std::invalid_argument&) {}
|
||||||
{
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,21 +12,26 @@
|
|||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#if defined(__clang__)
|
#include "test_macros.h"
|
||||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
void test_default_ctor()
|
void test_default_ctor()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
_LIBCPP_CONSTEXPR std::bitset<N> v1;
|
TEST_CONSTEXPR std::bitset<N> v1;
|
||||||
assert(v1.size() == N);
|
assert(v1.size() == N);
|
||||||
for (std::size_t i = 0; i < N; ++i)
|
for (std::size_t i = 0; i < N; ++i)
|
||||||
assert(v1[i] == false);
|
assert(v1[i] == false);
|
||||||
}
|
}
|
||||||
|
#if TEST_STD_VER >= 11
|
||||||
|
{
|
||||||
|
constexpr std::bitset<N> v1;
|
||||||
|
static_assert(v1.size() == N, "");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
test_default_ctor<0>();
|
test_default_ctor<0>();
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// XFAIL: libcpp-no-exceptions
|
|
||||||
// test bitset(string, pos, n, zero, one);
|
// test bitset(string, pos, n, zero, one);
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
@@ -15,67 +14,60 @@
|
|||||||
#include <algorithm> // for 'min' and 'max'
|
#include <algorithm> // for 'min' and 'max'
|
||||||
#include <stdexcept> // for 'invalid_argument'
|
#include <stdexcept> // for 'invalid_argument'
|
||||||
|
|
||||||
#if defined(__clang__)
|
#include "test_macros.h"
|
||||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
void test_string_ctor()
|
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::string str("xxx1010101010xxxx");
|
||||||
std::bitset<N> v(str, str.size()+1, 10);
|
std::bitset<N> v(str, 3, 10);
|
||||||
assert(false);
|
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::string str("xxxbababababaxxxx");
|
||||||
std::bitset<N> v(str, 2, 10, 'a', 'b');
|
std::bitset<N> v(str, 3, 10, 'a', 'b');
|
||||||
assert(false);
|
std::size_t M = std::min<std::size_t>(N, 10);
|
||||||
}
|
for (std::size_t i = 0; i < M; ++i)
|
||||||
catch (std::invalid_argument&)
|
assert(v[i] == (str[3 + M - 1 - i] == 'b'));
|
||||||
{
|
for (std::size_t i = 10; i < N; ++i)
|
||||||
}
|
assert(v[i] == false);
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,22 +13,26 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <algorithm> // for 'min' and 'max'
|
#include <algorithm> // for 'min' and 'max'
|
||||||
|
|
||||||
#if defined(__clang__)
|
#include "test_macros.h"
|
||||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
void test_val_ctor()
|
void test_val_ctor()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
_LIBCPP_CONSTEXPR std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
|
TEST_CONSTEXPR std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
|
||||||
assert(v.size() == N);
|
assert(v.size() == N);
|
||||||
unsigned M = std::min<std::size_t>(N, 64);
|
unsigned M = std::min<std::size_t>(N, 64);
|
||||||
for (std::size_t i = 0; i < M; ++i)
|
for (std::size_t i = 0; i < M; ++i)
|
||||||
assert(v[i] == (i & 1));
|
assert(v[i] == (i & 1));
|
||||||
for (std::size_t i = M; i < N; ++i)
|
for (std::size_t i = M; i < N; ++i)
|
||||||
assert(v[i] == false);
|
assert(v[i] == false);
|
||||||
}
|
}
|
||||||
|
#if TEST_STD_VER >= 11
|
||||||
|
{
|
||||||
|
constexpr std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
|
||||||
|
static_assert(v.size() == N, "");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|||||||
@@ -14,10 +14,6 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#if defined(__clang__)
|
|
||||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
std::bitset<N>
|
std::bitset<N>
|
||||||
make_bitset()
|
make_bitset()
|
||||||
|
|||||||
@@ -13,11 +13,6 @@
|
|||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#if defined(__clang__)
|
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
void test_reset_one()
|
void test_reset_one()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,10 +14,6 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#if defined(__clang__)
|
|
||||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
std::bitset<N>
|
std::bitset<N>
|
||||||
make_bitset()
|
make_bitset()
|
||||||
|
|||||||
@@ -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#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#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#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#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#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>
|
<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>
|
||||||
|
|||||||
Reference in New Issue
Block a user