diff options
| author | Roman Lebedev <lebedev.ri@gmail.com> | 2017-10-15 20:12:42 +0000 |
|---|---|---|
| committer | Roman Lebedev <lebedev.ri@gmail.com> | 2017-10-15 20:12:42 +0000 |
| commit | ac9309a112197f34319c5063ba3675614de1e04f (patch) | |
| tree | 3486d0eb57bacef2fa67bfbe7f2cf7c610090eae /libcxx/test/std | |
| parent | 58c8e3bba5b4e220d4e0a52f28137d10bcb15c85 (diff) | |
| download | bcm5719-llvm-ac9309a112197f34319c5063ba3675614de1e04f.tar.gz bcm5719-llvm-ac9309a112197f34319c5063ba3675614de1e04f.zip | |
Silence clang's -Wtautological-constant-compare in last_write_time.pass.cpp
Previously this broke the builders, when D38101 was committed.
Silence the warning so that it can be re-landed.
llvm-svn: 315874
Diffstat (limited to 'libcxx/test/std')
| -rw-r--r-- | libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp index ed25649531b..49da6fbd2ae 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp @@ -88,6 +88,13 @@ bool TestSupportsNegativeTimes() { return !ec && new_write_time <= -5; } +// In some configurations, the comparison is tautological and the test is valid. +// We disable the warning so that we can actually test it regardless. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-constant-compare" +#endif + bool TestSupportsMaxTime() { using namespace std::chrono; using Lim = std::numeric_limits<std::time_t>; @@ -106,11 +113,22 @@ bool TestSupportsMaxTime() { return !ec && new_write_time > max_sec - 1; } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + static const bool SupportsNegativeTimes = TestSupportsNegativeTimes(); static const bool SupportsMaxTime = TestSupportsMaxTime(); } // end namespace +// In some configurations, the comparison is tautological and the test is valid. +// We disable the warning so that we can actually test it regardless. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-constant-compare" +#endif + // Check if a time point is representable on a given filesystem. Check that: // (A) 'tp' is representable as a time_t // (B) 'tp' is non-negative or the filesystem supports negative times. @@ -127,6 +145,10 @@ inline bool TimeIsRepresentableByFilesystem(file_time_type tp) { return true; } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + TEST_SUITE(exists_test_suite) TEST_CASE(signature_test) |

