Repository navigation
[Support] Explicitly cast NANOSECONDS_PER_SECOND in TimeValue for C++26 #9021
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
base: main
Are you sure you want to change the base?
Changes from all commits
265ea48
090895d
d4497c5
c6bf6ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,8 +107,9 @@ namespace sys { | |
| : seconds_( 0 ) , nanos_ ( 0 ) { | ||
| SecondsType integer_part = static_cast<SecondsType>( new_time ); | ||
| seconds_ = integer_part; | ||
| nanos_ = static_cast<NanoSecondsType>( (new_time - | ||
| static_cast<double>(integer_part)) * NANOSECONDS_PER_SECOND ); | ||
| nanos_ = static_cast<NanoSecondsType>( | ||
| (new_time - static_cast<double>(integer_part)) * | ||
| static_cast<double>(NANOSECONDS_PER_SECOND)); | ||
|
Comment on lines
+110
to
+112
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a unit test in unittests/Support/TimeValueTest.cpp covering the sys::TimeValue(double) constructor. As noted in CONTRIBUTING.md:145-157 regarding changes for external projects and test infrastructure limitations, DXC's host build environment and test suite compile in C++14/C++17 across all CI runners and do not provide a Clang 22 / -std=c++26 toolchain to run compile-only C++26 tests directly in CI. |
||
| this->normalize(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added release note to docs/ReleaseNotes.md under ### Upcoming Release -> #### Bug Fixes.