STL.natvis: Fixed time_point visualization of year off-by-one#5389
Merged
StephanTLavavej merged 1 commit intomicrosoft:mainfrom Apr 10, 2025
Merged
STL.natvis: Fixed time_point visualization of year off-by-one#5389StephanTLavavej merged 1 commit intomicrosoft:mainfrom
STL.natvis: Fixed time_point visualization of year off-by-one#5389StephanTLavavej merged 1 commit intomicrosoft:mainfrom
Conversation
When the `time_point` is sometime in February, the debugger visualization of the year will be off-by-one.
StephanTLavavej
approved these changes
Apr 2, 2025
Member
|
Thanks! 😻 I checked the product code and it's consistent with this fix: Line 841 in 6d25346 Line 3392 in 6d25346 We merge PRs simultaneously to the GitHub and MSVC-internal repos in a semi-manual process, batched up to save time. Your PR will be part of the next batch, likely next week. I'll post comments here as I prepare your PR for merging. This PR is special as it will have to be triple-mirrored to the VS repo, which I haven't done in a long time, fun! |
Contributor
|
Thank you for noticing and fixing this! |
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks again for fixing this visualizer bug, and congratulations on your first microsoft/STL commit! 🎉 🚀 😻 I triple-mirrored this change to VS so it will take effect, internal VS-PR-627142. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the
time_pointis sometime in February, the debugger visualization of the year will be off-by-one.You can test this with this little snippet:
The console output will be correct:
2025-02-15 | 2025-02-15 00:00:00.0000000But the debugger shows a year of 2024 for

tp:As per the referenced calculation used to construct the debugger visualization, the year should be calculated by this formula:
const Int y = static_cast<Int>(yoe) + era * 400; ... (y + (m <= 2)But the nativs contains this:
<Intrinsic Name="year" Expression="((long long)yoe()) + era() * 400 + (month() < 2)"/>Missing the
=sign in the less-than-or-equal 2 check.