Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<chrono> Partially implement P0355R7 #323

Merged
merged 159 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from 152 commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
cb05812
Partially implement P0355R7
SuperWig Nov 15, 2019
834bf8a
Restore _Days_from_civil()
SuperWig Nov 23, 2019
cda289a
Remove new lines
SuperWig Nov 24, 2019
91dd7bb
Use year_month_day_last for year_month_weekday::ok()
SuperWig Nov 24, 2019
f6e5a80
Merge remote-tracking branch 'origin/master' into date
SuperWig Apr 3, 2020
dc5fda1
Use auto and disable warning supression
SuperWig Apr 3, 2020
8db80ec
Initial test code
SuperWig Apr 3, 2020
0858320
Fix day - days
SuperWig Apr 3, 2020
589eaf1
Finish day_test()
SuperWig Apr 4, 2020
25f90b6
Missed day - day
SuperWig Apr 4, 2020
f7e321a
Add month_test()
SuperWig Apr 4, 2020
c0217d1
Use types instead of casting
SuperWig Apr 4, 2020
e5bc021
Add year_test()
SuperWig Apr 4, 2020
ee0efe8
Add weekday_test() and fix formatting
SuperWig Apr 4, 2020
f6c31be
Fix weekday - weekday
SuperWig Apr 4, 2020
95317cb
Add weekday_indexed_test() and restore static_assert
SuperWig Apr 4, 2020
a701110
Add weekday_last_test()
SuperWig Apr 4, 2020
b6613a4
Add test for time_point arithmetic
SuperWig Apr 5, 2020
6a84894
Create macro for type requirements
SuperWig Apr 5, 2020
4a47573
Add month_day_test()
SuperWig Apr 5, 2020
f4f998d
Restore CMakeSettings.json
SuperWig Apr 5, 2020
22cbc25
Add month_day_last_test()
SuperWig Apr 6, 2020
797414a
Add year_month_test()
SuperWig Apr 6, 2020
2b3206d
Add month_weekday_test() and month_weekday_last_test()
SuperWig Apr 6, 2020
75abdf1
Add non-passing year_month_day_test()
SuperWig Apr 6, 2020
6bcfe98
Fix _Civil_from_days()
SuperWig Apr 6, 2020
3febc0b
Counting is hard.
SuperWig Apr 6, 2020
32929fc
Add year_month_day_last_test()
SuperWig Apr 6, 2020
25572e9
Add year_month_weekday_test()
SuperWig Apr 7, 2020
32506d5
Fix _Days_from_civil()
SuperWig Apr 7, 2020
0a8275f
Add year_month_weekday_last_test()
SuperWig Apr 7, 2020
c661393
Add syntax_test()
SuperWig Apr 7, 2020
129aaa0
Remove commented out #pragma
SuperWig Apr 7, 2020
ce491f1
_NODISCARD
SuperWig Apr 8, 2020
69da9ab
_NODISCARD privates and remove unneeded friends
SuperWig Apr 8, 2020
421eb2d
Split test
SuperWig Apr 8, 2020
00bbbb7
Remove moved over test
SuperWig Apr 10, 2020
849be1d
Constants and literals pt1 (and fix year_month test)
SuperWig Apr 10, 2020
bf31ef7
Constants and literals pt2
SuperWig Apr 10, 2020
d9601f1
Consistency
SuperWig Apr 10, 2020
38899f9
Add last_spec
SuperWig Apr 12, 2020
9f2e44e
Add duration and time_point alias tests
SuperWig Apr 12, 2020
c96c780
Whitespace
SuperWig Apr 12, 2020
dc45a4d
Ain't got no alibi
SuperWig Apr 13, 2020
be61df9
Merge branch 'master' into date
SuperWig Apr 14, 2020
5315116
Comment out unused variables
SuperWig Apr 14, 2020
7d77939
Newlines
SuperWig Apr 14, 2020
028270d
Move day
SuperWig Apr 14, 2020
dc1cc2e
Move month and year
SuperWig Apr 14, 2020
3997cbe
Move weekday_*
SuperWig Apr 14, 2020
92ed0d5
Move month_*
SuperWig Apr 14, 2020
caf2bf4
Move year_month
SuperWig Apr 15, 2020
8ec02ed
Move year_month_day
SuperWig Apr 15, 2020
c35767a
Move year_month_day_last
SuperWig Apr 15, 2020
bd300ae
Move year_month_weekday
SuperWig Apr 15, 2020
fc993a3
Move year_month_weekday_last
SuperWig Apr 15, 2020
467a63c
Remove / operator declarations
SuperWig Apr 15, 2020
fb11c21
Fix year::ok()?
SuperWig Apr 15, 2020
7d2e071
Merge remote-tracking branch 'origin/master' into date
SuperWig Apr 15, 2020
ed11f50
Unskip libcxx tests
SuperWig Apr 16, 2020
821be19
Add missing noexcept
SuperWig Apr 17, 2020
d58dc26
Merge branch 'date-libcxx' into date
SuperWig Apr 17, 2020
3d2e815
Missed year_month_day_last::ok()
SuperWig Apr 18, 2020
6c2ef28
Move commented out tests to their own function
SuperWig Apr 18, 2020
6a1d6d7
Whoops
SuperWig Apr 18, 2020
4eea657
Unskip C6294 failing libcxx tests
SuperWig Apr 21, 2020
2825beb
Merge remote-tracking branch 'origin/master' into date
SuperWig Apr 22, 2020
2c87c56
Suppress C6294 in tests
SuperWig Apr 23, 2020
c08b8d4
Merge remote-tracking branch 'origin/master' into date
SuperWig May 19, 2020
0c3620c
Failing minus tests now pass.
SuperWig May 19, 2020
fc7dc13
I want to pass
SuperWig May 19, 2020
ae9d2b3
Gimme the green
SuperWig May 19, 2020
e99eb62
Merge remote-tracking branch 'origin/master' into date
SuperWig Aug 25, 2020
1dc58e5
Forgot to re-disable warnings
SuperWig Aug 25, 2020
af29385
Add static_cast
SuperWig Aug 25, 2020
0cd3072
Use is_constant_evaluated()
SuperWig Aug 25, 2020
00c40f4
review comments
SuperWig Aug 26, 2020
161943d
down with chrono::?
SuperWig Aug 26, 2020
e242bc4
clang-format
SuperWig Aug 26, 2020
31886ce
down with some chrono::
SuperWig Aug 26, 2020
86d854b
Implement is_clock (and add a newline somewhere)
SuperWig Aug 26, 2020
f78cf1e
New line and guard
SuperWig Aug 26, 2020
1fbc151
Oopsie
SuperWig Aug 26, 2020
4b97f2f
Names and comment
SuperWig Sep 4, 2020
ab15729
"I don't need find and replace"
SuperWig Sep 5, 2020
77ff6ca
Implement hh_mm_ss and make12/24
SuperWig Sep 6, 2020
4aa79d9
dates_clocks -> clocks
SuperWig Sep 6, 2020
d152e39
Merge branch 'date' into date_hh_mm_ss
SuperWig Sep 6, 2020
4726484
Add hh_mm_ss tests
SuperWig Sep 7, 2020
0f3f047
Formatting
SuperWig Sep 7, 2020
2d082a2
Newline
SuperWig Sep 7, 2020
68e23c8
I should just use VS Code to format...
SuperWig Sep 7, 2020
a0634de
* Literals aren't strengthened
SuperWig Sep 19, 2020
933e7b1
Iterative _Pow10 and comment _Width
SuperWig Sep 25, 2020
ee8545b
Rename algorithm variables and add range comments
SuperWig Sep 25, 2020
2e52d57
Add test cases for constant evaluation
SuperWig Sep 25, 2020
93b39a1
_CHRONO
SuperWig Sep 25, 2020
b2cba79
One of these days...
SuperWig Sep 25, 2020
47dcd97
[skip ci] Rename _Width
SuperWig Sep 25, 2020
95d9c6a
Use @MattStephanson's implementation.
SuperWig Oct 2, 2020
00dd237
Add range for Fractional_width comment and reorder
SuperWig Oct 2, 2020
25e1138
Merge remote-tracking branch 'upstream/master' into date
SuperWig Oct 2, 2020
96f7df4
Apply suggestions from code review
SuperWig Oct 13, 2020
afffe87
Small fixes
SuperWig Oct 15, 2020
bfd6768
Merge remote-tracking branch 'upstream/master' into date
SuperWig Oct 15, 2020
3415231
Merge remote-tracking branch 'upstream/master' into date
SuperWig Oct 17, 2020
5104167
Add noexcept tests
SuperWig Oct 17, 2020
eab7728
Un-private _Fractional_width
SuperWig Oct 18, 2020
59a5c1e
noexcept Part 2 Featuring the Platinum Band
SuperWig Oct 18, 2020
aa7c2a3
And this time, we're gonna get funky
SuperWig Oct 19, 2020
8ab6173
Changes
SuperWig Oct 24, 2020
2b9d23e
The ONE file I forget to double check with clang-format
SuperWig Oct 24, 2020
188cbee
Deleting the correct member would be a good idea.
SuperWig Oct 24, 2020
58d2df7
Undo rename
SuperWig Oct 29, 2020
5358e0c
Merge remote-tracking branch 'upstream/master' into date
SuperWig Oct 30, 2020
ed8be65
_Is_Clock -> _Is_clock
SuperWig Oct 30, 2020
ba14ddb
Address STL's comment
SuperWig Nov 3, 2020
317a604
STL's feedback
SuperWig Nov 6, 2020
d0e68cc
Merge remote-tracking branch 'upstream/master' into date
SuperWig Nov 7, 2020
657a99b
Use a temp int
SuperWig Nov 7, 2020
21df61e
Condense year::operator+=
SuperWig Nov 8, 2020
dbd45b0
remove leading 0's
SuperWig Nov 15, 2020
f5f3865
Rename compile-only tests
cbezault Dec 5, 2020
63b027a
Merge remote-tracking branch 'upstream/master' into date
SuperWig Dec 12, 2020
2984f71
Run clang-format
SuperWig Dec 12, 2020
372cdd1
Merge branch 'master' into date
StephanTLavavej Jan 20, 2021
b0a9242
Merge branch 'master' into date
StephanTLavavej Jan 23, 2021
d7f300c
Adjust paper title in yvals_core.h.
StephanTLavavej Jan 23, 2021
91dd9c6
Organize libcxx skips due to bogus tests.
StephanTLavavej Jan 23, 2021
94aab5b
Code review feedback (trivial test changes).
StephanTLavavej Jan 23, 2021
3b47eb5
Fix fractional_width() test.
StephanTLavavej Jan 23, 2021
057fa28
statementreply's feedback
SuperWig Jan 25, 2021
e8c2922
More floating point
SuperWig Jan 25, 2021
e2cce70
Rename _M and _Y identifiers.
StephanTLavavej Jan 27, 2021
c976e34
For functions, constexpr implies inline.
StephanTLavavej Jan 27, 2021
096f859
Remove unnecessary as_const().
StephanTLavavej Jan 27, 2021
6064929
Use static member function syntax.
StephanTLavavej Jan 27, 2021
97c14eb
Construct temporaries with braces.
StephanTLavavej Jan 27, 2021
72c5fa3
Remove unnecessary assert parens.
StephanTLavavej Jan 27, 2021
8f8678c
Cleanup month_day tests.
StephanTLavavej Jan 27, 2021
ca40783
Replace lambda init-captures.
StephanTLavavej Jan 27, 2021
39a183c
Additional test and minor fixes
SuperWig Jan 27, 2021
a5e8029
Rename prev to previous.
StephanTLavavej Jan 27, 2021
f1b69e7
Limit extreme loop iterations.
StephanTLavavej Jan 27, 2021
72b2583
Verify that the "conventional syntax operators" are noexcept.
StephanTLavavej Jan 27, 2021
7153098
Adjust comment banner.
StephanTLavavej Jan 28, 2021
c3e6047
Drop unnecessary parentheses.
StephanTLavavej Jan 28, 2021
b0abcef
Reported EDG bug; add workaround/no-workaround codepaths.
StephanTLavavej Jan 28, 2021
7aa40d9
Mark unary plus and unary minus as _NODISCARD.
StephanTLavavej Jan 28, 2021
7018ac0
Don't need static_cast when widening short to int.
StephanTLavavej Jan 28, 2021
14e72c2
Use forward declarations instead of elaborated-type-specifiers.
StephanTLavavej Jan 28, 2021
c2aef59
Drop comments for out-of-line definitions.
StephanTLavavej Jan 28, 2021
9a7e0d4
Simplify month_day::ok's February logic.
StephanTLavavej Jan 28, 2021
ec33fb0
Simplify _Last_day's February logic.
StephanTLavavej Jan 28, 2021
876fb07
Construct temporary with braces.
StephanTLavavej Jan 28, 2021
efa0c70
Drop unnecessary parentheses around unary minus.
StephanTLavavej Jan 28, 2021
cc5f259
LWG-3260 "year_month* arithmetic rejects durations convertible to years"
StephanTLavavej Jan 29, 2021
dff5923
Work around Standard Library Header Units ICE.
StephanTLavavej Jan 29, 2021
4498598
Revert "Verify that the "conventional syntax operators" are noexcept."
StephanTLavavej Jan 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,426 changes: 1,379 additions & 47 deletions stl/inc/chrono

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
// P0318R1 unwrap_reference, unwrap_ref_decay
// P0325R4 to_array()
// P0339R6 polymorphic_allocator<>
// P0355R7 <chrono> Calendars And Time Zones
// (partially implemented)
// P0356R5 bind_front()
// P0357R3 Supporting Incomplete Types In reference_wrapper
// P0408R7 Efficient Access To basic_stringbuf's Buffer
Expand Down Expand Up @@ -1278,6 +1280,7 @@ compiler option, or define _ALLOW_RTCc_IN_STL to acknowledge that you have recei
#define _STD_BEGIN namespace std {
#define _STD_END }
#define _STD ::std::
#define _CHRONO ::std::chrono::
#define _RANGES ::std::ranges::

// We use the stdext (standard extension) namespace to contain extensions that are not part of the current standard
Expand Down
204 changes: 24 additions & 180 deletions tests/libcxx/expected_results.txt

Large diffs are not rendered by default.

204 changes: 24 additions & 180 deletions tests/libcxx/skipped_tests.txt

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions tests/std/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,12 @@ tests\P0220R1_searchers
tests\P0220R1_string_view
tests\P0325R4_to_array
tests\P0339R6_polymorphic_allocator
tests\P0355R7_calendars_and_time_zones_clocks
tests\P0355R7_calendars_and_time_zones_dates
tests\P0355R7_calendars_and_time_zones_dates_literals
tests\P0355R7_calendars_and_time_zones_hms
tests\P0355R7_calendars_and_time_zones_io
tests\P0355R7_calendars_and_time_zones_time_point_and_durations
tests\P0356R5_bind_front
tests\P0357R3_supporting_incomplete_types_in_reference_wrapper
tests\P0408R7_efficient_access_to_stringbuf_buffer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright (c) Microsoft Corporation.
SuperWig marked this conversation as resolved.
Show resolved Hide resolved
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <chrono>

using namespace std::chrono;

struct not_a_clock {
bool rep();
static char period;
int duration();
static float time_point;
using is_steady = long;
static int now;
};

struct real_fake_clock {
using rep = bool;
using period = char;
using duration = float;
using time_point = int;
static long is_steady;
static short now();
};

struct no_rep {
using period = char;
using duration = float;
using time_point = int;
static long is_steady;
static short now();
};

struct no_period {
using rep = bool;
using duration = float;
using time_point = int;
static long is_steady;
static short now();
};

struct no_duration {
using rep = bool;
using period = char;
using time_point = int;
static long is_steady;
static short now();
};

struct no_time_point {
using rep = bool;
using period = char;
using duration = float;
static long is_steady;
static short now();
};

struct no_steady {
using rep = bool;
using period = char;
using duration = float;
using time_point = int;
static short now();
};

struct no_now {
using rep = bool;
using period = char;
using duration = float;
using time_point = int;
static long is_steady;
};

static_assert(is_clock<steady_clock>::value, "steady_clock is not a clock");
static_assert(is_clock_v<steady_clock>, "steady_clock is not a clock");
static_assert(is_clock_v<real_fake_clock>, "real_fake_clock is not a clock");
static_assert(!is_clock_v<not_a_clock>, "not_a_clock is a clock");

static_assert(!is_clock_v<no_rep>, "no_rep is a clock");
static_assert(!is_clock_v<no_period>, "no_period is a clock");
static_assert(!is_clock_v<no_duration>, "no_duration is a clock");
static_assert(!is_clock_v<no_time_point>, "no_time_point is a clock");
static_assert(!is_clock_v<no_steady>, "no_steady is a clock");
static_assert(!is_clock_v<no_now>, "no_now is a clock");

int main() {} // COMPILE-ONLY
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
Loading