fix test failures with older clang versions

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2018-07-22 20:50:16 +00:00
parent 70c866bfc1
commit 1061b65e6e
5 changed files with 36 additions and 4 deletions

View File

@@ -0,0 +1,32 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// XFAIL: apple-clang-7, clang-3.7, clang-3.8
// <experimental/filesystem>
// class directory_entry
// directory_entry() noexcept = default;
#include "filesystem_include.hpp"
#include <type_traits>
#include <cassert>
int main() {
using namespace fs;
// Default
{
static_assert(std::is_nothrow_default_constructible<directory_entry>::value,
"directory_entry must have a nothrow default constructor");
const directory_entry e;
assert(e.path() == path());
}
}

View File

@@ -30,7 +30,7 @@ TEST_SUITE(directory_entry_obs_testsuite)
TEST_CASE(signatures) {
using namespace fs;
{
const fs::directory_entry e;
const fs::directory_entry e = {};
std::error_code ec;
static_assert(std::is_same<decltype(e.file_size()), uintmax_t>::value, "");
static_assert(std::is_same<decltype(e.file_size(ec)), uintmax_t>::value,

View File

@@ -32,7 +32,7 @@ TEST_CASE(file_dne) {
TEST_CASE(signatures) {
using namespace fs;
const directory_entry e;
const directory_entry e = {};
std::error_code ec;
#define TEST_FUNC(name) \
static_assert(std::is_same<decltype(e.name()), bool>::value, \

View File

@@ -28,7 +28,7 @@ TEST_SUITE(directory_entry_obs_testsuite)
TEST_CASE(signatures) {
using namespace fs;
{
const fs::directory_entry e;
const directory_entry e = {};
std::error_code ec;
static_assert(std::is_same<decltype(e.hard_link_count()), uintmax_t>::value, "");
static_assert(std::is_same<decltype(e.hard_link_count(ec)), uintmax_t>::value,

View File

@@ -28,7 +28,7 @@ TEST_SUITE(directory_entry_obs_testsuite)
TEST_CASE(signatures) {
using namespace fs;
{
const fs::directory_entry e;
const fs::directory_entry e = {};
std::error_code ec;
static_assert(std::is_same<decltype(e.last_write_time()), file_time_type>::value,
"");