Get tests running with warnings. Fix warnings in headers and tests

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2015-02-05 20:28:37 +00:00
parent 70e0af45ae
commit 75fdf0ea7c
26 changed files with 66 additions and 21 deletions

View File

@@ -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()

View File

@@ -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()

View File

@@ -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
}