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
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

Status: Initial Review

Development

Successfully merging this pull request may close these issues.

LWG-3436 std::construct_at should support arrays

2 participants