Skip to content

[MrBot] Default to C++20 instead of C++23 - #481

Closed
Abhinandan Sharma (abhinandan-codes) wants to merge 1 commit into
masterfrom
abhinandan/cpp20-default-40033102
Closed

Abhinandan Sharma (abhinandan-codes) wants to merge 1 commit into
masterfrom
abhinandan/cpp20-default-40033102

Conversation

@abhinandan-codes

@abhinandan-codes Abhinandan Sharma (abhinandan-codes) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Lower the set_default_build_options() default from C++23 to C++20 and drop the MSVC C++23 switch override. A newer caller-selected C++ standard is still kept.

Why: #471's /std:c++23preview breaks Visual Studio generator builds on CMake < 4.0. CMake can't map it to the C++-only LanguageStandard property, so it lands in AdditionalOptions and reaches C files too. Mixed C/C++ targets (c-util c_util, c_util_reals) then fail with D8016: '/std:c17' and '/std:c++23preview' command-line options are incompatible (ElasticLog RustLib build: CMake 3.31.0, MSVC 19.44). No CMake version maps /std:c++23 (MSVC 19.52+) either. CMake maps C++20 to /std:c++20 (stdcpp20) in every version, so no override is needed.

Local check (MSVC 19.44, mixed C/C++ target + pure C target): CMake 3.31.0 and 4.4.4, Visual Studio and Ninja generators all build. C files get /std:c17 and C++ files /std:c++20. A caller-selected C++23 still builds (stdcpplatest).

Downstream validation: all 27 gates passed in 16 draft PRs on branch abhinandan/validate-cpp20-cbt481, each based on its repo's master. Every c-build-tools pin at every submodule depth is 804727c (for example ElasticLog deps/block-store > MessagingStore validation commit > deps/c-build-tools), every in-graph submodule points to its own validation commit, and pipeline c_build_tools refs match. This PR's own gate also passed.

PR master base Result
Azure/macro-utils-c#425 811dd76 Passed
Azure/c-logging#403 580a346 Passed (log_sink_etw_int flaked in 1 of 8 flavors, passed on retry)
Azure/ctest#386 e51c30a Passed
Azure/c-testrunnerswitcher#387 c3aebb1 Passed
Azure/umock-c#540 d0e9b82 Passed
Azure/c-pal#664 ba3f4b8 Passed
Azure/c-util#697 f4d73e5 Passed
Azure/clds#493 dd4df84 Passed
zrpc !17710036 724a348 Passed
Azure/com-wrapper#321 827164d Passed
Azure/sf-c-util#405 1e5022f Passed
Azure-Messaging-Metrics !17710037 e29629c Passed
Azure-MessagingStore-AITools !17710038 0f4edcd Passed
Azure-MessagingStore !17710039 44a2f12 Passed: 5/5 (ARM64 LTCG C4702 in C files and a JEMALLOC perf test flaked, both passed on retry)
Azure-Messaging-ElasticLog !17710040 a559371 Passed: 6/6, including Build Rust Library on CMake 3.31.0 + MSVC 19.44
Azure-Messaging-GeoReplication !17710041 244e72c Passed: 2/2

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@abhinandan-codes

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@abhinandan-codes

Copy link
Copy Markdown
Contributor Author

/azp run Azure-C-Build-Tools-Gate

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

1 participant