Fix warnings in test/std/language.support

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242624 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2015-07-18 21:17:16 +00:00
parent 692177d022
commit 7b86ce5cc4
10 changed files with 44 additions and 9 deletions

View File

@@ -50,7 +50,8 @@
int main()
{
std::sig_atomic_t sig;
std::sig_atomic_t sig = 0;
((void)sig);
typedef void (*func)(int);
static_assert((std::is_same<decltype(std::signal(0, (func)0)), func>::value), "");
static_assert((std::is_same<decltype(std::raise(0)), int>::value), "");

View File

@@ -32,4 +32,5 @@
int main()
{
std::va_list va;
((void)va);
}

View File

@@ -11,6 +11,7 @@
#include <cstdlib>
#include <type_traits>
#include <cassert>
#ifndef EXIT_FAILURE
#error EXIT_FAILURE not defined
@@ -32,12 +33,23 @@
#error RAND_MAX not defined
#endif
template <class TestType, class IntType>
void test_div_struct() {
TestType obj;
static_assert(sizeof(obj) >= sizeof(IntType) * 2, ""); // >= to account for alignment.
static_assert(std::is_same<decltype(obj.quot), IntType>::value, "");
static_assert(std::is_same<decltype(obj.rem), IntType>::value, "");
((void) obj);
};
int main()
{
std::size_t s = 0;
std::div_t d;
std::ldiv_t ld;
std::lldiv_t lld;
((void)s);
static_assert(std::is_same<std::size_t, decltype(sizeof(int))>::value, "");
test_div_struct<std::div_t, int>();
test_div_struct<std::ldiv_t, long>();
test_div_struct<std::lldiv_t, long long>();
char** endptr = 0;
static_assert((std::is_same<decltype(std::atof("")), double>::value), "");
static_assert((std::is_same<decltype(std::atoi("")), int>::value), "");

View File

@@ -23,6 +23,7 @@
int main()
{
std::clock_t c = 0;
((void)c);
std::size_t s = 0;
std::time_t t = 0;
std::tm tm = {0};