summaryrefslogtreecommitdiff
path: root/test/std
diff options
context:
space:
mode:
Diffstat (limited to 'test/std')
-rw-r--r--test/std/language.support/support.exception/except.nested/assign.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp5
-rw-r--r--test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/propagation/current_exception.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp3
-rw-r--r--test/std/numerics/c.math/cmath.pass.cpp33
-rw-r--r--test/std/strings/basic.string/string.cons/T_size_size.pass.cpp1
-rw-r--r--test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp26
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp4
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp18
15 files changed, 95 insertions, 19 deletions
diff --git a/test/std/language.support/support.exception/except.nested/assign.pass.cpp b/test/std/language.support/support.exception/except.nested/assign.pass.cpp
index 6338c8aaa26ed..ec5575d072ce8 100644
--- a/test/std/language.support/support.exception/except.nested/assign.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/assign.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp b/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
index 4cbdbb2ec8923..92134c993af3f 100644
--- a/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp b/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
index 18ca9968ff566..8f8503b254d32 100644
--- a/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
index 68cd85038b28a..fe9cd6042ba8e 100644
--- a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
@@ -43,7 +46,7 @@ class C
{
public:
virtual ~C() {}
- C * operator&() const { assert(false); } // should not be called
+ C * operator&() const { assert(false); return nullptr; } // should not be called
};
class D : private std::nested_exception {};
diff --git a/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
index d511a72f9f57a..73d02da39333f 100644
--- a/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
index 6a9f25cd0855d..6353afcb239b8 100644
--- a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/language.support/support.exception/propagation/current_exception.pass.cpp b/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
index 661f789fefd78..2046997774a8a 100644
--- a/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp b/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
index 3aa8dcf55bbca..9621a73603649 100644
--- a/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// <exception>
// typedef unspecified exception_ptr;
diff --git a/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp b/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
index 36feda7304bc1..4980c656b2b51 100644
--- a/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp b/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
index 565166cbdf769..7d27eee6689a1 100644
--- a/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/numerics/c.math/cmath.pass.cpp b/test/std/numerics/c.math/cmath.pass.cpp
index 7161bd37e3e2a..b5f586492bde2 100644
--- a/test/std/numerics/c.math/cmath.pass.cpp
+++ b/test/std/numerics/c.math/cmath.pass.cpp
@@ -10,6 +10,7 @@
// <cmath>
#include <cmath>
+#include <limits>
#include <type_traits>
#include <cassert>
@@ -551,6 +552,13 @@ void test_signbit()
static_assert((std::is_same<decltype(std::signbit((long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(signbit(Ambiguous())), Ambiguous>::value), "");
assert(std::signbit(-1.0) == true);
+ assert(std::signbit(0u) == false);
+ assert(std::signbit(std::numeric_limits<unsigned>::max()) == false);
+ assert(std::signbit(0) == false);
+ assert(std::signbit(1) == false);
+ assert(std::signbit(-1) == true);
+ assert(std::signbit(std::numeric_limits<int>::max()) == false);
+ assert(std::signbit(std::numeric_limits<int>::min()) == true);
}
void test_fpclassify()
@@ -564,6 +572,11 @@ void test_fpclassify()
static_assert((std::is_same<decltype(std::fpclassify((long double)0)), int>::value), "");
static_assert((std::is_same<decltype(fpclassify(Ambiguous())), Ambiguous>::value), "");
assert(std::fpclassify(-1.0) == FP_NORMAL);
+ assert(std::fpclassify(0) == FP_ZERO);
+ assert(std::fpclassify(1) == FP_NORMAL);
+ assert(std::fpclassify(-1) == FP_NORMAL);
+ assert(std::fpclassify(std::numeric_limits<int>::max()) == FP_NORMAL);
+ assert(std::fpclassify(std::numeric_limits<int>::min()) == FP_NORMAL);
}
void test_isfinite()
@@ -577,6 +590,11 @@ void test_isfinite()
static_assert((std::is_same<decltype(std::isfinite((long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isfinite(Ambiguous())), Ambiguous>::value), "");
assert(std::isfinite(-1.0) == true);
+ assert(std::isfinite(0) == true);
+ assert(std::isfinite(1) == true);
+ assert(std::isfinite(-1) == true);
+ assert(std::isfinite(std::numeric_limits<int>::max()) == true);
+ assert(std::isfinite(std::numeric_limits<int>::min()) == true);
}
void test_isnormal()
@@ -590,6 +608,11 @@ void test_isnormal()
static_assert((std::is_same<decltype(std::isnormal((long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isnormal(Ambiguous())), Ambiguous>::value), "");
assert(std::isnormal(-1.0) == true);
+ assert(std::isnormal(0) == false);
+ assert(std::isnormal(1) == true);
+ assert(std::isnormal(-1) == true);
+ assert(std::isnormal(std::numeric_limits<int>::max()) == true);
+ assert(std::isnormal(std::numeric_limits<int>::min()) == true);
}
void test_isgreater()
@@ -651,6 +674,11 @@ void test_isinf()
static_assert((std::is_same<decltype(std::isinf(0)), bool>::value), "");
static_assert((std::is_same<decltype(std::isinf((long double)0)), bool>::value), "");
assert(std::isinf(-1.0) == false);
+ assert(std::isinf(0) == false);
+ assert(std::isinf(1) == false);
+ assert(std::isinf(-1) == false);
+ assert(std::isinf(std::numeric_limits<int>::max()) == false);
+ assert(std::isinf(std::numeric_limits<int>::min()) == false);
}
void test_isless()
@@ -731,6 +759,11 @@ void test_isnan()
static_assert((std::is_same<decltype(std::isnan(0)), bool>::value), "");
static_assert((std::is_same<decltype(std::isnan((long double)0)), bool>::value), "");
assert(std::isnan(-1.0) == false);
+ assert(std::isnan(0) == false);
+ assert(std::isnan(1) == false);
+ assert(std::isnan(-1) == false);
+ assert(std::isnan(std::numeric_limits<int>::max()) == false);
+ assert(std::isnan(std::numeric_limits<int>::min()) == false);
}
void test_isunordered()
diff --git a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
index 312e4d27fef12..c8d14a1d0ddf6 100644
--- a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
@@ -63,7 +63,6 @@ void
test(SV sv, unsigned pos, unsigned n, const typename S::allocator_type& a)
{
typedef typename S::traits_type T;
- typedef typename S::allocator_type A;
if (pos <= sv.size())
{
S s2(sv, pos, n, a);
diff --git a/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp b/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
index 75dfb0a2e7044..7ed6121e53019 100644
--- a/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
+++ b/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
@@ -44,7 +44,7 @@ void test_emplace_type() {
auto &v = a.emplace<Type>();
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assert(Type::count == 1);
@@ -60,7 +60,7 @@ void test_emplace_type() {
auto &v = a.emplace<Type>(101);
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assert(Type::count == 1);
@@ -76,7 +76,7 @@ void test_emplace_type() {
auto &v = a.emplace<Type>(-1, 42, -1);
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assert(Type::count == 1);
@@ -97,7 +97,7 @@ void test_emplace_type_tracked() {
assert(Tracked::count == 1);
auto &v = a.emplace<Type>();
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assertArgsMatch<Type>(a);
@@ -107,7 +107,7 @@ void test_emplace_type_tracked() {
assert(Tracked::count == 1);
auto &v = a.emplace<Type>(-1, 42, -1);
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assertArgsMatch<Type, int, int, int>(a);
@@ -118,7 +118,7 @@ void test_emplace_type_tracked() {
assert(Tracked::count == 1);
auto &v = a.emplace<Type>({-1, 42, -1});
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assertArgsMatch<Type, std::initializer_list<int>>(a);
@@ -129,7 +129,7 @@ void test_emplace_type_tracked() {
assert(Tracked::count == 1);
auto &v = a.emplace<Type>({-1, 42, -1}, x);
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assertArgsMatch<Type, std::initializer_list<int>, int&>(a);
@@ -159,7 +159,8 @@ void test_emplace_throws()
std::any a(small{42});
assert(small::count == 1);
try {
- a.emplace<Type>(101);
+ auto &v = a.emplace<Type>(101);
+ static_assert( std::is_same_v<Type&, decltype(v)>, "" );
assert(false);
} catch (int const&) {
}
@@ -169,7 +170,8 @@ void test_emplace_throws()
std::any a(small{42});
assert(small::count == 1);
try {
- a.emplace<Type>({1, 2, 3}, 101);
+ auto &v = a.emplace<Type>({1, 2, 3}, 101);
+ static_assert( std::is_same_v<Type&, decltype(v)>, "" );
assert(false);
} catch (int const&) {
}
@@ -180,7 +182,8 @@ void test_emplace_throws()
std::any a(large{42});
assert(large::count == 1);
try {
- a.emplace<Type>(101);
+ auto &v = a.emplace<Type>(101);
+ static_assert( std::is_same_v<Type&, decltype(v)>, "" );
assert(false);
} catch (int const&) {
}
@@ -190,7 +193,8 @@ void test_emplace_throws()
std::any a(large{42});
assert(large::count == 1);
try {
- a.emplace<Type>({1, 2, 3}, 101);
+ auto &v = a.emplace<Type>({1, 2, 3}, 101);
+ static_assert( std::is_same_v<Type&, decltype(v)>, "" );
assert(false);
} catch (int const&) {
}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
index 0696c11526d59..e7f59f1a94cae 100644
--- a/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
@@ -254,7 +254,9 @@ int main()
{
assert(static_cast<bool>(opt) == true);
assert(Y::dtor_called == false);
- opt.emplace(1);
+ auto &v = opt.emplace(1);
+ static_assert( std::is_same_v<Y&, decltype(v)>, "" );
+ assert(false);
}
catch (int i)
{
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
index 1c3c69a70303d..f6959c7e9cfd1 100644
--- a/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
@@ -11,7 +11,7 @@
// <optional>
// template <class U, class... Args>
-// void optional<T>::emplace(initializer_list<U> il, Args&&... args);
+// T& optional<T>::emplace(initializer_list<U> il, Args&&... args);
#include <optional>
#include <type_traits>
@@ -76,21 +76,27 @@ int main()
X x;
optional<X> opt(x);
assert(X::dtor_called == false);
- opt.emplace({1, 2});
+ auto &v = opt.emplace({1, 2});
+ static_assert( std::is_same_v<X&, decltype(v)>, "" );
assert(X::dtor_called == true);
assert(*opt == X({1, 2}));
+ assert(&v == &*opt);
}
{
optional<std::vector<int>> opt;
- opt.emplace({1, 2, 3}, std::allocator<int>());
+ auto &v = opt.emplace({1, 2, 3}, std::allocator<int>());
+ static_assert( std::is_same_v<std::vector<int>&, decltype(v)>, "" );
assert(static_cast<bool>(opt) == true);
assert(*opt == std::vector<int>({1, 2, 3}));
+ assert(&v == &*opt);
}
{
optional<Y> opt;
- opt.emplace({1, 2});
+ auto &v = opt.emplace({1, 2});
+ static_assert( std::is_same_v<Y&, decltype(v)>, "" );
assert(static_cast<bool>(opt) == true);
assert(*opt == Y({1, 2}));
+ assert(&v == &*opt);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
@@ -100,7 +106,9 @@ int main()
{
assert(static_cast<bool>(opt) == true);
assert(Z::dtor_called == false);
- opt.emplace({1, 2});
+ auto &v = opt.emplace({1, 2});
+ static_assert( std::is_same_v<Z&, decltype(v)>, "" );
+ assert(false);
}
catch (int i)
{