[libcxx] chrono::month_weekday should not be default constructible
It was not in P0355R7, nor has it ever been so in a working draft.
Drive-by:
* tests should test something: fix loop bounds so initial value is not >= final value
* calender type streaming tests are useless - let's remove them
* don't declare printf, especially if you don't intend to use it
Differential Revision: https://reviews.llvm.org/D117638
NOKEYCHECK=True
GitOrigin-RevId: 864b5b49fd3f6639efbc16d9b1c827d0194eeb0d
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst
index 8f57df3..e1be3a6 100644
--- a/docs/ReleaseNotes.rst
+++ b/docs/ReleaseNotes.rst
@@ -108,6 +108,9 @@
as either ``for (auto&& c : path)`` or ``for (const auto& c : path)``.
``std::reverse_iterator<path::iterator>`` is no longer rejected.
+- Removed the nonstandard default constructor from ``std::chrono::month_weekday``.
+ You must now explicitly initialize with a ``chrono::month`` and
+ ``chrono::weekday_indexed`` instead of "meh, whenever".
ABI Changes
-----------
diff --git a/include/__chrono/calendar.h b/include/__chrono/calendar.h
index 0854ca6..745f7f5 100644
--- a/include/__chrono/calendar.h
+++ b/include/__chrono/calendar.h
@@ -540,7 +540,6 @@
chrono::month __m;
chrono::weekday_indexed __wdi;
public:
- month_weekday() = default;
constexpr month_weekday(const chrono::month& __mval, const chrono::weekday_indexed& __wdival) noexcept
: __m{__mval}, __wdi{__wdival} {}
inline constexpr chrono::month month() const noexcept { return __m; }
diff --git a/test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/comparisons.pass.cpp
index 252a172..fbae12e 100644
--- a/test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/comparisons.pass.cpp
@@ -33,7 +33,7 @@
static_assert(testComparisons6Values<day>(0U, 0U), "");
static_assert(testComparisons6Values<day>(0U, 1U), "");
-// Some 'ok' values as well
+ // Some 'ok' values as well
static_assert(testComparisons6Values<day>( 5U, 5U), "");
static_assert(testComparisons6Values<day>( 5U, 10U), "");
diff --git a/test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/streaming.pass.cpp
deleted file mode 100644
index d53c67c..0000000
--- a/test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-has-no-localization
-// XFAIL: *
-
-// <chrono>
-// class day;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const day& d);
-//
-// Effects: Inserts format(fmt, d) where fmt is "%d" widened to charT.
-// If !d.ok(), appends with " is not a valid day".
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const day& d);
-//
-// Effects: Streams d into os using the format specified by the NTCTS fmt.
-// fmt encoding follows the rules specified in 25.11.
-//
-// template<class charT, class traits, class Alloc = allocator<charT>>
-// basic_istream<charT, traits>&
-// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
-// day& d, basic_string<charT, traits, Alloc>* abbrev = nullptr,
-// minutes* offset = nullptr);
-//
-// Effects: Attempts to parse the input stream is into the day d using the format flags
-// given in the NTCTS fmt as specified in 25.12.
-// If the parse fails to decode a valid day, is.setstate(ios_base::failbit)
-// shall be called and d shall not be modified.
-// If %Z is used and successfully parsed, that value will be assigned to *abbrev
-// if abbrev is non-null. If %z (or a modified variant) is used and
-// successfully parsed, that value will be assigned to *offset if offset is non-null.
-//
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using day = std::chrono::day;
- std::cout << day{1};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.members/ok.pass.cpp b/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.members/ok.pass.cpp
index 7f25b2d..2bc7a5a 100644
--- a/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.members/ok.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.members/ok.pass.cpp
@@ -48,7 +48,7 @@
assert(!(month_day{month{i}, day{32}}.ok()));
}
-// If the month is not ok, all the days are bad
+ // If the month is not ok, all the days are bad
for (unsigned i = 1; i <= 35; ++i)
assert(!(month_day{month{13}, day{i}}.ok()));
diff --git a/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/comparisons.pass.cpp
index 573ec1a..d64e0e1 100644
--- a/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/comparisons.pass.cpp
@@ -50,7 +50,7 @@
month_day{std::chrono::February, day{1}},
false, true), "");
-// same day, different months
+ // same day, different months
for (unsigned i = 1; i < 12; ++i)
for (unsigned j = 1; j < 12; ++j)
assert((testComparisons6(
@@ -58,7 +58,7 @@
month_day{month{j}, day{1}},
i == j, i < j )));
-// same month, different days
+ // same month, different days
for (unsigned i = 1; i < 31; ++i)
for (unsigned j = 1; j < 31; ++j)
assert((testComparisons6(
diff --git a/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 84305e4..0000000
--- a/test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class month_day;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const month_day& md);
-//
-// Returns: os << md.month() << '/' << md.day().
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const month_day& md);
-//
-// Effects: Streams md into os using the format specified by the NTCTS fmt.
-// fmt encoding follows the rules specified in 25.11.
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using month_day = std::chrono::month_day;
- using month = std::chrono::month;
- using day = std::chrono::day;
- std::cout << month_day{month{1}, day{1}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.mdlast/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mdlast/comparisons.pass.cpp
index ebccc9f..a83b045 100644
--- a/test/std/utilities/time/time.cal/time.cal.mdlast/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.mdlast/comparisons.pass.cpp
@@ -35,10 +35,10 @@
static_assert( testComparisons6Values<month_day_last>(month{1}, month{1}), "");
static_assert( testComparisons6Values<month_day_last>(month{1}, month{2}), "");
-// same day, different months
- for (unsigned i = 1; i < 12; ++i)
- for (unsigned j = 1; j < 12; ++j)
- assert((testComparisons6Values<month_day_last>(month{i}, month{j})));
+ // same day, different months
+ for (unsigned i = 1; i <= 12; ++i)
+ for (unsigned j = 1; j <= 12; ++j)
+ assert(testComparisons6Values<month_day_last>(month{i}, month{j}));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.mdlast/ok.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mdlast/ok.pass.cpp
index b9d6535..c6bec5d 100644
--- a/test/std/utilities/time/time.cal/time.cal.mdlast/ok.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.mdlast/ok.pass.cpp
@@ -36,7 +36,7 @@
assert( mdl.ok());
}
-// If the month is not ok, all the days are bad
+ // If the month is not ok, all the days are bad
for (unsigned i = 13; i <= 50; ++i)
{
month_day_last mdl{month{i}};
diff --git a/test/std/utilities/time/time.cal/time.cal.mdlast/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mdlast/streaming.pass.cpp
deleted file mode 100644
index 5960d02..0000000
--- a/test/std/utilities/time/time.cal/time.cal.mdlast/streaming.pass.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class month_day_last;
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const month_day_last& mdl);
-//
-// Returns: os << mdl.month() << "/last".
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using month_day_last = std::chrono::month_day_last;
- using month = std::chrono::month;
- std::cout << month_day_last{month{1}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/comparisons.pass.cpp
index df709a5..41f31cd 100644
--- a/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/comparisons.pass.cpp
@@ -36,12 +36,12 @@
static_assert(testComparisons6Values<month>(0U ,0U), "");
static_assert(testComparisons6Values<month>(0U, 1U), "");
-// Some 'ok' values as well
+ // Some 'ok' values as well
static_assert(testComparisons6Values<month>( 5U, 5U), "");
static_assert(testComparisons6Values<month>( 5U, 10U), "");
- for (unsigned i = 1; i < 10; ++i)
- for (unsigned j = 10; j < 10; ++j)
+ for (unsigned i = 1; i <= 12; ++i)
+ for (unsigned j = 1; j <= 12; ++j)
assert(testComparisons6Values<month>(i, j));
return 0;
diff --git a/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/minus.pass.cpp b/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/minus.pass.cpp
index 0f1bf7f..0fe2f68 100644
--- a/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/minus.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/minus.pass.cpp
@@ -31,12 +31,13 @@
{
M m{5};
Ms offset{3};
- if (m - offset != M{2}) return false;
- if (m - M{2} != offset) return false;
+ assert(m - offset == M{2});
+ assert(m - M{2} == offset);
}
-// Check the example
- if (M{1} - M{2} != Ms{11}) return false;
+ // Check the example
+ assert(M{1} - M{2} == Ms{11});
+
return true;
}
@@ -51,18 +52,18 @@
ASSERT_SAME_TYPE(month , decltype(std::declval<month>() - std::declval<months>()));
ASSERT_SAME_TYPE(months, decltype(std::declval<month>() - std::declval<month> ()));
-static_assert(testConstexpr<month, months>(), "");
+ static_assert(testConstexpr<month, months>(), "");
month m{6};
for (unsigned i = 1; i <= 12; ++i)
{
month m1 = m - months{i};
-// months off = m - month {i};
+ // months off = m - month {i};
int exp = 6 - i;
if (exp < 1)
exp += 12;
assert(static_cast<unsigned>(m1) == static_cast<unsigned>(exp));
-// assert(off.count() == static_cast<unsigned>(exp));
+ // assert(off.count() == static_cast<unsigned>(exp));
}
return 0;
diff --git a/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/plus.pass.cpp b/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/plus.pass.cpp
index 538efd3..c40aef0 100644
--- a/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/plus.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/plus.pass.cpp
@@ -36,10 +36,10 @@
{
M m{1};
Ms offset{4};
- if (m + offset != M{5}) return false;
- if (offset + m != M{5}) return false;
-// Check the example
- if (M{2} + Ms{11} != M{1}) return false;
+ assert(m + offset == M{5});
+ assert(offset + m == M{5});
+ // Check the example
+ assert(M{2} + Ms{11} == M{1});
return true;
}
@@ -69,5 +69,5 @@
assert(static_cast<unsigned>(m2) == exp);
}
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 369fa6f..0000000
--- a/test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class month;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const month& m);
-//
-// Effects: If m.ok() == true inserts format(os.getloc(), fmt, m) where fmt is "%b" widened to charT.
-// Otherwise inserts int{m} << " is not a valid month".
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const month& m);
-//
-// Effects: Streams m into os using the format specified by the NTCTS fmt.
-// fmt encoding follows the rules specified in 25.11.
-//
-// template<class charT, class traits, class Alloc = allocator<charT>>
-// basic_istream<charT, traits>&
-// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
-// month& m, basic_string<charT, traits, Alloc>* abbrev = nullptr,
-// minutes* offset = nullptr);
-//
-// Effects: Attempts to parse the input stream is into the month m using the format flags
-// given in the NTCTS fmt as specified in 25.12. If the parse fails to decode a valid month,
-// is.setstate(ios_- base::failbit) shall be called and m shall not be modified.
-// If %Z is used and successfully parsed, that value will be assigned to *abbrev if
-// abbrev is non-null. If %z (or a modified variant) is used and successfully parsed,
-// that value will be assigned to *offset if offset is non-null.
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using month = std::chrono::month;
- std::cout << month{1};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/month.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/month.pass.cpp
index daf959e..f6e79f5 100644
--- a/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/month.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/month.pass.cpp
@@ -31,8 +31,6 @@
ASSERT_NOEXCEPT( std::declval<const month_weekday>().month());
ASSERT_SAME_TYPE(month, decltype(std::declval<const month_weekday>().month()));
- static_assert( month_weekday{}.month() == month{}, "");
-
for (unsigned i = 1; i <= 50; ++i)
{
month_weekday md(month{i}, weekday_indexed{Sunday, 1});
diff --git a/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/ok.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/ok.pass.cpp
index f76797c..a46ffab 100644
--- a/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/ok.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/ok.pass.cpp
@@ -44,9 +44,9 @@
assert(mwd.ok() == (j >= 1 && j <= 5));
}
-// If the month is not ok, all the weekday_indexed are bad
+ // If the month is not ok, all the weekday_indexed are bad
for (unsigned i = 1; i <= 10; ++i)
assert(!(month_weekday{month{13}, weekday_indexed{Sunday, i}}.ok()));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 96555e3..0000000
--- a/test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class month_weekday;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const month_weekday& mwd);
-//
-// Returns: os << mwd.month() << '/' << mwd.weekday_indexed().
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using month_weekday = std::chrono::month_weekday;
- using month = std::chrono::month;
- using weekday_indexed = std::chrono::weekday_indexed;
- using weekday = std::chrono::weekday;
-
- std::cout << month_weekday{month{1}, weekday_indexed{weekday{3}, 3}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.members/ctor.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.members/ctor.pass.cpp
index af9c93d..69e58d3 100644
--- a/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.members/ctor.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.members/ctor.pass.cpp
@@ -39,23 +39,23 @@
ASSERT_NOEXCEPT(month_weekday_last{January, weekday_last{Tuesday}});
-// bad month
+ // bad month
constexpr month_weekday_last mwdl1{month{}, weekday_last{Tuesday}};
static_assert( mwdl1.month() == month{}, "");
static_assert( mwdl1.weekday_last() == weekday_last{Tuesday}, "");
static_assert(!mwdl1.ok(), "");
-// bad weekday_last
+ // bad weekday_last
constexpr month_weekday_last mwdl2{January, weekday_last{weekday{16}}};
static_assert( mwdl2.month() == January, "");
static_assert( mwdl2.weekday_last() == weekday_last{weekday{16}}, "");
static_assert(!mwdl2.ok(), "");
-// Good month and weekday_last
+ // Good month and weekday_last
constexpr month_weekday_last mwdl3{January, weekday_last{weekday{4}}};
static_assert( mwdl3.month() == January, "");
static_assert( mwdl3.weekday_last() == weekday_last{weekday{4}}, "");
static_assert( mwdl3.ok(), "");
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/comparisons.pass.cpp
index 38f8557..91b5e4f 100644
--- a/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/comparisons.pass.cpp
@@ -48,7 +48,7 @@
month_weekday_last{std::chrono::January, weekday_last{Wednesday}},
false), "");
-// vary the months
+ // vary the months
for (unsigned i = 1; i < 12; ++i)
for (unsigned j = 1; j < 12; ++j)
assert((testComparisons2(
@@ -56,7 +56,7 @@
month_weekday_last{month{j}, weekday_last{Tuesday}},
i == j)));
-// vary the weekday
+ // vary the weekday
for (unsigned i = 0; i < 6; ++i)
for (unsigned j = 0; j < 6; ++j)
assert((testComparisons2(
@@ -64,11 +64,11 @@
month_weekday_last{January, weekday_last{weekday{j}}},
i == j)));
-// both different
- assert((testComparisons2(
- month_weekday_last{month{1}, weekday_last{weekday{1}}},
- month_weekday_last{month{2}, weekday_last{weekday{2}}},
- false)));
+ // both different
+ assert((testComparisons2(
+ month_weekday_last{month{1}, weekday_last{weekday{1}}},
+ month_weekday_last{month{2}, weekday_last{weekday{2}}},
+ false)));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 3e7eb9f..0000000
--- a/test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class month_weekday_last;
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const month_weekday_last& mdl);
-//
-// Returns: os << mdl.month() << "/last".
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using month_weekday_last = std::chrono::month_weekday_last;
- using month = std::chrono::month;
- using weekday = std::chrono::weekday;
- using weekday_last = std::chrono::weekday_last;
-
- std::cout << month_weekday_last{month{1}, weekday_last{weekday{3}}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.operators/month_day_last.pass.cpp b/test/std/utilities/time/time.cal/time.cal.operators/month_day_last.pass.cpp
index ddc9cd5..ae9d7e4 100644
--- a/test/std/utilities/time/time.cal/time.cal.operators/month_day_last.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.operators/month_day_last.pass.cpp
@@ -34,11 +34,6 @@
// static_assert(mdl.month() == February);
// --end example]
-
-
-
-
-
#include <chrono>
#include <type_traits>
#include <cassert>
@@ -57,7 +52,7 @@
ASSERT_SAME_TYPE(month_day_last, decltype(last/February));
ASSERT_SAME_TYPE(month_day_last, decltype(February/last));
-// Run the example
+ // Run the example
{
constexpr auto mdl = February/std::chrono::last;
static_assert(mdl.month() == February, "");
@@ -104,5 +99,5 @@
}
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/ok.pass.cpp b/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/ok.pass.cpp
index a4ed7bf..3c96412 100644
--- a/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/ok.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/ok.pass.cpp
@@ -43,8 +43,8 @@
assert(!wdi.ok());
}
-// Not a valid weekday
+ // Not a valid weekday
assert(!(weekday_indexed(weekday{9U}, 1).ok()));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/comparisons.pass.cpp
index 5852020..c56c244 100644
--- a/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/comparisons.pass.cpp
@@ -36,7 +36,7 @@
static_assert(!(weekday_indexed{} == weekday_indexed{std::chrono::Tuesday, 1}), "");
static_assert( (weekday_indexed{} != weekday_indexed{std::chrono::Tuesday, 1}), "");
-// Some 'ok' values as well
+ // Some 'ok' values as well
static_assert( (weekday_indexed{weekday{1}, 2} == weekday_indexed{weekday{1}, 2}), "");
static_assert(!(weekday_indexed{weekday{1}, 2} != weekday_indexed{weekday{1}, 2}), "");
@@ -45,5 +45,5 @@
static_assert(!(weekday_indexed{weekday{1}, 2} == weekday_indexed{weekday{2}, 2}), "");
static_assert( (weekday_indexed{weekday{1}, 2} != weekday_indexed{weekday{2}, 2}), "");
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/streaming.pass.cpp
deleted file mode 100644
index be16c8f..0000000
--- a/test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class weekday_indexed;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const weekday_indexed& wdi);
-//
-// Effects: os << wdi.weekday() << '[' << wdi.index().
-// If wdi.index() is in the range [1, 5], appends with ']',
-// otherwise appends with " is not a valid index]".
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using weekday_indexed = std::chrono::weekday_indexed;
- using weekday = std::chrono::weekday;
-
- std::cout << weekday_indexed{weekday{3}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/comparisons.pass.cpp
index 03f4c3a..bb02729 100644
--- a/test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/comparisons.pass.cpp
@@ -32,7 +32,7 @@
static_assert(testComparisons2Values<weekday_last>(weekday{0}, weekday{0}), "");
static_assert(testComparisons2Values<weekday_last>(weekday{0}, weekday{1}), "");
-// Some 'ok' values as well
+ // Some 'ok' values as well
static_assert(testComparisons2Values<weekday_last>(weekday{2}, weekday{2}), "");
static_assert(testComparisons2Values<weekday_last>(weekday{2}, weekday{3}), "");
@@ -40,5 +40,5 @@
for (unsigned j = 0; j < 6; ++j)
assert(testComparisons2Values<weekday_last>(weekday{i}, weekday{j}));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/streaming.pass.cpp
deleted file mode 100644
index a3941a5..0000000
--- a/test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class weekday_last;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const weekday_last& wdl);
-//
-// Returns: os << wdl.weekday() << "[last]".
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using weekday_last = std::chrono::weekday_last;
- using weekday = std::chrono::weekday;
-
- std::cout << weekday_last{weekday{3}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/ctor.pass.cpp b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/ctor.pass.cpp
index 6d7be0a..d59df23 100644
--- a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/ctor.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/ctor.pass.cpp
@@ -46,7 +46,7 @@
assert(m.c_encoding() == (i == 7 ? 0 : i));
}
-// TODO - sys_days and local_days ctor tests
+ // TODO - sys_days and local_days ctor tests
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/iso_encoding.pass.cpp b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/iso_encoding.pass.cpp
index afb6a81..0e56a3e 100644
--- a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/iso_encoding.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/iso_encoding.pass.cpp
@@ -36,13 +36,13 @@
static_assert(testConstexpr<weekday>(), "");
-// This is different than all the other tests, because the '7' gets converted to
-// a zero in the constructor, but then back to '7' by iso_encoding().
+ // This is different than all the other tests, because the '7' gets converted to
+ // a zero in the constructor, but then back to '7' by iso_encoding().
for (unsigned i = 0; i <= 10; ++i)
{
weekday wd(i);
assert(wd.iso_encoding() == (i == 0 ? 7 : i));
}
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/comparisons.pass.cpp
index 213f490..759a78b 100644
--- a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/comparisons.pass.cpp
@@ -31,7 +31,7 @@
static_assert(testComparisons2Values<weekday>(0U ,0U), "");
static_assert(testComparisons2Values<weekday>(0U, 1U), "");
-// Some 'ok' values as well
+ // Some 'ok' values as well
static_assert(testComparisons2Values<weekday>(5U, 5U), "");
static_assert(testComparisons2Values<weekday>(5U, 2U), "");
@@ -39,5 +39,5 @@
for (unsigned j = 0; j < 6; ++j)
assert(testComparisons2Values<weekday>(i, j));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/minus.pass.cpp b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/minus.pass.cpp
index 7bac927..434662b 100644
--- a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/minus.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/minus.pass.cpp
@@ -19,9 +19,6 @@
// Otherwise the value returned is unspecified.
// [Example: Sunday - Monday == days{6}. —end example]
-
-extern "C" int printf(const char *, ...);
-
#include <chrono>
#include <type_traits>
#include <cassert>
@@ -35,12 +32,13 @@
{
WD wd{5};
Ds offset{3};
- if (wd - offset != WD{2}) return false;
- if (wd - WD{2} != offset) return false;
+ assert(wd - offset == WD{2});
+ assert(wd - WD{2} == offset);
}
-// Check the example
- if (WD{0} - WD{1} != Ds{6}) return false;
+ // Check the example
+ assert(WD{0} - WD{1} == Ds{6});
+
return true;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/plus.pass.cpp b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/plus.pass.cpp
index 7d98b47..1adcee8 100644
--- a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/plus.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/plus.pass.cpp
@@ -37,10 +37,10 @@
{
M m{1};
Ms offset{4};
- if (m + offset != M{5}) return false;
- if (offset + m != M{5}) return false;
-// Check the example
- if (M{1} + Ms{6} != M{0}) return false;
+ assert(m + offset == M{5});
+ assert(offset + m == M{5});
+ // Check the example
+ assert(M{1} + Ms{6} == M{0});
return true;
}
@@ -67,5 +67,5 @@
assert((wd2.c_encoding() == euclidian_addition<unsigned, 0, 6>(i, j)));
}
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 300d12f..0000000
--- a/test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class weekday;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const weekday& wd);
-//
-// Effects: If wd.ok() == true inserts format(os.getloc(), fmt, wd) where fmt is "%a" widened to charT.
-// Otherwise inserts unsigned{wd} << " is not a valid weekday".
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const weekday& wd);
-//
-// Effects: Streams wd into os using the format specified by the NTCTS fmt.
-// fmt encoding follows the rules specified in 25.11.
-//
-// template<class charT, class traits, class Alloc = allocator<charT>>
-// basic_istream<charT, traits>&
-// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
-// weekday& wd, basic_string<charT, traits, Alloc>* abbrev = nullptr,
-// minutes* offset = nullptr);
-//
-// Effects: Attempts to parse the input stream is into the weekday wd using
-// the format flags given in the NTCTS fmt as specified in 25.12.
-// If the parse fails to decode a valid weekday, is.setstate(ios_- base::failbit)
-// shall be called and wd shall not be modified.
-// If %Z is used and successfully parsed, that value will be assigned
-// to *abbrev if abbrev is non-null.
-// If %z (or a modified variant) is used and successfully parsed,
-// that value will be assigned to *offset if offset is non-null.
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using weekday = std::chrono::weekday;
-
- std::cout << weekday{3};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/comparisons.pass.cpp
index 1e4e2a1..9d92055 100644
--- a/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/comparisons.pass.cpp
@@ -36,7 +36,7 @@
static_assert(testComparisons6Values<year>(0,0), "");
static_assert(testComparisons6Values<year>(0,1), "");
-// Some 'ok' values as well
+ // Some 'ok' values as well
static_assert(testComparisons6Values<year>( 5, 5), "");
static_assert(testComparisons6Values<year>( 5,10), "");
@@ -44,5 +44,5 @@
for (int j = 1; j < 10; ++j)
assert(testComparisons6Values<year>(i, j));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/minus.pass.cpp b/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/minus.pass.cpp
index 0681152..b381107 100644
--- a/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/minus.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/minus.pass.cpp
@@ -19,8 +19,6 @@
// Otherwise the value returned is unspecified.
// [Example: January - February == years{11}. —end example]
-extern "C" int printf(const char *, ...);
-
#include <chrono>
#include <type_traits>
#include <cassert>
diff --git a/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 9ba502f..0000000
--- a/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class year;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const year& y);
-//
-// Effects: Inserts format(fmt, y) where fmt is "%Y" widened to charT.
-// If !y.ok(), appends with " is not a valid year".
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const year& y);
-//
-// Effects: Streams y into os using the format specified by the NTCTS fmt.
-// fmt encoding follows the rules specified in 25.11.
-//
-// template<class charT, class traits, class Alloc = allocator<charT>>
-// basic_istream<charT, traits>&
-// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
-// year& y, basic_string<charT, traits, Alloc>* abbrev = nullptr,
-// minutes* offset = nullptr);
-//
-// Effects: Attempts to parse the input stream is into the year y using the format flags
-// given in the NTCTS fmt as specified in 25.12. If the parse fails to decode a valid year,
-// is.setstate(ios_base::failbit) shall be called and y shall not be modified. If %Z is used
-// and successfully parsed, that value will be assigned to *abbrev if abbrev is non-null.
-// If %z (or a modified variant) is used and successfully parsed, that value will be
-// assigned to *offset if offset is non-null.
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using year = std::chrono::year;
-
- std::cout << year{2018};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/comparisons.pass.cpp
index fce247d..031b512 100644
--- a/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/comparisons.pass.cpp
@@ -50,7 +50,7 @@
year_month{year{1235}, std::chrono::January},
false, true), "");
-// same year, different months
+ // same year, different months
for (unsigned i = 1; i < 12; ++i)
for (unsigned j = 1; j < 12; ++j)
assert((testComparisons6(
@@ -58,13 +58,13 @@
year_month{year{1234}, month{j}},
i == j, i < j )));
-// same month, different years
- for (int i = 1000; i < 20; ++i)
- for (int j = 1000; j < 20; ++j)
+ // same month, different years
+ for (int i = 1000; i < 2000; ++i)
+ for (int j = 1000; j < 2000; ++j)
assert((testComparisons6(
year_month{year{i}, std::chrono::January},
year_month{year{j}, std::chrono::January},
i == j, i < j )));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/minus.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/minus.pass.cpp
index 73cec3b..3c58ed0 100644
--- a/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/minus.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/minus.pass.cpp
@@ -39,7 +39,7 @@
ASSERT_NOEXCEPT( std::declval<year_month>() - std::declval<years>());
ASSERT_SAME_TYPE(year_month, decltype(std::declval<year_month>() - std::declval<years>()));
-// static_assert(testConstexprYears (year_month{year{1}, month{1}}), "");
+ // static_assert(testConstexprYears (year_month{year{1}, month{1}}), "");
year_month ym{year{1234}, std::chrono::January};
for (int i = 0; i <= 10; ++i)
@@ -54,7 +54,7 @@
ASSERT_NOEXCEPT( std::declval<year_month>() - std::declval<months>());
ASSERT_SAME_TYPE(year_month, decltype(std::declval<year_month>() - std::declval<months>()));
-// static_assert(testConstexprMonths(year_month{year{1}, month{1}}), "");
+ // static_assert(testConstexprMonths(year_month{year{1}, month{1}}), "");
year_month ym{year{1234}, std::chrono::November};
for (int i = 0; i <= 10; ++i) // TODO test wrap-around
@@ -69,9 +69,9 @@
ASSERT_NOEXCEPT( std::declval<year_month>() - std::declval<year_month>());
ASSERT_SAME_TYPE(months, decltype(std::declval<year_month>() - std::declval<year_month>()));
-// static_assert(testConstexprMonths(year_month{year{1}, month{1}}), "");
+ // static_assert(testConstexprMonths(year_month{year{1}, month{1}}), "");
-// Same year
+ // Same year
year y{2345};
for (int i = 1; i <= 12; ++i)
for (int j = 1; j <= 12; ++j)
@@ -80,9 +80,9 @@
assert(diff.count() == i - j);
}
-// TODO: different year
+ // TODO: different year
}
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/streaming.pass.cpp
deleted file mode 100644
index d2aee69..0000000
--- a/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class year_month;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const year_month& ym);
-//
-// Returns: os << ym.year() << '/' << ym.month().
-//
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const year_month& ym);
-//
-// Effects: Streams ym into os using the format specified by the NTCTS fmt. fmt encoding follows the rules specified in 25.11.
-//
-// template<class charT, class traits, class Alloc = allocator<charT>>
-// basic_istream<charT, traits>&
-// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
-// year_month& ym, basic_string<charT, traits, Alloc>* abbrev = nullptr,
-// minutes* offset = nullptr);
-//
-// Effects: Attempts to parse the input stream is into the year_month ym using the format
-// flags given in the NTCTS fmt as specified in 25.12. If the parse fails to decode
-// a valid year_month, is.setstate(ios_- base::failbit) shall be called and ym shall
-// not be modified. If %Z is used and successfully parsed, that value will be assigned
-// to *abbrev if abbrev is non-null. If %z (or a modified variant) is used and
-// successfully parsed, that value will be assigned to *offset if offset is non-null.
-
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using year_month = std::chrono::year_month;
- using year = std::chrono::year;
- using month = std::chrono::month;
-
- std::cout << year_month{year{2018}, month{3}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ctor.sys_days.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ctor.sys_days.pass.cpp
index 01311ce..b0d963a 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ctor.sys_days.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ctor.sys_days.pass.cpp
@@ -59,8 +59,8 @@
}
-// There's one more leap day between 1/1/40 and 1/1/70
-// when compared to 1/1/70 -> 1/1/2000
+ // There's one more leap day between 1/1/40 and 1/1/70
+ // when compared to 1/1/70 -> 1/1/2000
{
constexpr sys_days sd{days{-10957}};
constexpr year_month_day ymd{sd};
@@ -81,5 +81,5 @@
assert( ymd.day() == day{29});
}
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ok.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ok.pass.cpp
index 078cc85..8d38a6f 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ok.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ok.pass.cpp
@@ -43,7 +43,7 @@
static_assert( year_month_day{year{2019}, January, day{1}}.ok(), ""); // All OK
-// Some months have a 31st
+ // Some months have a 31st
static_assert( year_month_day{year{2020}, month{ 1}, day{31}}.ok(), "");
static_assert(!year_month_day{year{2020}, month{ 2}, day{31}}.ok(), "");
static_assert( year_month_day{year{2020}, month{ 3}, day{31}}.ok(), "");
@@ -57,7 +57,7 @@
static_assert(!year_month_day{year{2020}, month{11}, day{31}}.ok(), "");
static_assert( year_month_day{year{2020}, month{12}, day{31}}.ok(), "");
-// Everyone except FEB has a 30th
+ // Everyone except FEB has a 30th
static_assert( year_month_day{year{2020}, month{ 1}, day{30}}.ok(), "");
static_assert(!year_month_day{year{2020}, month{ 2}, day{30}}.ok(), "");
static_assert( year_month_day{year{2020}, month{ 3}, day{30}}.ok(), "");
@@ -93,5 +93,5 @@
assert( ym.ok() == year{i}.ok());
}
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.local_days.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.local_days.pass.cpp
index 76292f5..54f6d84 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.local_days.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.local_days.pass.cpp
@@ -72,8 +72,8 @@
static_assert( year_month_day{sd} == ymd, ""); // and back
}
-// There's one more leap day between 1/1/40 and 1/1/70
-// when compared to 1/1/70 -> 1/1/2000
+ // There's one more leap day between 1/1/40 and 1/1/70
+ // when compared to 1/1/70 -> 1/1/2000
{
constexpr year_month_day ymd{year{1940}, month{1}, day{2}};
constexpr local_days sd{ymd};
diff --git a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp
index bc80192..195ddfb 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp
@@ -72,8 +72,8 @@
static_assert( year_month_day{sd} == ymd, ""); // and back
}
-// There's one more leap day between 1/1/40 and 1/1/70
-// when compared to 1/1/70 -> 1/1/2000
+ // There's one more leap day between 1/1/40 and 1/1/70
+ // when compared to 1/1/70 -> 1/1/2000
{
constexpr year_month_day ymd{year{1940}, month{1}, day{2}};
constexpr sys_days sd{ymd};
@@ -90,7 +90,7 @@
assert( year_month_day{sd} == ymd); // and back
}
-// These two tests check the wording for LWG 3206
+ // These two tests check the wording for LWG 3206
{
constexpr year_month_day ymd{year{1971}, month{1}, day{0}}; // bad day
static_assert(!ymd.ok(), "");
diff --git a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/comparisons.pass.cpp
index 5290759..287dc3a 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/comparisons.pass.cpp
@@ -47,51 +47,51 @@
year_month_day{year{1234}, January, day{1}},
true, false), "");
-// different day
+ // different day
static_assert( testComparisons6(
year_month_day{year{1234}, January, day{1}},
year_month_day{year{1234}, January, day{2}},
false, true), "");
-// different month
+ // different month
static_assert( testComparisons6(
year_month_day{year{1234}, January, day{1}},
year_month_day{year{1234}, February, day{1}},
false, true), "");
-// different year
+ // different year
static_assert( testComparisons6(
year_month_day{year{1234}, January, day{1}},
year_month_day{year{1235}, January, day{1}},
false, true), "");
-// different month and day
+ // different month and day
static_assert( testComparisons6(
year_month_day{year{1234}, January, day{2}},
year_month_day{year{1234}, February, day{1}},
false, true), "");
-// different year and month
+ // different year and month
static_assert( testComparisons6(
year_month_day{year{1234}, February, day{1}},
year_month_day{year{1235}, January, day{1}},
false, true), "");
-// different year and day
+ // different year and day
static_assert( testComparisons6(
year_month_day{year{1234}, January, day{2}},
year_month_day{year{1235}, January, day{1}},
false, true), "");
-// different year, month and day
+ // different year, month and day
static_assert( testComparisons6(
year_month_day{year{1234}, February, day{2}},
year_month_day{year{1235}, January, day{1}},
false, true), "");
-// same year, different days
+ // same year, different days
for (unsigned i = 1; i < 28; ++i)
for (unsigned j = 1; j < 28; ++j)
assert((testComparisons6(
@@ -99,7 +99,7 @@
year_month_day{year{1234}, January, day{j}},
i == j, i < j )));
-// same year, different months
+ // same year, different months
for (unsigned i = 1; i < 12; ++i)
for (unsigned j = 1; j < 12; ++j)
assert((testComparisons6(
@@ -107,13 +107,13 @@
year_month_day{year{1234}, month{j}, day{12}},
i == j, i < j )));
-// same month, different years
- for (int i = 1000; i < 20; ++i)
- for (int j = 1000; j < 20; ++j)
+ // same month, different years
+ for (int i = 1000; i < 2000; ++i)
+ for (int j = 1000; j < 2000; ++j)
assert((testComparisons6(
year_month_day{year{i}, January, day{12}},
year_month_day{year{j}, January, day{12}},
i == j, i < j )));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 3991efa..0000000
--- a/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class year_month_day;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const year_month_day& ym);
-//
-// Returns: os << ym.year() << '/' << ym.month().
-//
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const year_month_day& ym);
-//
-// Effects: Streams ym into os using the format specified by the NTCTS fmt. fmt encoding follows the rules specified in 25.11.
-//
-// template<class charT, class traits, class Alloc = allocator<charT>>
-// basic_istream<charT, traits>&
-// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
-// year_month_day& ym, basic_string<charT, traits, Alloc>* abbrev = nullptr,
-// minutes* offset = nullptr);
-//
-// Effects: Attempts to parse the input stream is into the year_month_day ym using the format
-// flags given in the NTCTS fmt as specified in 25.12. If the parse fails to decode
-// a valid year_month_day, is.setstate(ios_- base::failbit) shall be called and ym shall
-// not be modified. If %Z is used and successfully parsed, that value will be assigned
-// to *abbrev if abbrev is non-null. If %z (or a modified variant) is used and
-// successfully parsed, that value will be assigned to *offset if offset is non-null.
-
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using year_month_day = std::chrono::year_month_day;
- using year = std::chrono::year;
- using month = std::chrono::month;
- using day = std::chrono::day;
-
- std::cout << year_month_day{year{2018}, month{3}, day{12}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/day.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/day.pass.cpp
index 0dc3ada..cf3c109 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/day.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/day.pass.cpp
@@ -30,7 +30,7 @@
ASSERT_NOEXCEPT( std::declval<const year_month_day_last>().day());
ASSERT_SAME_TYPE(day, decltype(std::declval<const year_month_day_last>().day()));
-// Some months have a 31st
+ // Some months have a 31st
static_assert( year_month_day_last{year{2020}, month_day_last{month{ 1}}}.day() == day{31}, "");
static_assert( year_month_day_last{year{2020}, month_day_last{month{ 2}}}.day() == day{29}, "");
static_assert( year_month_day_last{year{2020}, month_day_last{month{ 3}}}.day() == day{31}, "");
@@ -48,5 +48,5 @@
assert((year_month_day_last{year{2020}, month_day_last{month{ 2}}}.day() == day{29}));
assert((year_month_day_last{year{2021}, month_day_last{month{ 2}}}.day() == day{28}));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp
index 4e4a59b..54b4707 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp
@@ -44,31 +44,31 @@
year_month_day_last{year{1234}, month_day_last{January}},
true, false), "");
-// different month
+ // different month
static_assert( testComparisons6(
year_month_day_last{year{1234}, month_day_last{January}},
year_month_day_last{year{1234}, month_day_last{February}},
false, true), "");
-// different year
+ // different year
static_assert( testComparisons6(
year_month_day_last{year{1234}, month_day_last{January}},
year_month_day_last{year{1235}, month_day_last{January}},
false, true), "");
-// different month
+ // different month
static_assert( testComparisons6(
year_month_day_last{year{1234}, month_day_last{January}},
year_month_day_last{year{1234}, month_day_last{February}},
false, true), "");
-// different year and month
+ // different year and month
static_assert( testComparisons6(
year_month_day_last{year{1234}, month_day_last{February}},
year_month_day_last{year{1235}, month_day_last{January}},
false, true), "");
-// same year, different months
+ // same year, different months
for (unsigned i = 1; i < 12; ++i)
for (unsigned j = 1; j < 12; ++j)
assert((testComparisons6(
@@ -76,13 +76,13 @@
year_month_day_last{year{1234}, month_day_last{month{j}}},
i == j, i < j )));
-// same month, different years
- for (int i = 1000; i < 20; ++i)
- for (int j = 1000; j < 20; ++j)
+ // same month, different years
+ for (int i = 1000; i < 2000; ++i)
+ for (int j = 1000; j < 2000; ++j)
assert((testComparisons6(
year_month_day_last{year{i}, month_day_last{January}},
year_month_day_last{year{j}, month_day_last{January}},
i == j, i < j )));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/minus.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/minus.pass.cpp
index d8d58b0..59dca84 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/minus.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/minus.pass.cpp
@@ -75,7 +75,7 @@
ASSERT_SAME_TYPE(year_month_day_last, decltype(std::declval<year_month_day_last>() - std::declval<months>()));
static_assert(testConstexprMonths(year_month_day_last{year{1234}, month_day_last{December}}), "");
-// TODO test wrapping
+ // TODO test wrapping
year_month_day_last ym{year{1234}, month_day_last{December}};
for (unsigned i = 0; i <= 10; ++i)
{
@@ -86,5 +86,5 @@
}
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 1476fc8..0000000
--- a/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class year_month_day_last;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const year_month_day_last& ymdl);
-//
-// Returns: os << ymdl.year() << '/' << ymdl.month_day_last().
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using year_month_day_last = std::chrono::year_month_day_last;
- using year = std::chrono::year;
- using month = std::chrono::month;
- using month_day_last = std::chrono::month_day_last;
-
- std::cout << year_month_day_last{year{2018}, month_day_last{month{3}}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/op.local_days.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/op.local_days.pass.cpp
index ea25715..51d1942 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/op.local_days.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/op.local_days.pass.cpp
@@ -52,8 +52,8 @@
static_assert( year_month_weekday{sd} == ymwd, ""); // and back
}
-// There's one more leap day between 1/1/40 and 1/1/70
-// when compared to 1/1/70 -> 1/1/2000
+ // There's one more leap day between 1/1/40 and 1/1/70
+ // when compared to 1/1/70 -> 1/1/2000
{
constexpr year_month_weekday ymwd{year{1940}, month{1},weekday_indexed{std::chrono::Tuesday, 1}};
constexpr local_days sd{ymwd};
diff --git a/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/op.sys_days.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/op.sys_days.pass.cpp
index 52ca0fc..9bfa047 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/op.sys_days.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/op.sys_days.pass.cpp
@@ -52,8 +52,8 @@
static_assert( year_month_weekday{sd} == ymwd, ""); // and back
}
-// There's one more leap day between 1/1/40 and 1/1/70
-// when compared to 1/1/70 -> 1/1/2000
+ // There's one more leap day between 1/1/40 and 1/1/70
+ // when compared to 1/1/70 -> 1/1/2000
{
constexpr year_month_weekday ymwd{year{1940}, month{1},weekday_indexed{std::chrono::Tuesday, 1}};
constexpr sys_days sd{ymwd};
diff --git a/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/comparisons.pass.cpp
index 438fb48..be0a84c 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/comparisons.pass.cpp
@@ -42,51 +42,51 @@
year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}},
true), "");
-// different day
+ // different day
static_assert( testComparisons2(
year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}},
year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 2}},
false), "");
-// different month
+ // different month
static_assert( testComparisons2(
year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}},
year_month_weekday{year{1234}, February, weekday_indexed{Tuesday, 1}},
false), "");
-// different year
+ // different year
static_assert( testComparisons2(
year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}},
year_month_weekday{year{1235}, January, weekday_indexed{Tuesday, 1}},
false), "");
-// different month and day
+ // different month and day
static_assert( testComparisons2(
year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}},
year_month_weekday{year{1234}, February, weekday_indexed{Tuesday, 2}},
false), "");
-// different year and month
+ // different year and month
static_assert( testComparisons2(
year_month_weekday{year{1234}, February, weekday_indexed{Tuesday, 1}},
year_month_weekday{year{1235}, January, weekday_indexed{Tuesday, 1}},
false), "");
-// different year and day
+ // different year and day
static_assert( testComparisons2(
year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 2}},
year_month_weekday{year{1235}, January, weekday_indexed{Tuesday, 1}},
false), "");
-// different year, month and day
+ // different year, month and day
static_assert( testComparisons2(
year_month_weekday{year{1234}, February, weekday_indexed{Tuesday, 2}},
year_month_weekday{year{1235}, January, weekday_indexed{Tuesday, 1}},
false), "");
-// same year, different days
+ // same year, different days
for (unsigned i = 1; i < 28; ++i)
for (unsigned j = 1; j < 28; ++j)
assert((testComparisons2(
@@ -94,7 +94,7 @@
year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, j}},
i == j)));
-// same year, different months
+ // same year, different months
for (unsigned i = 1; i < 12; ++i)
for (unsigned j = 1; j < 12; ++j)
assert((testComparisons2(
@@ -102,13 +102,13 @@
year_month_weekday{year{1234}, month{j}, weekday_indexed{Tuesday, 1}},
i == j)));
-// same month, different years
- for (int i = 1000; i < 20; ++i)
- for (int j = 1000; j < 20; ++j)
+ // same month, different years
+ for (int i = 1000; i < 2000; ++i)
+ for (int j = 1000; j < 2000; ++j)
assert((testComparisons2(
year_month_weekday{year{i}, January, weekday_indexed{Tuesday, 1}},
year_month_weekday{year{j}, January, weekday_indexed{Tuesday, 1}},
i == j)));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 2166082..0000000
--- a/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class year_month_weekday;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const year_month_weekday& ym);
-//
-// Returns: os << ym.year() << '/' << ym.month().
-//
-//
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const year_month_weekday& ym);
-//
-// Effects: Streams ym into os using the format specified by the NTCTS fmt. fmt encoding follows the rules specified in 25.11.
-//
-// template<class charT, class traits, class Alloc = allocator<charT>>
-// basic_istream<charT, traits>&
-// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
-// year_month_weekday& ym, basic_string<charT, traits, Alloc>* abbrev = nullptr,
-// minutes* offset = nullptr);
-//
-// Effects: Attempts to parse the input stream is into the year_month_weekday ym using the format
-// flags given in the NTCTS fmt as specified in 25.12. If the parse fails to decode
-// a valid year_month_weekday, is.setstate(ios_- base::failbit) shall be called and ym shall
-// not be modified. If %Z is used and successfully parsed, that value will be assigned
-// to *abbrev if abbrev is non-null. If %z (or a modified variant) is used and
-// successfully parsed, that value will be assigned to *offset if offset is non-null.
-
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using year_month_weekday = std::chrono::year_month_weekday;
- using year = std::chrono::year;
- using month = std::chrono::month;
- using weekday = std::chrono::weekday;
-
- std::cout << year_month_weekday{year{2018}, month{3}, weekday{4}};
-
- return 0;
-}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/comparisons.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/comparisons.pass.cpp
index 2e9dbad..5c008c7 100644
--- a/test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/comparisons.pass.cpp
+++ b/test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/comparisons.pass.cpp
@@ -43,51 +43,51 @@
year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}},
true), "");
-// different day
+ // different day
static_assert( testComparisons2(
year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}},
year_month_weekday_last{year{1234}, January, weekday_last{Wednesday}},
false), "");
-// different month
+ // different month
static_assert( testComparisons2(
year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}},
year_month_weekday_last{year{1234}, February, weekday_last{Tuesday}},
false), "");
-// different year
+ // different year
static_assert( testComparisons2(
year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}},
year_month_weekday_last{year{1235}, January, weekday_last{Tuesday}},
false), "");
-// different month and day
+ // different month and day
static_assert( testComparisons2(
year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}},
year_month_weekday_last{year{1234}, February, weekday_last{Wednesday}},
false), "");
-// different year and month
+ // different year and month
static_assert( testComparisons2(
year_month_weekday_last{year{1234}, February, weekday_last{Tuesday}},
year_month_weekday_last{year{1235}, January, weekday_last{Tuesday}},
false), "");
-// different year and day
+ // different year and day
static_assert( testComparisons2(
year_month_weekday_last{year{1234}, January, weekday_last{Wednesday}},
year_month_weekday_last{year{1235}, January, weekday_last{Tuesday}},
false), "");
-// different year, month and day
+ // different year, month and day
static_assert( testComparisons2(
year_month_weekday_last{year{1234}, February, weekday_last{Wednesday}},
year_month_weekday_last{year{1235}, January, weekday_last{Tuesday}},
false), "");
-// same year, different days
+ // same year, different days
for (unsigned i = 1; i < 28; ++i)
for (unsigned j = 1; j < 28; ++j)
assert((testComparisons2(
@@ -95,7 +95,7 @@
year_month_weekday_last{year{1234}, January, weekday_last{weekday{j}}},
i == j)));
-// same year, different months
+ // same year, different months
for (unsigned i = 1; i < 12; ++i)
for (unsigned j = 1; j < 12; ++j)
assert((testComparisons2(
@@ -103,13 +103,13 @@
year_month_weekday_last{year{1234}, month{j}, weekday_last{Tuesday}},
i == j)));
-// same month, different years
- for (int i = 1000; i < 20; ++i)
- for (int j = 1000; j < 20; ++j)
+ // same month, different years
+ for (int i = 1000; i < 2000; ++i)
+ for (int j = 1000; j < 2000; ++j)
assert((testComparisons2(
year_month_weekday_last{year{i}, January, weekday_last{Tuesday}},
year_month_weekday_last{year{j}, January, weekday_last{Tuesday}},
i == j)));
- return 0;
+ return 0;
}
diff --git a/test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/streaming.pass.cpp b/test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/streaming.pass.cpp
deleted file mode 100644
index 3f792fd..0000000
--- a/test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/streaming.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: *
-
-// <chrono>
-// class year_month_weekday_last;
-
-// template<class charT, class traits>
-// basic_ostream<charT, traits>&
-// operator<<(basic_ostream<charT, traits>& os, const year_month_weekday_last& ymwdl);
-//
-// Returns: os << ymwdl.year() << '/' << ymwdl.month() << '/' << ymwdl.weekday_last().
-
-
-#include <chrono>
-#include <type_traits>
-#include <cassert>
-#include <iostream>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- using year_month_weekday_last = std::chrono::year_month_weekday_last;
- using year = std::chrono::year;
- using month = std::chrono::month;
- using weekday = std::chrono::weekday;
- using weekday_last = std::chrono::weekday_last;
-
- std::cout << year_month_weekday_last{year{2018}, month{3}, weekday_last{weekday{4}}};
-
- return 0;
-}