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

date: support gcc14 on test_package #23946

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Changes from 3 commits
Commits
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
10 changes: 6 additions & 4 deletions recipes/date/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ZoneOffset {
-> date::local_time<typename std::common_type<Duration, std::chrono::minutes>::type> {
using namespace date;
using namespace std::chrono;
using LT = local_time<typename std::common_type<Duration, minutes>::type>;
using LT = date::local_time<typename std::common_type<Duration, minutes>::type>;
return LT{(tp + _offset).time_since_epoch()};
}

Expand All @@ -25,7 +25,7 @@ class ZoneOffset {
-> date::sys_time<typename std::common_type<Duration, std::chrono::minutes>::type> {
using namespace date;
using namespace std::chrono;
using ST = sys_time<typename std::common_type<Duration, minutes>::type>;
using ST = date::sys_time<typename std::common_type<Duration, minutes>::type>;
return ST{(tp - _offset).time_since_epoch()};
}

Expand All @@ -34,7 +34,9 @@ class ZoneOffset {
};

int main() {
using namespace std::chrono;
using std::chrono::hours;
using std::chrono::milliseconds;
using std::chrono::minutes;
using namespace date;

auto date1 = 2015_y/March/22;
Expand All @@ -45,7 +47,7 @@ int main() {
std::cout << date3 << '\n';

ZoneOffset p3_45{hours{3} + minutes{45}};
zoned_time<milliseconds, ZoneOffset*> zt{&p3_45, floor<milliseconds>(system_clock::now())};
zoned_time<milliseconds, ZoneOffset*> zt{&p3_45, floor<milliseconds>(std::chrono::system_clock::now())};
std::cout << zt.get_sys_time() << " (sys time)\n";
std::cout << zt.get_local_time() << " (local time)\n";

Expand Down