Skip to content

Workaround for MSVC's constexpr array allocation bug for vector - #6177

Merged
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
frederick-vs-ja:workaround-dev-11060638
Mar 27, 2026
Merged

Workaround for MSVC's constexpr array allocation bug for vector#6177
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
frederick-vs-ja:workaround-dev-11060638

Conversation

@frederick-vs-ja

Copy link
Copy Markdown
Contributor

This PR adds workaround for DevCom-11060638 needed for vector. Closes #6155.

Due the implementation strategy of MSVC, if a user directly uses allocator<T[N]>::allocate, the behavior in constant evaluation is still broken. There doesn't seem any possible workaround in the library implementation for this.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the enhancement Something can be improved label Mar 25, 2026
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Initial Review to Ready To Merge in STL Code Reviews Mar 25, 2026
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo. Please notify me if any further changes are pushed, otherwise no action is required.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Ready To Merge to Merging in STL Code Reviews Mar 26, 2026
@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 05b4b08 into microsoft:main Mar 27, 2026
49 checks passed
@github-project-automation github-project-automation Bot moved this from Merging to Done in STL Code Reviews Mar 27, 2026
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for reporting and working around this bug! 😻 🕵️ 🪲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved test Related to test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P1004R2_constexpr_vector: Report MSVC constexpr error affecting std::construct_at array support

2 participants