Skip to content

Conversation

@frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Dec 1, 2025

Fixes #5110.

Currently, all tested compilers (MSVC, Clang, and EDG) need some workaround for constant evaluation.

  • MSVC is blocked by lack of [[msvc::constexpr]] of the involved operator new[] in VCRuntime.
    • I'm attempting to introduce a new operator new[] overload, which is sufficiently constrained to avoid affecting overload resolution, as a workaround. However, it doesn't work for non-trivially destructible element types, because MSVC will require additional space to record the number of class objects to destroy.
  • Clang crashes when directly using the final resolution of LWG-3436.
    • The old proposed resolution is used as a workaround.
  • EDG simply can't accept the final resolution in constant evaluation.
    • The old proposed resolution is used as a workaround.
  • Also, EDG doesn't correctly recognize the allocated element type of std::allocator<T[N]>::allocate in constant evaluation.
    • Workaround is unknown, so such case isn't made supported for EDG yet.
  • Also, EDG crashes in some cases in constant evaluation.
    • Workaround is unknown, so such case isn't made supported for EDG yet.

Reported issues:

@StephanTLavavej StephanTLavavej added the LWG Library Working Group issue label Dec 1, 2025
@StephanTLavavej
Copy link
Member

Thanks for reporting all of these compiler bugs, I really appreciate it! 😻

@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Jan 30, 2026
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Jan 30, 2026
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 7f083b9 into microsoft:main Feb 2, 2026
45 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Feb 2, 2026
@StephanTLavavej
Copy link
Member

⚙️ 😻 🎁

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

Labels

LWG Library Working Group issue

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

LWG-3436 std::construct_at should support arrays

2 participants