KEMBAR78
Toolset update: MSVC Compiler 19.50 Preview 1, Clang 20 by StephanTLavavej · Pull Request #5717 · microsoft/STL · GitHub
Skip to content

Conversation

@StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented Sep 13, 2025

📜 Changelog

  • Improved test coverage:
    • Enabled ARM64EC test coverage for Clang.
  • Code cleanups:
    • Removed compiler bug workarounds.
  • Infrastructure improvements:
    • Updated dependencies.
      • Updated MSVC Compiler to 19.50 Preview 1 (now required).
      • Updated Clang to 20.1.8 (now required).
      • Updated Python to 3.13.7.

🗺️ Overview

This updates our toolset to the MSVC Compiler 19.50 Preview 1 and Clang 20 in VS 2026 Insiders. As a new major version, we have a greater-than-usual number of things that need to be updated. I'm overhauling the README, simplifying the installer instructions. I've centralized the path to VsDevCmd.bat in our Azure Pipelines machinery, making it easier to update in the future. Both MSVC and Clang accumulated a lot of bugfixes, so I can remove a lot of workarounds, but in a few cases I had to report new bugs and add workarounds. Enough constexpr misbehavior was fixed that the remaining list wasn't as daunting, so I went through our libcxx skips and reported all of the remaining MSVC-specific bugs we're working around. Clang 20 allows us to enable ARM64EC which went surprisingly well (only coroutines were blocked). EDG shipped behavior changes to <source_location>, allowing us to remove workarounds that were dealing with the difference between the internal and public versions. CUDA rejects the 19.5x compiler version, so once again we need to activate their escape hatch. (We've informed NVIDIA and whenever CUDA begins allowing MSVC again, we'll update our minimum required version in the STL.)

As usual with a new major version of Clang, I'm updating our .clang-format baseline and regenerating the formatting. (This time I didn't see any new options that were worth configuring, although I experimented with parenthesis removal, which identified a few places to clean up.) I also took this opportunity to review all of our clang-format suppressions, removing them when possible. All of the remaining suppressions are now marked with a reason, using their supported syntax.

⚙️ Commits

  • Python 3.13.7.
  • Update VS URL from 17 Preview Enterprise to 18 Insiders Community.
  • New pool.
  • Generalize to "Windows 11 SDK (10.0.26100) or later".
    • VS is currently shipping 10.0.26100.4654, but the patch versions aren't significant to us.
  • Require MSVC Compiler 19.50 Preview 1.
    • Using "MSVC Compiler" to clarify the 19.5x version stream, in contrast to the MSVC Build Tools 14.5x and the IDE 18.x.
  • README.md: Reorganize architectures.
    • Don't repeat the "native desktop" limitation which was already mentioned.
    • Consistently mention x64 before x86. This reflects a mindset change for us.
    • Also mention ARM64EC.
  • README.md: Avoid suspicious long dashes.
  • README.md: Update bincompat wording for VS 2026.
  • README.md: (major improvement) Extract installer prerequisites.
    • This overhauls duplicated, disorganized instructions.
    • It begins by explaining the need to install Insiders, as installing production releases is a common mistake.
    • It just says "and keep it up to date" without mentioning our exact required compiler version, as that doesn't affect what you select in the VS Installer. The version is now enforced by CMakeLists.txt with a clear message.
    • It gives an explicit list of what workload and components to select.
    • It doesn't bother with verbosely explaining that you can install CMake/Ninja/Clang independently.
    • It lists AddressSanitizer, which we forgot earlier.
    • It lists Clang immediately, instead of only mentioning it later in the testing sections.
    • It explains how to install Python with a little more detail.
    • The duplication between the IDE and Command Prompt steps is now avoided, as the prereqs are exactly the same.
    • Finally, the testing section can get straight to the point.
  • README.md: Update vcvarsall.bat paths and command prompt names.
    • Extract the "non-default location" explanation.
    • Depict vcvarsall.bat for x64 and x86 (this is what I personally use in clean command prompts), with the shortcuts as alternatives.
      This also highlights the symmetry of the steps.
  • README.md: Update the "complete example".
    • Update the command prompt name.
    • Make things clearer by showing the STL being built before it's used.
    • Modernize the example to use std::println.
  • README.md: Remove unused links.
  • Clang 20.1.8, now required.
    • yvals_core.h: Just say "Clang 20" to avoid confusion.
  • bug-report.md: Update options for reporting the STL version.
    • Help > About isn't useful anymore, so let's recommend the cl.exe version or _MSVC_STL_UPDATE value instead.
    • Finally, expand the example commit hash to full.
  • azure-devops/config.yml: Centralize VsDevCmd.bat path.
  • Unwrap vsDevCmdBat calls.
  • Remove suppressions of warning C4127 "conditional expression is constant", removed by MSVC-PR-646313 on 2025-06-25.
  • C4127 followup: Fuse constexpr bools where the names provided minimal value.
  • Remove workaround for DevCom-10291456 / VSO-1754445, which had been fixed by 2024-05-21.
  • Remove workarounds for VSO-1513409, fixed by MSVC-PR-647159 on 2025-06-27.
    • Partially reverted by a following commit.
  • Remove workaround for VCRuntime: memmove() is surprisingly slow for more than 8 KB on certain CPUs #5506 / DevCom-10906320 / VSO-2495607, fixed by MSVC-PR-643622 on 2025-06-30.
  • Remove workaround for VSO-1956558, fixed by VS-PR-656849 on 2025-07-29.
  • Remove workaround for VSO-1588614, no longer repros as of 2025-06-10.
  • Remove workaround for VSO-1923988, no longer repros as of 2025-06-10.
    • copy_backward.pass.cpp and copy.pass.cpp are still failing due to truncation warnings.
  • Remove workaround for VSO-934264, no longer repros as of 2025-06-10.
  • Remove workarounds for DevCom-1638496 VSO-1462745, which was fixed by MSVC-PR-643706 on 2025-06-16.
  • Remove workarounds for many unreported constexpr bugs.
  • Comment Clang complains about concept depending on itself llvm/llvm-project#62096 as fixed in Clang 21.
  • Report and add workarounds for regression Clang 20 i686-pc-windows-msvc regression, silent bad codegen for std::current_exception() llvm/llvm-project#158302.
  • Remove workarounds for [Clang] constexpr builtin floating point classification / comparison functions llvm/llvm-project#94118.
  • Remove workarounds for clang 14.0.5 i686-pc-windows-msvc <coroutine> ICE: failed to perform tail call elimination on a call site marked musttail llvm/llvm-project#56507.
  • Remove workaround for Clang 19 regression matching constrained template to unconstrained template template parameter llvm/llvm-project#104189.
  • Remove workaround for [clang-cl] Due to #pragma function, no_builtin attribute is incorrectly added to functions llvm/llvm-project#116256, enable ARM64EC for Clang.
  • Fix Clang ARM64EC message: "'+cx16' is not a recognized feature for this target (ignoring feature)"
  • Report and add workarounds for Coroutines on arm64ec-pc-windows-msvc emit error LNK2001: unresolved external symbol #__NoopCoro_ResumeDestroy (EC Symbol) llvm/llvm-project#158341.
  • Remove EDG workarounds in P1208R6_source_location.
  • Simplify preprocessor logic in P1208R6_source_location.
  • GH_000639_nvcc_include_all: Add --allow-unsupported-compiler again.
  • Report and add workaround for regression VSO-2574432 "C1XX incorrectly handles a requires-expression checking for r.operator T();".
  • Report previously unreported constexpr bugs: VSO-2574451, VSO-2574465, VSO-2574469, VSO-2574473, VSO-2574489
  • .clang-format: Update defaults.
  • Regen clang-format, no manual changes.
  • Manually improve max_size() wrapping.
  • Enable clang-format in xlocale, no changes.
  • Enable clang-format in concepts with manual wrapping, results are otherwise unchanged.
  • Enable clang-format in __msvc_filebuf.hpp, results are acceptable.
  • Enable clang-format in ranges with partial manual wrapping, results are acceptable.
  • Enable clang-format in GH_001541_case_sensitive_boolalpha with manual wrapping, results are acceptable.
  • Enable clang-format in P0355R7_calendars_and_time_zones_dates, results are acceptable.
  • Enable clang-format for requires, results are acceptable.
    • We've moved away from frequently suppressing clang-format and trying to exert extreme control over formatting. For these requires clauses, clang-format consumes more lines, but is more systematic, and the results are more consistently readable. clang-format has also improved its handling of requires over the years.
  • Enable clang-format in chrono, results are acceptable.
  • Enable clang-format in P0896R4_common_iterator with manual wrapping, results are improved.
  • Enable clang-format in P0896R4_ranges_iterator_machinery with manual wrapping AND DE MORGAN, results are improved.
    • This now exactly matches concept no_iterator_traits in P0896R4_common_iterator.
  • Enable clang-format in Dev11_0437519_container_requirements and VSO_0191296_allocator_construct WITH MACRO CHANGES, results are acceptable.
    • In GENERATE_CONTAINER_TYPEDEFS, reorder opt_typename so that the usage automatically lines up nicely. This is also the order in which the macro parameters are used.
    • In DEFINE_TEST_IMPL, add a semicolon after preface_text to avoid confusing clang-format. This results in an unnecessary semicolon being emitted, which is fine.
    • In DEFINE_TEST and DEFINE_TEST_SPECIALIZATION, drop the verbose comments naming each macro parameter. DEFINE_TEST_IMPL is immediately above, so these comments provided little value.
    • In DEFINE_TEST_SPECIALIZATION, rename specialized_tag to my_tag. This avoids wrapping, and is still clear.
  • Enable clang-format in GH_000625_vector_bool_optimization with manual wrapping AND EXTRA COMMENTS for "gaps".
    • If anything, this is a slight clarity improvement by drawing attention to the gaps.
  • Enable clang-format in VSO_0644691_utf_8_codecvt WITH COMMENT CLEANUPS, results are acceptable.
    • Consistently comment U+nnnn, following our usual conventions.
    • U+07FF is now NKO TAMAN SIGN.
    • Make it clearer which cases are TRANSITION.
    • U+10348 was commented as HWAIR but its full name is GOTHIC LETTER HWAIR.
  • Add/update clang-format suppression reasons.
  • Syntax cleanup in test code: Drop unnecessary parens.
  • README.md: Improve the Visual Studio Installer Prerequisites.
    • Use unordered lists because we don't need to emphasize a sequence of steps.
    • Nest the workload and components under VS, which is what they apply to.
    • Extract the Insiders rationale to Note 1, debulking the list.
    • Add an ARM64/ARM64EC explanation as Note 2.
  • README.md: Overhaul the IDE instructions.
  • CMakePresets.json: Reorder x64 before x86.
  • Restore product code workaround for VSO-1513409 due to MSVC-internal toolset.
    • The MSVC-internal toolset used to build the toolset is slightly older than MSVC Compiler 19.50 Preview 1 and apparently lacks this fix. However, the libcxx test suite is run with the freshly-built compiler, so the workaround removal in expected_results.txt stands.

StephanTLavavej and others added 30 commits September 10, 2025 10:32
VS is currently shipping 10.0.26100.4654, but the patch versions aren't significant to us.
Using "MSVC Compiler" to clarify the 19.5x version stream, in contrast to the MSVC Build Tools 14.5x and the IDE 18.x.
+ Don't repeat the "native desktop" limitation which was already mentioned.
+ Consistently mention x64 before x86. This reflects a mindset change for us.
+ Also mention ARM64EC.
This overhauls duplicated, disorganized instructions.

It begins by explaining the need to install Insiders, as installing production releases is a common mistake.

It just says "and keep it up to date" without mentioning our exact required compiler version,
as that doesn't affect what you select in the VS Installer.
The version is now enforced by `CMakeLists.txt` with a clear message.

It gives an explicit list of what workload and components to select.
It doesn't bother with verbosely explaining that you can install CMake/Ninja independently.
It lists AddressSanitizer, which we forgot earlier.
It lists Clang immediately, instead of only mentioning it later in the testing sections.
Also it doesn't bother with explaining that you can install Clang independently.

It explains how to install Python with a little more detail.

The duplication between the IDE and Command Prompt steps is now avoided, as the prereqs are exactly the same.

Finally, the testing section can get straight to the point.
Extract the "non-default location" explanation.

Depict vcvarsall.bat for x64 and x86 (this is what I personally use in clean command prompts), with the shortcuts as alternatives.
This also highlights the symmetry of the steps.
Update the command prompt name.

Make things clearer by showing the STL being built before it's used.

Modernize the example to use std::println.
yvals_core.h: Just say "Clang 20" to avoid confusion.
Help > About isn't useful anymore, so let's recommend the `cl.exe` version or `_MSVC_STL_UPDATE` value instead.
Finally, expand the example commit hash to full.
…ant", removed by MSVC-PR-646313 on 2025-06-25.
copy_backward.pass.cpp and copy.pass.cpp are still failing due to truncation warnings.
…191296_allocator_construct WITH MACRO CHANGES, results are acceptable.

In GENERATE_CONTAINER_TYPEDEFS, reorder opt_typename so that the usage automatically lines up nicely. This is also the order in which the macro parameters are used.

In DEFINE_TEST_IMPL, add a semicolon after preface_text to avoid confusing clang-format. This results in an unnecessary semicolon being emitted, which is fine.

In DEFINE_TEST and DEFINE_TEST_SPECIALIZATION, drop the verbose comments naming each macro parameter. DEFINE_TEST_IMPL is immediately above, so these comments provided little value.

In DEFINE_TEST_SPECIALIZATION, rename specialized_tag to my_tag. This avoids wrapping, and is still clear.
… wrapping AND EXTRA COMMENTS for "gaps".

If anything, this is a slight clarity improvement by drawing attention to the gaps.
…S, results are acceptable.

Consistently comment U+nnnn, following our usual conventions.

U+07FF is now NKO TAMAN SIGN.

Make it clearer which cases are TRANSITION.

U+10348 was commented as HWAIR but its full name is GOTHIC LETTER HWAIR.
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner September 13, 2025 11:39
@StephanTLavavej StephanTLavavej added the infrastructure Related to repository automation label Sep 13, 2025
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Sep 13, 2025
@StephanTLavavej

This comment was marked as resolved.

@azure-pipelines

This comment was marked as resolved.

@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in STL Code Reviews Sep 13, 2025
Use unordered lists because we don't need to emphasize a sequence of steps.

Nest the workload and components under VS, which is what they apply to.

Extract the Insiders rationale to Note 1, debulking the list.

Add an ARM64/ARM64EC explanation as Note 2.
@StephanTLavavej
Copy link
Member Author

Pushed commits - thank you @seishun for the very helpful review! 😻

@StephanTLavavej
Copy link
Member Author

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

@StephanTLavavej StephanTLavavej moved this from Final Review to Merging in STL Code Reviews Sep 15, 2025
@StephanTLavavej StephanTLavavej merged commit 38d7248 into microsoft:main Sep 15, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Sep 15, 2025
@StephanTLavavej StephanTLavavej deleted the vs-18.0-p1 branch September 15, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Related to repository automation

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants