summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/function.objects
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/utilities/function.objects')
-rw-r--r--libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp7
-rw-r--r--libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp6
3 files changed, 13 insertions, 1 deletions
diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
index 1125844a1f3..af5efe464d5 100644
--- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
@@ -276,6 +276,7 @@ test3()
const auto f = bind(&TFENode::foo, _1, 0UL);
const TFENode n = TFENode{};
bool b = f(n);
+ assert(b);
}
int main()
diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
index fa791d46ff5..246186040c5 100644
--- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
@@ -12,13 +12,20 @@
// placeholders
#include <functional>
+#include <type_traits>
template <class T>
void
test(const T& t)
{
+ // Test default constructible.
T t2;
+ ((void)t2);
+ // Test copy constructible.
T t3 = t;
+ ((void)t3);
+ static_assert(std::is_nothrow_copy_constructible<T>::value, "");
+ static_assert(std::is_nothrow_move_constructible<T>::value, "");
}
int main()
diff --git a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
index d8690aa8268..bbf2ce5baf1 100644
--- a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
@@ -17,6 +17,7 @@
int main()
{
+ {
typedef std::bit_xor<int> F;
const F f = F();
static_assert((std::is_same<int, F::first_argument_type>::value), "" );
@@ -27,9 +28,11 @@ int main()
assert(f(0x58D3, 0xEA95) == 0xB246);
assert(f(0x58D3, 0) == 0x58D3);
assert(f(0xFFFF, 0x58D3) == 0xA72C);
+ }
#if _LIBCPP_STD_VER > 11
+ {
typedef std::bit_xor<> F2;
- const F2 f2 = F2();
+ const F2 f = F2();
assert(f(0xEA95, 0xEA95) == 0);
assert(f(0xEA95L, 0xEA95) == 0);
assert(f(0xEA95, 0xEA95L) == 0);
@@ -55,5 +58,6 @@ int main()
constexpr int bar = std::bit_xor<> () (0x58D3L, 0xEA95);
static_assert ( bar == 0xB246, "" );
+ }
#endif
}
OpenPOWER on IntegriCloud