Skip to content

server 0.24.1, vscode 0.24.1: MSVC STL units keep aligned allocation on the maintained engine (#97), and S1 0.4.0 ide.generated origin (was #98) - #99

Merged
Sunrisepeak merged 3 commits into
mainfrom
fix/issue-97-msvc-aligned-allocation
Nov 22, 2026
Merged

Sunrisepeak merged 3 commits into
mainfrom
fix/issue-97-msvc-aligned-allocation

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Fixes #97. Design: .agents/docs/2026-11-23-issue-97-msvc-aligned-allocation-design.md.

The defect is mcppls's

WA-CLANGD-005 adds -fno-aligned-allocation to every MSVC STL unit. It was added for llvm-project#218152, which made align_val_t ambiguous in the MSVC STL std module on clang 23.1.0. The flag has a side effect: clang no longer defines __cpp_aligned_new, so vcruntime_new.h drops std::align_val_t and the aligned operator new/delete. Conforming headers that use them unconditionally then fail, but only in clangd. Slint 1.19's vtable.h is one; the project itself builds.

The bundled engine never needed the workaround:

  • mcppls-clangd has carried the upstream fix (llvm-project#219151, patches/0001-UP-05) in every release since v0.0.2.
  • The register retires the workaround by LLVM base version (fixedIn = "23.1.1"). The engine reports 23.1.0-mcppls.12, so the workaround was never retired.

Changes (server only; no engine or Slint change)

  • R1: a workaround can be marked fixedInMaintained. WA-CLANGD-005 is, so MSVC STL units keep aligned allocation on the maintained engine, as the real build does.
  • R2: where the workaround still applies (an upstream 23.1.0 named with mcppls.clangd), it now also defines -D__cpp_aligned_new=201606L. The std unit keeps the macro too. The macro is not added when the build itself turns aligned new off (/Zc:alignedNew-).
  • Versions: server 0.24.1 and vscode 0.24.1. CHANGELOG and troubleshooting (en and zh-CN) are updated.

Evidence

  • On the bundled engine, I ran a platform-neutral reproduction (a std.ixx-shaped module plus a vtable.h-shaped importer):
    • -fno-aligned-allocation reproduces the report's error.
    • With no flag, or with the flag plus the macro, there are 0 errors.
  • The upstream minimal reproducer of #218152 gives no diagnostic on the bundled engine for Linux or MSVC targets, so the backport is in effect.
  • Unit tests:
    • Register: the maintained version is not affected, while 23.1.0 and other lines are.
    • Traits: the bundled engine has the flag off.
    • Translation: flag plus macro under the workaround, neither without it, and no macro with /Zc:alignedNew-.
  • New win32 fixture mcpp-msvc-aligned-new: llvm@23.1.3 + MSVC STL, a header shaped like vtable.h in a module and in main.cpp, both importing std. It checks that both files have no diagnostics and that the engine command has no -fno-aligned-allocation. The existing mcpp-msvc, mcpp-llvm-msvc and cmake-msvc-std now build std without the flag.
  • Locally: mcpp test 630/630, devtools check all, validate.py, and a cross-build for x86_64-windows-gnu. The real MSVC STL is proved only by the Windows CI fixtures.

Also carried: S1 0.4.0 (was #98)

Carried here so the two run on one CI. The original commit is kept, and one commit follows it:

…ocation under the MSVC STL, so std::align_val_t is declared (#97)

A header that uses aligned allocation as C++17 allows (Slint 1.19's vtable.h)
failed in the editor only, with "no type named 'align_val_t' in namespace 'std'",
and every module including it "did not compile". WA-CLANGD-005 gave every MSVC
STL unit -fno-aligned-allocation for llvm-project#218152 (align_val_t ambiguous in
the MSVC STL's std module in clang 23.1.0). The flag also removes
__cpp_aligned_new, and vcruntime_new.h then declares neither std::align_val_t nor
the aligned operator new/delete.

The maintained engine has carried the upstream fix (llvm-project#219151, patch
0001-UP-05) in every release, but the workaround was retired by the LLVM base
version, which 23.1.0-mcppls.<n> keeps. The register now marks it fixed in the
maintained engine (fixedInMaintained), so MSVC STL units keep aligned allocation,
as the build does. Where it still applies (an upstream 23.1.0 clangd), the
workaround also defines __cpp_aligned_new=201606L, kept for std too, so the
library declares what such headers use.

Design: .agents/docs/2026-11-23-issue-97-msvc-aligned-allocation-design.md
…g it for navigation (S1-7.2-15, pending), each rule with its evidence

S1 0.4.0 put two requirements under one identifier and gave its new rules no
evidence, so validate.py failed. S1-7.2-14 is a producer rule (mcpp#1006);
S1-7.2-15 waits for issue 95's G3; S1-7.2-16 is issue 95's G1, now tested with a
stated origin.
@Sunrisepeak Sunrisepeak changed the title server 0.24.1, vscode 0.24.1: the maintained engine keeps aligned allocation under the MSVC STL, so std::align_val_t is declared (#97) server 0.24.1, vscode 0.24.1: MSVC STL units keep aligned allocation on the maintained engine (#97), and S1 0.4.0 ide.generated origin (was #98) Nov 22, 2026
@Sunrisepeak
Sunrisepeak merged commit a80db37 into main Nov 22, 2026
152 of 154 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WA-CLANGD-005 makes MSVC STL headers that use aligned allocation unparseable (Slint 1.19: no std::align_val_t)

1 participant