This effectively implements the resolution of LWG3231, which mandates
that calling year_month_day_last::day() on an invalid year_month_day_last
is unspecified behavior. Before this change, it was undefined behavior.
Details
Details
- Reviewers
howard.hinnant - Group Reviewers
Restricted Project - Commits
- rG1f48f8f6e289: [libc++] Avoid UB in year_month_day_last::day() for incorrect months
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Note that a test was added in cb347a1106a76e248a6c0d78451a018b20662c03, and in fact this UB did trigger a failure in the ASAN bot due to the added test.
So basically this commit fixes the LWG issue, and the tests for it have been added in cb347a1106a76e248a6c0d78451a018b20662c03. Sorry if that's confusing, everything should have been added in this commit, but I didn't fully understand the issue yet and I didn't know this commit was going to be necessary.