Skip to content

P2590R2 Explicit Lifetime Management#6170

Open
StephanTLavavej wants to merge 1 commit intomicrosoft:mainfrom
StephanTLavavej:start-lifetime-as
Open

P2590R2 Explicit Lifetime Management#6170
StephanTLavavej wants to merge 1 commit intomicrosoft:mainfrom
StephanTLavavej:start-lifetime-as

Conversation

@StephanTLavavej
Copy link
Member

Fixes #2942 by implementing start_lifetime_as and start_lifetime_as_array for MSVC. Filed #6169 as a followup issue for Clang and EDG.

@JonCavesMSFT's internal MSVC-PR-703299 on 2026-01-31 implemented do-nothing intrinsics because C2 (the MSVC backend) doesn't implement type-based alias analysis and there are currently no plans to do so. However, if we ever implement such optimizations in the 24th century, the intrinsics will be updated accordingly.

I have intentionally avoided marking these functions as [[nodiscard]] because they can be validly called for their "side effects" and their return value is not critical. (Unlike std::launder(), where the "magic" happens in the return value only.)

@StephanTLavavej StephanTLavavej requested a review from a team as a code owner March 20, 2026 20:31
@StephanTLavavej StephanTLavavej added the cxx23 C++23 feature label Mar 20, 2026
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Mar 20, 2026
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in STL Code Reviews Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx23 C++23 feature

Projects

Status: Final Review

Development

Successfully merging this pull request may close these issues.

P2590R2 Explicit Lifetime Management

1 participant