diff --git a/.clang-format b/.clang-format index 035d0c1f84b..a7c98218459 100644 --- a/.clang-format +++ b/.clang-format @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# https://releases.llvm.org/19.1.0/tools/clang/docs/ClangFormatStyleOptions.html +# https://releases.llvm.org/20.1.0/tools/clang/docs/ClangFormatStyleOptions.html # To update this .clang-format file for a new clang-format version: # 1. Update the documentation link above. @@ -26,6 +26,7 @@ AlignAfterOpenBracket: DontAlign # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionDeclarations: false # AlignFunctionPointers: false # PadOperators: true AlignConsecutiveAssignments: Consecutive @@ -34,6 +35,7 @@ AlignConsecutiveAssignments: Consecutive # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionDeclarations: false # AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveDeclarations: @@ -41,6 +43,7 @@ AlignConsecutiveAssignments: Consecutive # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionDeclarations: true # AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveMacros: @@ -48,6 +51,7 @@ AlignConsecutiveAssignments: Consecutive # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionDeclarations: false # AlignFunctionPointers: false # PadOperators: false AlignConsecutiveMacros: Consecutive @@ -62,6 +66,7 @@ AlignConsecutiveMacros: Consecutive # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionDeclarations: false # AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveTableGenCondOperatorColons: @@ -69,6 +74,7 @@ AlignConsecutiveMacros: Consecutive # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionDeclarations: false # AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveTableGenDefinitionColons: @@ -76,6 +82,7 @@ AlignConsecutiveMacros: Consecutive # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionDeclarations: false # AlignFunctionPointers: false # PadOperators: false # AlignEscapedNewlines: Right @@ -101,12 +108,13 @@ AllowShortFunctionsOnASingleLine: Empty # AllowShortIfStatementsOnASingleLine: Never # AllowShortLambdasOnASingleLine: All # AllowShortLoopsOnASingleLine: false +# AllowShortNamespacesOnASingleLine: false # AlwaysBreakAfterDefinitionReturnType: None # AlwaysBreakBeforeMultilineStrings: false # AttributeMacros: # - __capability # BinPackArguments: true -# BinPackParameters: true +# BinPackParameters: BinPack # BitFieldColonSpacing: Both # BraceWrapping: # AfterCaseLabel: false @@ -139,6 +147,7 @@ BreakBeforeBinaryOperators: NonAssignment # BreakBeforeBraces: Attach # BreakBeforeInlineASMColon: OnlyMultiline # BreakBeforeTernaryOperators: true +# BreakBinaryOperations: Never # BreakConstructorInitializers: BeforeColon # BreakFunctionDefinitionParameters: false # BreakInheritanceList: BeforeColon @@ -203,6 +212,7 @@ IncludeCategories: # IndentCaseBlocks: false IndentCaseBlocks: true # IndentCaseLabels: false +# IndentExportBlock: true # IndentExternBlock: AfterExternBlock # IndentGotoLabels: true # IndentPPDirectives: None @@ -231,6 +241,7 @@ InsertNewlineAtEOF: true # AtStartOfFile: true KeepEmptyLines: AtStartOfFile: false +# KeepFormFeed: false # LambdaBodyIndentation: Signature # LineEnding: DeriveLF LineEnding: CRLF @@ -250,6 +261,7 @@ NamespaceIndentation: All # PackConstructorInitializers: BinPack # PenaltyBreakAssignment: 2 # PenaltyBreakBeforeFirstCallParameter: 19 +# PenaltyBreakBeforeMemberAccess: 150 # PenaltyBreakComment: 300 # PenaltyBreakFirstLessLess: 120 # PenaltyBreakOpenParenthesis: 0 @@ -264,8 +276,9 @@ PointerAlignment: Left # PPIndentWidth: -1 # QualifierAlignment: Leave # ReferenceAlignment: Pointer -# ReflowComments: true +# ReflowComments: Always # RemoveBracesLLVM: false +# RemoveEmptyLinesInUnwrappedLines: false # RemoveParentheses: Leave # RemoveSemicolon: false RemoveSemicolon: true @@ -349,4 +362,5 @@ StatementMacros: # - NS_SWIFT_NAME # - PP_STRINGIZE # - STRINGIZE +# WrapNamespaceBodyWithEmptyLines: Leave ... diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index a7c96480391..97b57aaa2dd 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -53,17 +53,32 @@ Alternatively, include `static_assert` or `assert` lines in your test case above whose failure clearly indicates the problem. # STL version -* Option 1: Visual Studio version - + Help > About Microsoft Visual Studio > Copy Info, we need only the first two lines +* Option 1: MSVC Compiler version + Example: ``` - Microsoft Visual Studio Community 2022 - Version 17.6.0 Preview 3.0 + C:\Temp>cl.exe + Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35503 for x64 + Copyright (C) Microsoft Corporation. All rights reserved. + + usage: cl [ option... ] filename... [ /link linkoption... ] + ``` +* Option 2: `_MSVC_STL_UPDATE` value + + Example: + ``` + C:\Temp>type meow.cpp + #include + int main() { + std::cout << _MSVC_STL_UPDATE << "\n"; + } + + C:\Temp>cl /EHsc /nologo /W4 meow.cpp && meow + meow.cpp + 202507 ``` -* Option 2: git commit hash +* Option 3: git commit hash + Example: ``` - https://github.com/microsoft/STL/commit/2195148 + https://github.com/microsoft/STL/commit/219514876ea86491de191ceaa88632616bbc0f19 ``` # Additional context diff --git a/CMakeLists.txt b/CMakeLists.txt index c5663853b04..89bda7c09a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.31.0) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) project(msvc_standard_libraries LANGUAGES CXX) -if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.44.35214") - message(FATAL_ERROR "The STL must be built with VS 2022 17.14.12 Preview 1 or later.") +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.50.35503") + message(FATAL_ERROR "The STL must be built with MSVC Compiler 19.50 Preview 1 or later.") endif() include(CheckCXXSourceCompiles) @@ -18,7 +18,7 @@ int main() {} ]=] WINDOWS_SDK_VERSION_CHECK) if(NOT WINDOWS_SDK_VERSION_CHECK) - message(FATAL_ERROR "The STL must be built with the Windows 11 SDK (10.0.26100.4188) or later. Make sure it's available by selecting it in the Individual Components tab of the VS Installer.") + message(FATAL_ERROR "The STL must be built with the Windows 11 SDK (10.0.26100) or later. Make sure it's available by selecting it in the Individual Components tab of the VS Installer.") endif() if(NOT DEFINED VCLIBS_TARGET_ARCHITECTURE) @@ -97,13 +97,13 @@ add_compile_definitions( _WIN32_WINNT=0x0A00 NTDDI_VERSION=NTDDI_WIN11_GE) if(STL_USE_ANALYZE) - # TRANSITION, Windows SDK 10.0.26100.4188 emits + # TRANSITION, Windows SDK 10.0.26100 emits # "warning C6553: The annotation for function 'LCMapStringEx' on _Param_(9) does not apply to a value type." # Reported as OS-40109504 "Windows SDK: incorrect SAL annotations on functions the STL uses". add_compile_options("$<$:/analyze:autolog-;/wd6553>") if(VCLIBS_TARGET_ARCHITECTURE STREQUAL "arm64ec") - # TRANSITION, Windows SDK 10.0.26100.4188 emits + # TRANSITION, Windows SDK 10.0.26100 emits # "warning C28301: No annotations for first declaration of 'meow'" # for various intrinsics when building for ARM64EC. add_compile_options("$<$:/wd28301>") diff --git a/CMakePresets.json b/CMakePresets.json index 4015c204518..916429de659 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,35 +13,35 @@ "binaryDir": "${sourceDir}/out/${presetName}" }, { - "name": "x86", + "name": "x64", "inherits": "base", - "description": "x86 Ninja Config", + "description": "x64 Ninja Config", "architecture": { "strategy": "external", - "value": "x86" + "value": "x64" }, "condition": { "type": "inList", "string": "$env{Platform}", "list": [ - "x86", + "x64", "" ] } }, { - "name": "x64", + "name": "x86", "inherits": "base", - "description": "x64 Ninja Config", + "description": "x86 Ninja Config", "architecture": { "strategy": "external", - "value": "x64" + "value": "x86" }, "condition": { "type": "inList", "string": "$env{Platform}", "list": [ - "x64", + "x86", "" ] } @@ -89,16 +89,16 @@ } ], "buildPresets": [ - { - "name": "x86", - "configurePreset": "x86", - "description": "Build x86 STL" - }, { "name": "x64", "configurePreset": "x64", "description": "Build x64 STL" }, + { + "name": "x86", + "configurePreset": "x86", + "description": "Build x86 STL" + }, { "name": "ARM64", "configurePreset": "ARM64", diff --git a/README.md b/README.md index ebc700c0699..306bbe6f05d 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ soon as possible.) and fully ported libcxx to run under [lit][] using the various configurations/compilers we test internally. * Continuous Integration: **In progress.** We've set up Azure Pipelines to validate changes to the repository. -Currently, it builds the STL (native desktop for x86, x64, and ARM64). Also, it strictly verifies that all of our +Currently, it builds the STL for x64, x86, ARM64, and ARM64EC. Also, it strictly verifies that all of our files have been formatted with [clang-format][] and follow our other whitespace conventions. * Contribution Guidelines: **Coming soon.** Working on the STL's code involves following many rules. We have codebase @@ -80,8 +80,8 @@ significantly more complicated and fragile. That is, there's a "complexity budge debugging checks. For example, we've extensively marked the STL with `[[nodiscard]]` attributes because this helps programmers avoid bugs. -* Compatibility: This includes binary compatibility and source compatibility. We're keeping VS 2022 binary-compatible -with VS 2015/2017/2019, which restricts what we can change in VS 2022 updates. (We've found that significant changes +* Compatibility: This includes binary compatibility and source compatibility. We're keeping VS 2026 binary-compatible +with VS 2015-2022, which restricts what we can change in VS 2026 updates. (We've found that significant changes are possible even though other changes are impossible, which we'll be documenting in our Contribution Guidelines soon.) While there are a few exceptions to this rule (e.g. if a feature is added to the Working Paper, we implement it, and then the feature is significantly changed before the International Standard is finalized, we reserve the right to break @@ -139,63 +139,71 @@ mention `std::` or C++. For example, "``: `is_cute` should be true It's okay if you report an apparent STL bug that turns out to be a compiler bug or surprising-yet-Standard behavior. Just try to follow these rules, so we can spend more time fixing bugs and implementing features. +# Visual Studio Installer Prerequisites + +* Install [VS 2026 Insiders][] and keep it up to date. + + **You must install Insiders for STL development.** *See Note 1 below.* + + Select the "Desktop development with C++" workload. + + Select the following components at a minimum: + - "MSVC v145 - C++ x64/x86 build tools (Latest)" + - "C++ CMake tools for Windows" + - "C++ AddressSanitizer" + - "Windows 11 SDK (10.0.26100)" or later + - "C++ Clang tools for Windows (20.1.8 - x64/x86)" + - *Optional, see Note 2 below:* "MSVC v145 - C++ ARM64/ARM64EC build tools (Latest)" +* Install [Python][] 3.13 or later. + + Select "Add python.exe to PATH" if you want to follow the instructions below that invoke `python`. + Otherwise, you should be familiar with alternative methods. + +*Note 1:* The STL and the compiler ship together, and we frequently need the latest +compiler fixes and features, so the last production release of the compiler is too old. + +*Note 2:* The x64/x86 build tools are usually sufficient. +You'll need the ARM64/ARM64EC build tools if you're working with architecture-sensitive code. +For example, `` has conditionally compiled code for the `_M_ARM64` and `_M_ARM64EC` predefined macros. + # How To Build With The Visual Studio IDE -1. Install Visual Studio 2022 17.14.12 Preview 1 or later. - * Select "Windows 11 SDK (10.0.26100.4188)" in the VS Installer. - * Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer - if you would like to build the ARM64/ARM64EC target. - * We recommend selecting "C++ CMake tools for Windows" in the VS Installer. - This will ensure that you're using supported versions of CMake and Ninja. - * Otherwise, install [CMake][] 3.31.0 or later, and [Ninja][] 1.12.1 or later. - * Make sure [Python][] 3.13 or later is available to CMake. -2. Open Visual Studio, and choose the "Clone or check out code" option. Enter the URL of this repository, - `https://github.com/microsoft/STL`. -3. Open a terminal in the IDE with `` Ctrl + ` `` (by default) or press on "View" in the top bar, and then "Terminal". -4. In the terminal, invoke `git submodule update --init --progress` -5. Choose the architecture you wish to build in the IDE, and build as you would any other project. All necessary CMake - settings are set by `CMakePresets.json`. +1. Open Visual Studio and select "Clone a repository". +2. Enter `https://github.com/microsoft/STL.git` as the repository location. Choose a local path. Click "Clone". +3. File > Open > Folder... > Select the folder that you just cloned the repository into. +4. Use the IDE's dropdown menu to choose the architecture you want to build. We recommend x64 for general development. +5. Build > Build All. # How To Build With A Native Tools Command Prompt -1. Install Visual Studio 2022 17.14.12 Preview 1 or later. - * Select "Windows 11 SDK (10.0.26100.4188)" in the VS Installer. - * Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer - if you would like to build the ARM64/ARM64EC target. - * We recommend selecting "C++ CMake tools for Windows" in the VS Installer. - This will ensure that you're using supported versions of CMake and Ninja. - * Otherwise, install [CMake][] 3.31.0 or later, and [Ninja][] 1.12.1 or later. - * Make sure [Python][] 3.13 or later is available to CMake. -2. Open a command prompt. -3. Change directories to a location where you'd like a clone of this STL repository. -4. `git clone https://github.com/microsoft/STL.git --recurse-submodules` +1. Open a command prompt. +2. Change directories to a location where you'd like a clone of this STL repository. +3. `git clone https://github.com/microsoft/STL.git --recurse-submodules` -To build the x86 target: - -1. Open an "x86 Native Tools Command Prompt for VS 2022 Preview". -2. Change directories to the previously cloned `STL` directory. -3. `cmake --preset x86` -4. `cmake --build --preset x86` +If you installed VS to a non-default location, change the `vcvarsall.bat` paths below accordingly. To build the x64 target (recommended): -1. Open an "x64 Native Tools Command Prompt for VS 2022 Preview". +1. `"C:\Program Files\Microsoft Visual Studio\18\Insiders\VC\Auxiliary\Build\vcvarsall.bat" x64` + * Or open an "x64 Native Tools Command Prompt for VS 18 Insiders". 2. Change directories to the previously cloned `STL` directory. 3. `cmake --preset x64` 4. `cmake --build --preset x64` +To build the x86 target: + +1. `"C:\Program Files\Microsoft Visual Studio\18\Insiders\VC\Auxiliary\Build\vcvarsall.bat" x86` + * Or open an "x86 Native Tools Command Prompt for VS 18 Insiders". +2. Change directories to the previously cloned `STL` directory. +3. `cmake --preset x86` +4. `cmake --build --preset x86` + To build the ARM64 target: -1. `"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64` - * If you installed VS to a non-default location, change this path accordingly. +1. `"C:\Program Files\Microsoft Visual Studio\18\Insiders\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64` 2. Change directories to the previously cloned `STL` directory. 3. `cmake --preset ARM64` 4. `cmake --build --preset ARM64` To build the ARM64EC target: -1. `"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64` - * If you installed VS to a non-default location, change this path accordingly. +1. `"C:\Program Files\Microsoft Visual Studio\18\Insiders\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64` 2. Change directories to the previously cloned `STL` directory. 3. `cmake --preset ARM64EC` 4. `cmake --build --preset ARM64EC` @@ -225,40 +233,39 @@ variables to ensure that the built headers and libraries are used. ## Complete Example Using x64 DLL Flavor -From an "x64 Native Tools Command Prompt for VS 2022 Preview": +From an "x64 Native Tools Command Prompt for VS 18 Insiders": ``` -C:\Users\username\Desktop>C:\Dev\STL\out\x64\set_environment.bat +D:\GitHub\STL>cmake --preset x64 +[...] +-- Build files have been written to: D:/GitHub/STL/out/x64 + +D:\GitHub\STL>cmake --build --preset x64 +[1028/1028] Linking CXX static library out\lib\amd64\libcpmtd0.lib -C:\Users\username\Desktop>type example.cpp -#include +D:\GitHub\STL>out\x64\set_environment.bat + +D:\GitHub\STL>pushd C:\Temp + +C:\Temp>type .\example.cpp +#include int main() { - std::cout << "Hello STL OSS world!\n"; + std::println("Hello STL OSS world!"); } -C:\Users\username\Desktop>cl /nologo /EHsc /W4 /WX /MDd /std:c++latest .\example.cpp +C:\Temp>cl /EHsc /nologo /W4 /WX /MDd /std:c++latest .\example.cpp example.cpp -C:\Users\username\Desktop>.\example.exe +C:\Temp>.\example.exe Hello STL OSS world! -C:\Users\username\Desktop>dumpbin /DEPENDENTS .\example.exe | findstr msvcp +C:\Temp>dumpbin /DEPENDENTS .\example.exe | findstr msvcp msvcp140d_oss.dll ``` # How To Run The Tests With A Native Tools Command Prompt -1. Follow either [How To Build With A Native Tools Command Prompt][] or [How To Build With The Visual Studio IDE][]. -2. Acquire [Python][] 3.13 or newer and have it on the `PATH` (or run it directly using its absolute or relative path). -3. Have LLVM's `bin` directory on the `PATH` (so `clang-cl.exe` is available). - * We recommend selecting "C++ Clang tools for Windows" in the VS Installer. This will automatically add LLVM to the - `PATH` of the x86 and x64 Native Tools Command Prompts, and will ensure that you're using a supported version. - * Otherwise, use [LLVM's installer][] and choose to add LLVM to your `PATH` during installation. -4. Follow the instructions below. - -## Running The Tests - Our tests are currently split across three test suites that are located at `tests\std`, `tests\tr1`, and `llvm-project\libcxx\test\std`. The test runner `${PROJECT_BINARY_DIR}\tests\utils\stl-lit\stl-lit.py` accepts paths to directories in the test suites and runs all tests located in the subtree rooted at those paths. This can mean executing @@ -422,7 +429,7 @@ python tests\utils\stl-lit\stl-lit.py ..\..\tests\std\tests\VSO_0000000_vector_a # Benchmarking -For performance-sensitive code – containers, algorithms, and the like – +For performance-sensitive code (e.g. containers and algorithms) you may wish to write and/or run benchmarks, and the STL team will likely run any benchmarks we do have in our PR process. Additionally, if you are writing a "performance improvement" PR, please add and run benchmarks @@ -542,22 +549,17 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [Changelog]: https://github.com/microsoft/STL/wiki/Changelog [clang-format]: https://clang.llvm.org/docs/ClangFormat.html -[CMake]: https://cmake.org/download [CODE_OF_CONDUCT.md]: CODE_OF_CONDUCT.md [Compiler Explorer]: https://godbolt.org [CONTRIBUTING.md]: CONTRIBUTING.md [Developer Community]: https://aka.ms/feedback/report?space=62 [Discord server]: https://discord.gg/XWanNww -[How To Build With A Native Tools Command Prompt]: #how-to-build-with-a-native-tools-command-prompt -[How To Build With The Visual Studio IDE]: #how-to-build-with-the-visual-studio-ide [LICENSE.txt]: LICENSE.txt -[LLVM's installer]: https://releases.llvm.org/download.html [LWG issues]: https://cplusplus.github.io/LWG/lwg-toc.html [LWG tag]: https://github.com/microsoft/STL/issues?q=is%3Aopen+is%3Aissue+label%3ALWG [Microsoft Open Source Code of Conduct]: https://opensource.microsoft.com/codeofconduct/ [N5014]: https://wg21.link/N5014 [NOTICE.txt]: NOTICE.txt -[Ninja]: https://ninja-build.org [STL-CI-badge]: https://dev.azure.com/vclibs/STL/_apis/build/status%2FSTL-CI?branchName=main "STL-CI" [STL-CI-link]: https://dev.azure.com/vclibs/STL/_build/latest?definitionId=4&branchName=main [STL-ASan-CI-badge]: https://dev.azure.com/vclibs/STL/_apis/build/status%2FSTL-ASan-CI?branchName=main "STL-ASan-CI" @@ -578,3 +580,4 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [natvis documentation]: https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects [ASan]: https://learn.microsoft.com/en-us/cpp/sanitizers/asan [Import Library]: /docs/import_library.md +[VS 2026 Insiders]: https://visualstudio.microsoft.com/insiders/ diff --git a/azure-devops/build-benchmarks.yml b/azure-devops/build-benchmarks.yml index 05165b52d7d..39bc4a3e325 100644 --- a/azure-devops/build-benchmarks.yml +++ b/azure-devops/build-benchmarks.yml @@ -18,8 +18,7 @@ steps: if exist "$(benchmarkBuildOutputLocation)\${{ parameters.compiler }}" ( rmdir /S /Q "$(benchmarkBuildOutputLocation)\${{ parameters.compiler }}" ) - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo + call "$(vsDevCmdBat)" -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo cmake -G Ninja ^ -DCMAKE_CXX_COMPILER=${{ parameters.compiler }} ^ -DCMAKE_BUILD_TYPE=Release ^ @@ -35,8 +34,7 @@ steps: not(and(eq('${{ parameters.compiler }}', 'clang-cl'), not(eq('${{ parameters.targetPlatform }}', 'x64'))))) - script: | - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo + call "$(vsDevCmdBat)" -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo cmake --build "$(benchmarkBuildOutputLocation)\${{ parameters.compiler }}" displayName: 'Build the benchmarks for ${{ parameters.compiler }}' timeoutInMinutes: 2 diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index c8db703e61c..d60b672bd3a 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -27,8 +27,7 @@ steps: if exist "$(buildOutputLocation)" ( rmdir /S /Q "$(buildOutputLocation)" ) - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo + call "$(vsDevCmdBat)" -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo cmake -G Ninja ^ -DCMAKE_CXX_COMPILER=cl ^ -DCMAKE_BUILD_TYPE=Release ^ @@ -42,8 +41,7 @@ steps: timeoutInMinutes: 2 env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - script: | - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo + call "$(vsDevCmdBat)" -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo cmake --build "$(buildOutputLocation)" displayName: 'Build the STL' timeoutInMinutes: 5 diff --git a/azure-devops/config.yml b/azure-devops/config.yml index d377651872b..934502132fc 100644 --- a/azure-devops/config.yml +++ b/azure-devops/config.yml @@ -5,11 +5,14 @@ variables: - name: poolName - value: 'StlBuild-2025-08-12T1208-Pool' + value: 'StlBuild-2025-09-09T1526-Pool' readonly: true - name: poolDemands value: 'EnableSpotVM -equals false' readonly: true +- name: vsDevCmdBat + value: '%ProgramFiles%\Microsoft Visual Studio\18\Insiders\Common7\Tools\VsDevCmd.bat' + readonly: true - name: tmpDir value: 'C:\stlTemp' readonly: true diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index 945c96d1b0b..b9345716379 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -13,23 +13,20 @@ jobs: if exist "$(validationBuildOutputLocation)" ( rmdir /S /Q "$(validationBuildOutputLocation)" ) - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=x64 -arch=x64 -no_logo + call "$(vsDevCmdBat)" -host_arch=x64 -arch=x64 -no_logo cmake -G Ninja -S $(Build.SourcesDirectory)/tools -B "$(validationBuildOutputLocation)" cmake --build "$(validationBuildOutputLocation)" displayName: 'Build format and validation' timeoutInMinutes: 5 env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - script: | - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=x64 -arch=x64 -no_logo + call "$(vsDevCmdBat)" -host_arch=x64 -arch=x64 -no_logo cmake --build "$(validationBuildOutputLocation)" --target run-format displayName: 'clang-format Files' timeoutInMinutes: 5 env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - script: | - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=x64 -arch=x64 -no_logo + call "$(vsDevCmdBat)" -host_arch=x64 -arch=x64 -no_logo cmake --build "$(validationBuildOutputLocation)" --target run-validate displayName: 'Validate Files' timeoutInMinutes: 2 diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index a27553e32eb..d27cf236c4a 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -31,7 +31,7 @@ $VisualStudioWorkloads = @( 'Microsoft.VisualStudio.Component.Windows11SDK.26100' ) -$VisualStudioUrl = 'https://aka.ms/vs/17/pre/vs_enterprise.exe' +$VisualStudioUrl = 'https://aka.ms/vs/18/insiders/vs_Community.exe' $VisualStudioArgs = @('--quiet', '--norestart', '--wait', '--nocache') foreach ($workload in $VisualStudioWorkloads) { $VisualStudioArgs += '--add' @@ -42,7 +42,7 @@ foreach ($workload in $VisualStudioWorkloads) { $PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.2/PowerShell-7.5.2-win-x64.msi' $PowerShellArgs = @('/quiet', '/norestart') -$PythonUrl = 'https://www.python.org/ftp/python/3.13.6/python-3.13.6-amd64.exe' +$PythonUrl = 'https://www.python.org/ftp/python/3.13.7/python-3.13.7-amd64.exe' $PythonArgs = @('/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'CompileAll=1', 'Include_doc=0') $CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe' diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index aba67bc3e87..22357e528fe 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -14,8 +14,7 @@ parameters: type: boolean steps: - script: | - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo + call "$(vsDevCmdBat)" -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo ninja --verbose -k 0 ${{ parameters.testTargets }} displayName: 'Build and Run Tests' timeoutInMinutes: 30 diff --git a/stl/inc/__msvc_chrono.hpp b/stl/inc/__msvc_chrono.hpp index 92bda1980ae..3e854d8e27a 100644 --- a/stl/inc/__msvc_chrono.hpp +++ b/stl/inc/__msvc_chrono.hpp @@ -249,11 +249,11 @@ namespace chrono { } _NODISCARD static constexpr time_point(min)() noexcept { - return time_point((_Duration::min)()); + return time_point((_Duration::min) ()); } _NODISCARD static constexpr time_point(max)() noexcept { - return time_point((_Duration::max)()); + return time_point((_Duration::max) ()); } private: diff --git a/stl/inc/__msvc_filebuf.hpp b/stl/inc/__msvc_filebuf.hpp index 4a219f592ed..7b2846b020c 100644 --- a/stl/inc/__msvc_filebuf.hpp +++ b/stl/inc/__msvc_filebuf.hpp @@ -49,17 +49,17 @@ namespace experimental { } // namespace experimental #endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM -// clang-format off template constexpr bool _Is_any_path = _Is_any_of_v<_Ty #if _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM - , experimental::filesystem::path + , + experimental::filesystem::path #endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM #if _HAS_CXX17 - , filesystem::path + , + filesystem::path #endif // _HAS_CXX17 >; -// clang-format on extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const char*, ios_base::openmode, int); extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, ios_base::openmode, int); @@ -548,7 +548,7 @@ class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer const auto _Start_count = _Count; const auto _Available = static_cast(_Mysb::_Gnavail()); if (0 < _Available) { // copy from get area - const auto _Read_size = (_STD min)(_Count_s, _Available); + const auto _Read_size = (_STD min) (_Count_s, _Available); _Traits::copy(_Ptr, _Mysb::gptr(), _Read_size); _Ptr += _Read_size; _Count_s -= _Read_size; diff --git a/stl/inc/__msvc_iter_core.hpp b/stl/inc/__msvc_iter_core.hpp index e77903479a1..2d12dac1144 100644 --- a/stl/inc/__msvc_iter_core.hpp +++ b/stl/inc/__msvc_iter_core.hpp @@ -257,7 +257,7 @@ struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_decltype> { }; template -concept _Has_member_arrow = requires(_Ty&& __t) { static_cast<_Ty&&>(__t).operator->(); }; +concept _Has_member_arrow = requires(_Ty&& __t) { static_cast<_Ty &&>(__t).operator->(); }; template struct _Iter_traits_reference { diff --git a/stl/inc/__msvc_ranges_to.hpp b/stl/inc/__msvc_ranges_to.hpp index 768f6e31756..de0fc9baead 100644 --- a/stl/inc/__msvc_ranges_to.hpp +++ b/stl/inc/__msvc_ranges_to.hpp @@ -119,7 +119,7 @@ namespace ranges { requires (_Range_adaptor_closure_object<_Right> && range<_Left>) _NODISCARD constexpr decltype(auto) operator|(_Left&& __l, _Right&& __r) noexcept(noexcept(_STD forward<_Right>(__r)(_STD forward<_Left>(__l)))) - requires requires { static_cast<_Right&&>(__r)(static_cast<_Left&&>(__l)); } + requires requires { static_cast<_Right &&>(__r)(static_cast<_Left &&>(__l)); } { return _STD forward<_Right>(__r)(_STD forward<_Left>(__l)); } @@ -461,7 +461,7 @@ namespace ranges { template <_Different_from _OtherRng> constexpr ref_view(_OtherRng&& _Other) noexcept(noexcept(static_cast<_Rng&>(_STD forward<_OtherRng>(_Other)))) // strengthened - requires convertible_to<_OtherRng, _Rng&> && requires { _Rvalue_poison(static_cast<_OtherRng&&>(_Other)); } + requires convertible_to<_OtherRng, _Rng&> && requires { _Rvalue_poison(static_cast<_OtherRng &&>(_Other)); } : _Range{_STD addressof(static_cast<_Rng&>(_STD forward<_OtherRng>(_Other)))} {} _NODISCARD constexpr _Rng& base() const noexcept /* strengthened */ { @@ -591,10 +591,10 @@ namespace ranges { namespace views { template - concept _Can_ref_view = requires(_Rng&& __r) { ref_view{static_cast<_Rng&&>(__r)}; }; + concept _Can_ref_view = requires(_Rng&& __r) { ref_view{static_cast<_Rng &&>(__r)}; }; template - concept _Ownable = requires(_Rng&& __r) { owning_view{static_cast<_Rng&&>(__r)}; }; + concept _Ownable = requires(_Rng&& __r) { owning_view{static_cast<_Rng &&>(__r)}; }; class _All_fn : public _Pipe::_Base<_All_fn> { private: @@ -1048,7 +1048,7 @@ namespace ranges { template _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Fn _Fun) _CONST_CALL_OPERATOR noexcept(noexcept(transform_view(_STD forward<_Rng>(_Range), _STD move(_Fun)))) - requires requires { transform_view(static_cast<_Rng&&>(_Range), _STD move(_Fun)); } + requires requires { transform_view(static_cast<_Rng &&>(_Range), _STD move(_Fun)); } { return transform_view(_STD forward<_Rng>(_Range), _STD move(_Fun)); } diff --git a/stl/inc/__msvc_ranges_tuple_formatter.hpp b/stl/inc/__msvc_ranges_tuple_formatter.hpp index 176bf1eb762..45d36201b1b 100644 --- a/stl/inc/__msvc_ranges_tuple_formatter.hpp +++ b/stl/inc/__msvc_ranges_tuple_formatter.hpp @@ -265,8 +265,7 @@ class basic_format_arg { } }; -#if defined(__clang__) || defined(__EDG__) \ - || defined(__CUDACC__) // TRANSITION, LLVM-81774 (Clang), VSO-1956558 (EDG), VSO-2411436 (needed by CUDA 12.8.1) +#if defined(__clang__) || defined(__CUDACC__) // TRANSITION, LLVM-81774 (Clang), VSO-2411436 (needed by CUDA 12.8.1) basic_format_arg() noexcept : _Active_state(_Basic_format_arg_type::_None), _No_state() {} #else // ^^^ workaround / no workaround vvv basic_format_arg() noexcept = default; @@ -637,7 +636,7 @@ class basic_format_args { private: template _NODISCARD static auto _Get_value_from_memory(const unsigned char* const _Val) noexcept { - auto& _Temp = *reinterpret_cast(_Val); + auto& _Temp = *reinterpret_cast(_Val); return _STD bit_cast<_Ty>(_Temp); } diff --git a/stl/inc/__msvc_string_view.hpp b/stl/inc/__msvc_string_view.hpp index e3f7b844bf0..3e11c510ad0 100644 --- a/stl/inc/__msvc_string_view.hpp +++ b/stl/inc/__msvc_string_view.hpp @@ -685,7 +685,7 @@ template constexpr int _Traits_compare(_In_reads_(_Left_size) const _Traits_ptr_t<_Traits> _Left, const size_t _Left_size, _In_reads_(_Right_size) const _Traits_ptr_t<_Traits> _Right, const size_t _Right_size) noexcept { // compare [_Left, _Left + _Left_size) to [_Right, _Right + _Right_size) using _Traits - const int _Ans = _Traits::compare(_Left, _Right, (_STD min)(_Left_size, _Right_size)); + const int _Ans = _Traits::compare(_Left, _Right, (_STD min) (_Left_size, _Right_size)); if (_Ans != 0) { return _Ans; @@ -788,14 +788,14 @@ constexpr size_t _Traits_rfind(_In_reads_(_Hay_size) const _Traits_ptr_t<_Traits const size_t _Needle_size) noexcept { // search [_Haystack, _Haystack + _Hay_size) for [_Needle, _Needle + _Needle_size) beginning before _Start_at if (_Needle_size == 0) { - return (_STD min)(_Start_at, _Hay_size); // empty string always matches + return (_STD min) (_Start_at, _Hay_size); // empty string always matches } if (_Needle_size > _Hay_size) { // no room for match return static_cast(-1); } - const size_t _Actual_start_at = (_STD min)(_Start_at, _Hay_size - _Needle_size); + const size_t _Actual_start_at = (_STD min) (_Start_at, _Hay_size - _Needle_size); #if _USE_STD_VECTOR_ALGORITHMS if constexpr (_Is_implementation_handled_char_traits<_Traits>) { @@ -836,7 +836,7 @@ constexpr size_t _Traits_rfind_ch(_In_reads_(_Hay_size) const _Traits_ptr_t<_Tra return static_cast(-1); } - const size_t _Actual_start_at = (_STD min)(_Start_at, _Hay_size - 1); + const size_t _Actual_start_at = (_STD min) (_Start_at, _Hay_size - 1); #if _USE_STD_VECTOR_ALGORITHMS if constexpr (_Is_implementation_handled_char_traits<_Traits>) { @@ -974,7 +974,7 @@ constexpr size_t _Traits_find_last_of(_In_reads_(_Hay_size) const _Traits_ptr_t< return static_cast(-1); } - const auto _Hay_start = (_STD min)(_Start_at, _Hay_size - 1); + const auto _Hay_start = (_STD min) (_Start_at, _Hay_size - 1); if constexpr (_Is_implementation_handled_char_traits<_Traits>) { using _Elem = typename _Traits::char_type; @@ -1108,7 +1108,7 @@ constexpr size_t _Traits_find_last_not_of(_In_reads_(_Hay_size) const _Traits_pt return static_cast(-1); } - const auto _Hay_start = (_STD min)(_Start_at, _Hay_size - 1); + const auto _Hay_start = (_STD min) (_Start_at, _Hay_size - 1); if constexpr (_Is_implementation_handled_char_traits<_Traits>) { using _Elem = typename _Traits::char_type; @@ -1158,7 +1158,7 @@ constexpr size_t _Traits_rfind_not_ch(_In_reads_(_Hay_size) const _Traits_ptr_t< return static_cast(-1); } - const size_t _Actual_start_at = (_STD min)(_Start_at, _Hay_size - 1); + const size_t _Actual_start_at = (_STD min) (_Start_at, _Hay_size - 1); #if _USE_STD_VECTOR_ALGORITHMS if constexpr (_Is_implementation_handled_char_traits<_Traits>) { @@ -1591,7 +1591,7 @@ class basic_string_view { // wrapper for any kind of contiguous character buffer _NODISCARD constexpr size_type max_size() const noexcept { // bound to PTRDIFF_MAX to make end() - begin() well defined (also makes room for npos) // bound to static_cast(-1) / sizeof(_Elem) by address space limits - return (_STD min)(static_cast(PTRDIFF_MAX), static_cast(-1) / sizeof(_Elem)); + return (_STD min) (static_cast(PTRDIFF_MAX), static_cast(-1) / sizeof(_Elem)); } _NODISCARD constexpr const_reference operator[](const size_type _Off) const noexcept /* strengthened */ { @@ -1909,7 +1909,7 @@ class basic_string_view { // wrapper for any kind of contiguous character buffer constexpr size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const noexcept { // trims _Size to the longest it can be assuming a string at/after _Off - return (_STD min)(_Size, _Mysize - _Off); + return (_STD min) (_Size, _Mysize - _Off); } [[noreturn]] static void _Xran() { diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 10203201835..876d57a1bd2 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -404,13 +404,13 @@ template constexpr ptrdiff_t _Temporary_buffer_size(const _Diff _Value) noexcept { // convert an iterator difference_type to a ptrdiff_t for use in temporary buffers using _CT = common_type_t; - return static_cast((_STD min)(static_cast<_CT>(PTRDIFF_MAX), static_cast<_CT>(_Value))); + return static_cast((_STD min) (static_cast<_CT>(PTRDIFF_MAX), static_cast<_CT>(_Value))); } template struct _Optimistic_temporary_buffer { // temporary storage with _alloca-like attempt static constexpr size_t _Optimistic_size = 4096; // default to ~1 page - static constexpr size_t _Optimistic_count = (_STD max)(static_cast(1), _Optimistic_size / sizeof(_Ty)); + static constexpr size_t _Optimistic_count = (_STD max) (static_cast(1), _Optimistic_size / sizeof(_Ty)); template explicit _Optimistic_temporary_buffer(const _Diff _Requested_size) noexcept { // get temporary storage @@ -945,7 +945,7 @@ _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch( using _CT = _Common_diff_t<_InIt1, _InIt2>; const _CT _Count1 = _ULast1 - _UFirst1; const _CT _Count2 = _ULast2 - _UFirst2; - const auto _Count = static_cast<_Iter_diff_t<_InIt1>>((_STD min)(_Count1, _Count2)); + const auto _Count = static_cast<_Iter_diff_t<_InIt1>>((_STD min) (_Count1, _Count2)); _ULast1 = _UFirst1 + _Count; #if _USE_STD_VECTOR_ALGORITHMS if constexpr (_Vector_alg_in_search_is_safe) { @@ -3967,7 +3967,7 @@ namespace ranges { const auto _First2_addr = _STD to_address(_First2); if constexpr (_Is_sized1 && _Is_sized2) { const size_t _Count = - (_STD min)(static_cast(_Last1 - _First1), static_cast(_Last2 - _First2)); + (_STD min) (static_cast(_Last1 - _First1), static_cast(_Last2 - _First2)); const auto _Last1_addr = _First1_addr + _Count; ::__std_swap_ranges_trivially_swappable_noalias(_First1_addr, _Last1_addr, _First2_addr); return {_First1 + static_cast>(_Count), @@ -5962,7 +5962,7 @@ public: explicit _Rng_from_urng(_Urng& _Func) : _Ref(_Func), _Bits(CHAR_BIT * sizeof(_Udiff)), _Bmask(static_cast<_Udiff>(-1)) { - for (; static_cast<_Udiff>((_Urng::max)() - (_Urng::min)()) < _Bmask; _Bmask >>= 1) { + for (; static_cast<_Udiff>((_Urng::max) () - (_Urng::min) ()) < _Bmask; _Bmask >>= 1) { --_Bits; } } @@ -6006,7 +6006,7 @@ public: private: _Udiff _Get_bits() { // return a random value within [0, _Bmask] for (;;) { // repeat until random value is in range - const _Udiff _Val = static_cast<_Udiff>(_Ref() - (_Urng::min)()); + const _Udiff _Val = static_cast<_Udiff>(_Ref() - (_Urng::min) ()); if (_Val <= _Bmask) { return _Val; @@ -6103,7 +6103,7 @@ _EXPORT_STD template concept uniform_random_bit_generator = invocable<_Ty&> && unsigned_integral> && requires { { (_Ty::min)() } -> same_as>; { (_Ty::max)() } -> same_as>; - requires bool_constant<(_Ty::min)() < (_Ty::max)()>::value; + requires bool_constant<(_Ty::min) () < (_Ty::max) ()>::value; }; namespace ranges { @@ -8320,7 +8320,7 @@ void inplace_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last, _Pr _Pred) { } const _Diff _Count2 = _STD distance(_UMid, _ULast); - _Optimistic_temporary_buffer<_Iter_value_t<_BidIt>> _Temp_buf{(_STD min)(_Count1, _Count2)}; + _Optimistic_temporary_buffer<_Iter_value_t<_BidIt>> _Temp_buf{(_STD min) (_Count1, _Count2)}; _STD _Buffered_inplace_merge_unchecked_impl( _UFirst, _UMid, _ULast, _Count1, _Count2, _Temp_buf._Data, _Temp_buf._Capacity, _STD _Pass_fn(_Pred)); } @@ -8671,7 +8671,7 @@ namespace ranges { } const iter_difference_t<_It> _Count2 = _RANGES distance(_Mid, _Last); - _Optimistic_temporary_buffer> _Temp_buf{(_STD min)(_Count1, _Count2)}; + _Optimistic_temporary_buffer> _Temp_buf{(_STD min) (_Count1, _Count2)}; if (_Count1 <= _Count2 && _Count1 <= _Temp_buf._Capacity) { _RANGES _Inplace_merge_buffer_left(_STD move(_First), _STD move(_Mid), _STD move(_Last), _Temp_buf._Data, _Temp_buf._Capacity, _Pred, _Proj); @@ -9162,7 +9162,7 @@ void _Uninitialized_chunked_merge_unchecked2( while (_Count > _Isort_max<_BidIt>) { _Count -= _Isort_max<_BidIt>; const _BidIt _Mid1 = _STD next(_First, _Isort_max<_BidIt>); - const auto _Chunk2 = (_STD min)(_Isort_max<_BidIt>, _Count); + const auto _Chunk2 = (_STD min) (_Isort_max<_BidIt>, _Count); _Count -= _Chunk2; const _BidIt _Mid2 = _STD next(_Mid1, _Chunk2); _Backout._Last = _STD _Uninitialized_merge_move(_First, _Mid1, _Mid2, _Backout._Last, _Pred); @@ -9182,7 +9182,7 @@ void _Chunked_merge_unchecked(_BidIt _First, const _BidIt _Last, _OutIt _Dest, c while (_Chunk < _Count) { _Count -= _Chunk; const _BidIt _Mid1 = _STD next(_First, _Chunk); - const auto _Chunk2 = (_STD min)(_Chunk, _Count); + const auto _Chunk2 = (_STD min) (_Chunk, _Count); _Count -= _Chunk2; const _BidIt _Mid2 = _STD next(_Mid1, _Chunk2); _Dest = _STD _Merge_move_unchecked(_First, _Mid1, _Mid2, _Dest, _Pred); @@ -9455,7 +9455,7 @@ namespace ranges { const auto _Backout_end = _Dest + _Count; while (_ISORT_MAX < _Count) { _Count -= _ISORT_MAX; - const auto _Chunk2 = (_STD min)(static_cast(_ISORT_MAX), _Count); + const auto _Chunk2 = (_STD min) (static_cast(_ISORT_MAX), _Count); _Count -= _Chunk2; auto _Mid1 = _First + _Isort_max<_It>; @@ -9551,7 +9551,7 @@ namespace ranges { while (_Chunk_size < _Count) { _Count -= _Chunk_size; - const auto _Right_chunk_size = (_STD min)(_Chunk_size, _Count); + const auto _Right_chunk_size = (_STD min) (_Chunk_size, _Count); _Count -= _Right_chunk_size; auto _Mid1 = _First + static_cast>(_Chunk_size); @@ -11755,7 +11755,7 @@ namespace ranges { _Num2 = SIZE_MAX; } - const size_t _Num = (_STD min)(_Num1, _Num2); + const size_t _Num = (_STD min) (_Num1, _Num2); #if _USE_STD_VECTOR_ALGORITHMS const auto _First1_ptr = _STD to_address(_First1); const auto _First2_ptr = _STD to_address(_First2); diff --git a/stl/inc/atomic b/stl/inc/atomic index e337f6b24a1..a644eb571dc 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -29,9 +29,9 @@ _STL_DISABLE_CLANG_WARNINGS #undef new // Allow _InterlockedCompareExchange128 to be used: -#if defined(__clang__) && defined(_M_X64) +#if defined(__clang__) && defined(_M_X64) && !defined(_M_ARM64EC) #pragma clang attribute _STD_ATOMIC_HEADER.push([[gnu::target("cx16")]], apply_to = function) -#endif // ^^^ defined(__clang__) && defined(_M_X64) ^^^ +#endif // ^^^ defined(__clang__) && defined(_M_X64) && !defined(_M_ARM64EC) ^^^ #if defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64) #define _STD_ATOMIC_USE_ARM64_LDAR_STLR 1 @@ -3035,9 +3035,9 @@ _STD_END #undef _INVALID_MEMORY_ORDER -#if defined(__clang__) && defined(_M_X64) +#if defined(__clang__) && defined(_M_X64) && !defined(_M_ARM64EC) #pragma clang attribute _STD_ATOMIC_HEADER.pop -#endif // ^^^ defined(__clang__) && defined(_M_X64) ^^^ +#endif // ^^^ defined(__clang__) && defined(_M_X64) && !defined(_M_ARM64EC) ^^^ #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/bitset b/stl/inc/bitset index 30148f6579f..372f8784018 100644 --- a/stl/inc/bitset +++ b/stl/inc/bitset @@ -483,8 +483,7 @@ public: } _NODISCARD _CONSTEXPR23 bool all() const noexcept { - constexpr bool _Zero_length = _Bits == 0; - if constexpr (_Zero_length) { // must test for this, otherwise would count one full word + if constexpr (_Bits == 0) { // must test for this, otherwise would count one full word return true; } diff --git a/stl/inc/charconv b/stl/inc/charconv index 8cfce756e51..581f194c8cb 100644 --- a/stl/inc/charconv +++ b/stl/inc/charconv @@ -717,7 +717,7 @@ _NODISCARD inline bool _Multiply_by_power_of_ten(_Big_integer_flt& _Xval, const for (uint32_t _Large_power = _Power / 10; _Large_power != 0;) { const uint32_t _Current_power = - (_STD min)(_Large_power, static_cast(_STD size(_Large_power_indices))); + (_STD min) (_Large_power, static_cast(_STD size(_Large_power_indices))); const _Unpack_index& _Index = _Large_power_indices[_Current_power - 1]; _Big_integer_flt _Multiplier{}; @@ -1355,8 +1355,8 @@ _NODISCARD errc _Convert_decimal_string_to_floating_type( // fractional part. If the exponent is positive, then the integer part consists of the first 'exponent' digits, // or all present digits if there are fewer digits. If the exponent is zero or negative, then the integer part // is empty. In either case, the remaining digits form the fractional part of the mantissa. - const uint32_t _Positive_exponent = static_cast((_STD max)(0, _Data._Myexponent)); - const uint32_t _Integer_digits_present = (_STD min)(_Positive_exponent, _Data._Mymantissa_count); + const uint32_t _Positive_exponent = static_cast((_STD max) (0, _Data._Myexponent)); + const uint32_t _Integer_digits_present = (_STD min) (_Positive_exponent, _Data._Mymantissa_count); const uint32_t _Integer_digits_missing = _Positive_exponent - _Integer_digits_present; const uint8_t* const _Integer_first = _Data._Mymantissa; const uint8_t* const _Integer_last = _Data._Mymantissa + _Integer_digits_present; @@ -1738,21 +1738,21 @@ _NODISCARD from_chars_result _Ordinary_floating_from_chars(const char* const _Fi // Adjust _Exponent and _Exponent_adjustment when they have different signedness to avoid overflow. if (_Exponent > 0 && _Exponent_adjustment < 0) { if (_Is_hexadecimal) { - const ptrdiff_t _Further_adjustment = (_STD max)(-((_Exponent - 1) / 4 + 1), _Exponent_adjustment); + const ptrdiff_t _Further_adjustment = (_STD max) (-((_Exponent - 1) / 4 + 1), _Exponent_adjustment); _Exponent += _Further_adjustment * 4; _Exponent_adjustment -= _Further_adjustment; } else { - const ptrdiff_t _Further_adjustment = (_STD max)(-_Exponent, _Exponent_adjustment); + const ptrdiff_t _Further_adjustment = (_STD max) (-_Exponent, _Exponent_adjustment); _Exponent += _Further_adjustment; _Exponent_adjustment -= _Further_adjustment; } } else if (_Exponent < 0 && _Exponent_adjustment > 0) { if (_Is_hexadecimal) { - const ptrdiff_t _Further_adjustment = (_STD min)((-_Exponent - 1) / 4 + 1, _Exponent_adjustment); + const ptrdiff_t _Further_adjustment = (_STD min) ((-_Exponent - 1) / 4 + 1, _Exponent_adjustment); _Exponent += _Further_adjustment * 4; _Exponent_adjustment -= _Further_adjustment; } else { - const ptrdiff_t _Further_adjustment = (_STD min)(-_Exponent, _Exponent_adjustment); + const ptrdiff_t _Further_adjustment = (_STD min) (-_Exponent, _Exponent_adjustment); _Exponent += _Further_adjustment; _Exponent_adjustment -= _Further_adjustment; } @@ -2382,7 +2382,7 @@ _NODISCARD inline to_chars_result _Floating_to_chars_general_precision( _Table_end = _Table_begin + _Precision + 5; } else { _Table_begin = _Tables::_Ordinary_X_table; - _Table_end = _Table_begin + (_STD min)(_Precision, _Tables::_Max_P) + 5; + _Table_end = _Table_begin + (_STD min) (_Precision, _Tables::_Max_P) + 5; } // Profiling indicates that linear search is faster than binary search for small tables. @@ -2429,13 +2429,13 @@ _NODISCARD inline to_chars_result _Floating_to_chars_general_precision( // Write into the local buffer. // Clamping _Effective_precision allows _Buffer to be as small as possible, and increases efficiency. if (_Use_fixed_notation) { - _Effective_precision = (_STD min)(_Precision - (_Scientific_exponent_X + 1), _Max_fixed_precision); + _Effective_precision = (_STD min) (_Precision - (_Scientific_exponent_X + 1), _Max_fixed_precision); const to_chars_result _Buf_result = _Floating_to_chars_fixed_precision(_Buffer, _STD end(_Buffer), _Value, _Effective_precision); _STL_INTERNAL_CHECK(_Buf_result.ec == errc{}); _Significand_last = _Buf_result.ptr; } else { - _Effective_precision = (_STD min)(_Precision - 1, _Max_scientific_precision); + _Effective_precision = (_STD min) (_Precision - 1, _Max_scientific_precision); const to_chars_result _Buf_result = _Floating_to_chars_scientific_precision(_Buffer, _STD end(_Buffer), _Value, _Effective_precision); _STL_INTERNAL_CHECK(_Buf_result.ec == errc{}); diff --git a/stl/inc/chrono b/stl/inc/chrono index 7bbc0ea063a..deed0e8b51f 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -1625,7 +1625,7 @@ namespace chrono { if (_Den != 1) { return 6u; } - const auto _Result = (_STD max)(_Power_of_2_in_den, _Power_of_5_in_den); + const auto _Result = (_STD max) (_Power_of_2_in_den, _Power_of_5_in_den); return _Result > 18u ? 6u : _Result; }(); using precision = @@ -1850,8 +1850,8 @@ namespace chrono { return local_time>{_Sys.time_since_epoch() + _Info.offset}; } - static constexpr sys_seconds _Min_seconds{sys_days{(year::min)() / January / 1}}; - static constexpr sys_seconds _Max_seconds{sys_seconds{sys_days{(year::max)() / December / 32}} - seconds{1}}; + static constexpr sys_seconds _Min_seconds{sys_days{(year::min) () / January / 1}}; + static constexpr sys_seconds _Max_seconds{sys_seconds{sys_days{(year::max) () / December / 32}} - seconds{1}}; private: template @@ -2204,7 +2204,7 @@ namespace chrono { // caller knows (_Current_size, 0 on first call) and the _Known_leap_seconds entries. constexpr size_t _Pre_2018_count = 27; const size_t _Known_post_2018_ls_size = - (_STD max)(_Current_size, _STD size(_Known_leap_seconds)) - _Pre_2018_count; + (_STD max) (_Current_size, _STD size(_Known_leap_seconds)) - _Pre_2018_count; size_t _Reg_post_2018_ls_size; // number of post-2018 LSs found in the registry unique_ptr<__std_tzdb_leap_info[], _Tzdb_deleter<__std_tzdb_leap_info[]>> _Reg_ls_data{ @@ -2470,11 +2470,8 @@ namespace chrono { explicit zoned_time(_TimeZonePtr _Tz) noexcept /* strengthened */ : _Zone{_STD move(_Tz)} {} - // clang-format off - template , - int> = 0> - // clang-format on + template , int> = 0> explicit zoned_time(string_view _Name) : _Zone{_Traits::locate_zone(_Name)} {} template , sys_time<_Duration>>, int> = 0> @@ -2483,11 +2480,10 @@ namespace chrono { zoned_time(_TimeZonePtr _Tz, const sys_time<_Duration>& _Sys) : _Zone{_STD move(_Tz)}, _Tp{_Sys} {} - // clang-format off - template &>, - int> = 0> - // clang-format on + template &>, + int> = 0> zoned_time(string_view _Name, type_identity_t&> _Sys) : zoned_time{_Traits::locate_zone(_Name), _Sys} {} @@ -2498,11 +2494,10 @@ namespace chrono { zoned_time(_TimeZonePtr _Tz, const local_time<_Duration>& _Local) : _Zone{_STD move(_Tz)}, _Tp{_Zone->to_sys(_Local)} {} - // clang-format off - template &>, - int> = 0> - // clang-format on + template &>, + int> = 0> zoned_time(string_view _Name, type_identity_t>& _Local) : zoned_time{_Traits::locate_zone(_Name), _Local} {} @@ -2514,11 +2509,10 @@ namespace chrono { zoned_time(_TimeZonePtr _Tz, const local_time<_Duration>& _Local, choose _Choose) : _Zone{_STD move(_Tz)}, _Tp{_Zone->to_sys(_Local, _Choose)} {} - // clang-format off - template &, choose>, - int> = 0> - // clang-format on + template &, choose>, + int> = 0> zoned_time(string_view _Name, type_identity_t&> _Local, choose _Choose) : zoned_time{_Traits::locate_zone(_Name), _Local, _Choose} {} @@ -2533,23 +2527,17 @@ namespace chrono { _TimeZonePtr _Tz, const zoned_time<_Duration2, _TimeZonePtr2>& _Zt, choose) noexcept /* strengthened */ : zoned_time{_Tz, _Zt} {} - // clang-format off - template &>, - int> = 0> - // clang-format on + template &>, + int> = 0> zoned_time(string_view _Name, const zoned_time<_Duration2, _TimeZonePtr2>& _Zt) : zoned_time{_Traits::locate_zone(_Name), _Zt} {} - // clang-format off - template &, choose>, - int> = 0> - // clang-format on + template &, choose>, + int> = 0> zoned_time(string_view _Name, const zoned_time<_Duration2, _TimeZonePtr2>& _Zt, choose _Choose) : zoned_time{_Traits::locate_zone(_Name), _Zt, _Choose} {} diff --git a/stl/inc/cmath b/stl/inc/cmath index 7190d446064..3028e21ba84 100644 --- a/stl/inc/cmath +++ b/stl/inc/cmath @@ -605,33 +605,32 @@ _STD _Common_float_type_t<_Ty1, _Ty2> remquo(_Ty1 _Left, _Ty2 _Right, int* _Pquo } // Updated by P0533R9 "constexpr For And ". -// TRANSITION, Clang 20: The builtins were made constexpr by LLVM-94118. -#define _CLANG_BUILTIN2_ARG(NAME, ARG) \ - _NODISCARD _Check_return_ inline bool NAME(_In_ ARG _Xx, _In_ ARG _Yx) noexcept /* strengthened */ { \ - return __builtin_##NAME(_Xx, _Yx); \ +#define _CLANG_BUILTIN2_ARG(NAME, ARG) \ + _NODISCARD _Check_return_ constexpr bool NAME(_In_ ARG _Xx, _In_ ARG _Yx) noexcept /* strengthened */ { \ + return __builtin_##NAME(_Xx, _Yx); \ } -#define _CLANG_BUILTIN2_ARG_TEMPLATED(NAME, ARG) \ - template , int> = 0> \ - _NODISCARD _Check_return_ inline bool NAME(_In_ ARG _Xx, _In_ _Ty _Yx) noexcept /* strengthened */ { \ - return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx)); \ +#define _CLANG_BUILTIN2_ARG_TEMPLATED(NAME, ARG) \ + template , int> = 0> \ + _NODISCARD _Check_return_ constexpr bool NAME(_In_ ARG _Xx, _In_ _Ty _Yx) noexcept /* strengthened */ { \ + return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx)); \ } #ifdef __cpp_char8_t -#define _CLANG_BUILTIN2_ARG_TEMPLATED_CHAR8_T(NAME) \ - template , int> = 0> \ - _NODISCARD _Check_return_ inline bool NAME(_In_ char8_t _Xx, _In_ _Ty _Yx) noexcept /* strengthened */ { \ - return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx)); \ +#define _CLANG_BUILTIN2_ARG_TEMPLATED_CHAR8_T(NAME) \ + template , int> = 0> \ + _NODISCARD _Check_return_ constexpr bool NAME(_In_ char8_t _Xx, _In_ _Ty _Yx) noexcept /* strengthened */ { \ + return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx)); \ } #else // ^^^ defined(__cpp_char8_t) / !defined(__cpp_char8_t) vvv #define _CLANG_BUILTIN2_ARG_TEMPLATED_CHAR8_T(NAME) #endif // ^^^ !defined(__cpp_char8_t) ^^^ #ifdef _NATIVE_WCHAR_T_DEFINED -#define _CLANG_BUILTIN2_ARG_TEMPLATED_WCHAR_T(NAME) \ - template , int> = 0> \ - _NODISCARD _Check_return_ inline bool NAME(_In_ wchar_t _Xx, _In_ _Ty _Yx) noexcept /* strengthened */ { \ - return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx)); \ +#define _CLANG_BUILTIN2_ARG_TEMPLATED_WCHAR_T(NAME) \ + template , int> = 0> \ + _NODISCARD _Check_return_ constexpr bool NAME(_In_ wchar_t _Xx, _In_ _Ty _Yx) noexcept /* strengthened */ { \ + return __builtin_##NAME(static_cast(_Xx), static_cast(_Yx)); \ } #else // ^^^ defined(_NATIVE_WCHAR_T_DEFINED) / !defined(_NATIVE_WCHAR_T_DEFINED) vvv #define _CLANG_BUILTIN2_ARG_TEMPLATED_WCHAR_T(NAME) diff --git a/stl/inc/codecvt b/stl/inc/codecvt index ccf3075d577..c46df0d3f8c 100644 --- a/stl/inc/codecvt +++ b/stl/inc/codecvt @@ -95,8 +95,7 @@ protected: if (*_Pstate == 0) { // first time, maybe look for and consume header *_Pstate = 1; - constexpr bool _Consuming = (_Mymode & consume_header) != 0; - if constexpr (_Consuming) { + if constexpr ((_Mymode & consume_header) != 0) { if (_Ch == 0xfeff) { // drop header and retry const result _Ans = do_in(_State, _Mid1, _Last1, _Mid1, _First2, _Last2, _Mid2); @@ -157,9 +156,9 @@ protected: } if (*_Pstate == 0) { // first time, maybe generate header - *_Pstate = 1; - constexpr bool _Generating = (_Mymode & generate_header) != 0; - if constexpr (_Generating) { + *_Pstate = 1; + + if constexpr ((_Mymode & generate_header) != 0) { if (_Last2 - _Mid2 < 3 + 1 + _Nextra) { return _Mybase::partial; // not enough room for both } @@ -267,9 +266,9 @@ protected: _Ch0 = static_cast(_Ptr[0] << 8 | _Ptr[1]); } - *_Pstate = _Default_endian; - constexpr bool _Consuming = (_Mymode & consume_header) != 0; - if constexpr (_Consuming) { + *_Pstate = _Default_endian; + + if constexpr ((_Mymode & consume_header) != 0) { if (_Ch0 == 0xfffeu) { *_Pstate = 3 - _Default_endian; } @@ -332,8 +331,7 @@ protected: *_Pstate = _Big_first; } - constexpr bool _Generating = (_Mymode & generate_header) != 0; - if constexpr (_Generating) { + if constexpr ((_Mymode & generate_header) != 0) { if (_Last2 - _Mid2 < 3 * _Bytes_per_word) { return _Mybase::partial; // not enough room for all } @@ -550,8 +548,7 @@ protected: if (*_Pstate == 0u) { // first time, maybe look for and consume header *_Pstate = 1; - constexpr bool _Consuming = (_Mymode & consume_header) != 0; - if constexpr (_Consuming) { + if constexpr ((_Mymode & consume_header) != 0) { if (_Ch == 0xfeffu) { // drop header and retry result _Ans = do_in(_State, _Mid1, _Last1, _Mid1, _First2, _Last2, _Mid2); diff --git a/stl/inc/complex b/stl/inc/complex index d1df8ab2c46..359afc36daf 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -428,7 +428,7 @@ public: } static bool _Signbit(_Ty _Left) { - return (_STD signbit)(static_cast(_Left)); + return (_STD signbit) (static_cast(_Left)); } static _Ty _Sinh(_Ty _Left, _Ty _Right) { // return sinh(_Left) * _Right @@ -572,7 +572,7 @@ public: static bool _Signbit(_Ty _Left) noexcept { // testing _Left < 0 would be incorrect when _Left is -0.0 - return (_STD signbit)(_Left); + return (_STD signbit) (_Left); } static _Ty _Sinh(_Ty _Left, _Ty _Right) noexcept { // return sinh(_Left) * _Right @@ -708,7 +708,7 @@ public: static bool _Signbit(_Ty _Left) noexcept { // testing _Left < 0 would be incorrect when _Left is -0.0 - return (_STD signbit)(_Left); + return (_STD signbit) (_Left); } static _Ty _Sinh(_Ty _Left, _Ty _Right) noexcept { // return sinh(_Left) * _Right @@ -847,7 +847,7 @@ public: static bool _Signbit(_Ty _Left) noexcept { // testing _Left < 0 would be incorrect when _Left is -0.0 - return (_STD signbit)(_Left); + return (_STD signbit) (_Left); } static _Ty _Sinh(_Ty _Left, _Ty _Right) noexcept { // return sinh(_Left) * _Right diff --git a/stl/inc/concepts b/stl/inc/concepts index 08a1489388c..77e51a4220e 100644 --- a/stl/inc/concepts +++ b/stl/inc/concepts @@ -48,22 +48,20 @@ concept common_reference_with = } && same_as, common_reference_t<_Ty2, _Ty1>> && convertible_to<_Ty1, common_reference_t<_Ty1, _Ty2>> && convertible_to<_Ty2, common_reference_t<_Ty1, _Ty2>>; -// clang-format off _EXPORT_STD template concept common_with = requires { typename common_type_t<_Ty1, _Ty2>; typename common_type_t<_Ty2, _Ty1>; - } - && same_as, common_type_t<_Ty2, _Ty1>> + } // + && same_as, common_type_t<_Ty2, _Ty1>> // && requires { static_cast>(_STD declval<_Ty1>()); static_cast>(_STD declval<_Ty2>()); - } - && common_reference_with, add_lvalue_reference_t> + } // + && common_reference_with, add_lvalue_reference_t> // && common_reference_with>, common_reference_t, add_lvalue_reference_t>>; -// clang-format on _EXPORT_STD template concept integral = is_integral_v<_Ty>; @@ -81,7 +79,7 @@ _EXPORT_STD template concept assignable_from = is_lvalue_reference_v<_LTy> && common_reference_with&, const remove_reference_t<_RTy>&> && requires(_LTy _Left, _RTy&& _Right) { - { _Left = static_cast<_RTy&&>(_Right) } -> same_as<_LTy>; + { _Left = static_cast<_RTy &&>(_Right) } -> same_as<_LTy>; }; // swappable and swappable_with are defined below, since they depend on move_constructible. @@ -113,7 +111,7 @@ namespace ranges { template concept _Use_ADL_swap = (_Has_class_or_enum_type<_Ty1> || _Has_class_or_enum_type<_Ty2>) && requires(_Ty1&& __t, _Ty2&& __u) { - swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)); // intentional ADL + swap(static_cast<_Ty1 &&>(__t), static_cast<_Ty2 &&>(__u)); // intentional ADL }; struct _Cpo { @@ -162,10 +160,10 @@ concept swappable = requires(_Ty& __x, _Ty& __y) { _RANGES swap(__x, __y); }; _EXPORT_STD template concept swappable_with = common_reference_with<_Ty1, _Ty2> && requires(_Ty1&& __t, _Ty2&& __u) { - _RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty1&&>(__t)); - _RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty2&&>(__u)); - _RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)); - _RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty1&&>(__t)); + _RANGES swap(static_cast<_Ty1 &&>(__t), static_cast<_Ty1 &&>(__t)); + _RANGES swap(static_cast<_Ty2 &&>(__u), static_cast<_Ty2 &&>(__u)); + _RANGES swap(static_cast<_Ty1 &&>(__t), static_cast<_Ty2 &&>(__u)); + _RANGES swap(static_cast<_Ty2 &&>(__u), static_cast<_Ty1 &&>(__t)); }; _EXPORT_STD template @@ -178,7 +176,7 @@ concept _Boolean_testable_impl = convertible_to<_Ty, bool>; template concept _Boolean_testable = _Boolean_testable_impl<_Ty> && requires(_Ty&& __t) { - { !static_cast<_Ty&&>(__t) } -> _Boolean_testable_impl; + { !static_cast<_Ty &&>(__t) } -> _Boolean_testable_impl; }; template @@ -251,7 +249,7 @@ concept regular = semiregular<_Ty> && equality_comparable<_Ty>; _EXPORT_STD template concept invocable = requires( - _FTy&& _Fn, _ArgTys&&... _Args) { _STD invoke(static_cast<_FTy&&>(_Fn), static_cast<_ArgTys&&>(_Args)...); }; + _FTy&& _Fn, _ArgTys&&... _Args) { _STD invoke(static_cast<_FTy &&>(_Fn), static_cast<_ArgTys &&>(_Args)...); }; _EXPORT_STD template concept regular_invocable = invocable<_FTy, _ArgTys...>; diff --git a/stl/inc/deque b/stl/inc/deque index 05793b8ac41..33fd9e6d815 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -854,7 +854,7 @@ public: _Orphan_all(); auto _Myfirst = _Unchecked_begin(); const auto _Oldsize = _Mysize(); - auto _Assign_count = (_STD min)(_Count, _Oldsize); + auto _Assign_count = (_STD min) (_Count, _Oldsize); for (; _Assign_count > 0; --_Assign_count) { *_Myfirst = _Val; ++_Myfirst; @@ -976,7 +976,8 @@ public: } _NODISCARD size_type max_size() const noexcept { - return (_STD min)(static_cast(_STD _Max_limit()), _Alty_traits::max_size(_Getal())); + return (_STD min) (static_cast(_STD _Max_limit()), // + _Alty_traits::max_size(_Getal())); } void resize(_CRT_GUARDOVERFLOW size_type _Newsize) { diff --git a/stl/inc/execution b/stl/inc/execution index 3e890f8aed6..ea1ec434ae7 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -242,7 +242,7 @@ public: } void _Submit_for_chunks(const size_t _Hw_threads, const size_t _Chunks) const noexcept { - _Submit((_STD min)(_Hw_threads * _Oversubmission_multiplier, _Chunks)); + _Submit((_STD min) (_Hw_threads * _Oversubmission_multiplier, _Chunks)); } private: @@ -278,7 +278,7 @@ constexpr size_t _Get_chunked_work_chunk_count(const size_t _Hw_threads, const _ // get the number of chunks to break work into to parallelize const auto _Size_count = static_cast(_Count); // no overflow due to forward iterators // we assume _Hw_threads * _Oversubscription_multiplier does not overflow - return (_STD min)(_Hw_threads * _Oversubscription_multiplier, _Size_count); + return (_STD min) (_Hw_threads * _Oversubscription_multiplier, _Size_count); } template @@ -685,7 +685,7 @@ public: private: atomic _Bottom{0}; // modified by only owning thread atomic _Top{0}; // modified by all threads - // clang-format off: clang-format 19 doesn't understand _Guarded_by_ and will damage the following code + // clang-format off: clang-format 20 doesn't understand _Guarded_by_ and will damage the following code _Guarded_by_(_Segment_lock) _Circular_buffer<_Ty>* _Segment { _Circular_buffer<_Ty>::_New_circular_buffer() }; // clang-format on mutex _Segment_lock{}; @@ -836,7 +836,7 @@ struct _Static_partition_team { // common data for all static partitioned ops _Diff _Get_chunk_offset(const size_t _This_chunk) const { const auto _This_chunk_diff = static_cast<_Diff>(_This_chunk); - return _This_chunk_diff * _Chunk_size + (_STD min)(_This_chunk_diff, _Unchunked_items); + return _This_chunk_diff * _Chunk_size + (_STD min) (_This_chunk_diff, _Unchunked_items); } _Static_partition_key<_Diff> _Get_next_key() { @@ -1058,7 +1058,7 @@ _Common_diff_t<_InIt1, _InIt2> _Distance_min(_InIt1 _First1, const _InIt1 _Last1 if constexpr (_Is_ranges_random_iter_v<_InIt1> && _Is_ranges_random_iter_v<_InIt2>) { const _CT _Count1 = _Last1 - _First1; const _CT _Count2 = _Last2 - _First2; - _Result = (_STD min)(_Count1, _Count2); + _Result = (_STD min) (_Count1, _Count2); } else if constexpr (_Is_ranges_random_iter_v<_InIt1>) { for (auto _Count1 = _Last1 - _First1; 0 < _Count1 && _First2 != _Last2; --_Count1) { ++_First2; @@ -2815,7 +2815,7 @@ struct _Static_partitioned_temporary_buffer2 { ptrdiff_t _Get_offset(const size_t _Chunk_number) { // get the offset of the first element of the temporary buffer allocated to chunk _Chunk_number auto _Diff_chunk = static_cast(_Chunk_number); - return _Diff_chunk * _Chunk_size + (_STD min)(_Diff_chunk, _Unchunked_items); + return _Diff_chunk * _Chunk_size + (_STD min) (_Diff_chunk, _Unchunked_items); } void _Destroy_all() { // destroy each element of the temporary buffer @@ -2846,13 +2846,13 @@ inline size_t _Get_stable_sort_tree_height(const size_t _Count, const size_t _Hw #else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv constexpr size_t _Max_tree_height = 30; #endif // ^^^ !defined(_WIN64) ^^^ - const size_t _Clamped_ideal_chunks = (_STD min)(_Max_tree_height, _Log_ideal_chunks); + const size_t _Clamped_ideal_chunks = (_STD min) (_Max_tree_height, _Log_ideal_chunks); // similarly, if _Clamped_ideal_chunks is odd, that would break our 2 to even power invariant, // so go to the next higher power of 2 const auto _Ideal_tree_height = _Clamped_ideal_chunks + (_Clamped_ideal_chunks & 0x1U); - return (_STD min)(_Count_max_tree_height, _Ideal_tree_height); + return (_STD min) (_Count_max_tree_height, _Ideal_tree_height); } struct _Bottom_up_merge_tree { @@ -3304,7 +3304,7 @@ struct _Static_partitioned_is_heap_until2 { const auto _Chunk_offset = _Key._Start_at; const auto _Last = _Chunk_offset + _Chunk_range_size; - const auto _Initial = (_STD max)(_Chunk_offset, _Diff{1}); + const auto _Initial = (_STD max) (_Chunk_offset, _Diff{1}); for (_Diff _Off = _Initial; _Off < _Last; ++_Off) { if (_DEBUG_LT_PRED(_Pred, *(_Range_first + ((_Off - 1) >> 1)), *(_Range_first + _Off))) { _Results._Imbue(_Key._Chunk_number, _Range_first + _Off); diff --git a/stl/inc/experimental/filesystem b/stl/inc/experimental/filesystem index f8d475a1e92..317fbc6c05f 100644 --- a/stl/inc/experimental/filesystem +++ b/stl/inc/experimental/filesystem @@ -2386,7 +2386,7 @@ _NODISCARD inline file_time_type last_write_time(const path& _Path, error_code& _Code.clear(); if (_Ticks == -1) { // report error _Code = make_error_code(errc::operation_not_permitted); - return (file_time_type::min)(); + return (file_time_type::min) (); } return file_time_type(chrono::system_clock::duration(_Ticks)); } diff --git a/stl/inc/filesystem b/stl/inc/filesystem index 29e32739e8b..9213863b630 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -3945,7 +3945,7 @@ namespace filesystem { if (_Error == __std_win_error::_Success) { _Result = file_time_type{file_time_type::duration{_Stats._Last_write_time}}; } else { - _Result = (file_time_type::min)(); + _Result = (file_time_type::min) (); } return _Error; diff --git a/stl/inc/format b/stl/inc/format index 0e6af0261bb..7823e4fdcb9 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -1685,8 +1685,8 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _Arithmetic _Value) { char* _End = _Buffer; if constexpr (is_floating_point_v<_Arithmetic>) { - if ((_STD isnan)(_Value)) { - if ((_STD signbit)(_Value)) { + if ((_STD isnan) (_Value)) { + if ((_STD signbit) (_Value)) { *_End++ = '-'; } @@ -2181,9 +2181,9 @@ _NODISCARD _OutputIt _Fmt_write( _Precision = _Max_precision; } - const auto _Is_negative = (_STD signbit)(_Value); + const auto _Is_negative = (_STD signbit) (_Value); - if ((_STD isnan)(_Value)) { + if ((_STD isnan) (_Value)) { _Result.ptr = _Buffer; if (_Is_negative) { ++_Result.ptr; // pretend to skip over a '-' that to_chars would put in _Buffer[0] @@ -2223,7 +2223,7 @@ _NODISCARD _OutputIt _Fmt_write( _Exponent -= 'a' - 'A'; } - const auto _Is_finite = (_STD isfinite)(_Value); + const auto _Is_finite = (_STD isfinite) (_Value); auto _Append_decimal = false; auto _Exponent_start = _Result.ptr; @@ -2242,7 +2242,7 @@ _NODISCARD _OutputIt _Fmt_write( _Exponent_start = _It; } } - _Integral_end = (_STD min)(_Radix_point, _Exponent_start); + _Integral_end = (_STD min) (_Radix_point, _Exponent_start); if (_Specs._Alt && _Radix_point == _Result.ptr) { // TRANSITION, decimal point may be wider diff --git a/stl/inc/forward_list b/stl/inc/forward_list index 24e58cf8306..26028413ebd 100644 --- a/stl/inc/forward_list +++ b/stl/inc/forward_list @@ -895,8 +895,8 @@ public: } _NODISCARD size_type max_size() const noexcept { - return (_STD min)( - static_cast(_STD _Max_limit()), _Alnode_traits::max_size(_Getal())); + return (_STD min) (static_cast(_STD _Max_limit()), // + _Alnode_traits::max_size(_Getal())); } _NODISCARD_EMPTY_MEMBER bool empty() const noexcept { diff --git a/stl/inc/functional b/stl/inc/functional index 6496b8d3dff..d51e506a2f8 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -373,7 +373,7 @@ _NODISCARD binder2nd<_Fn> bind2nd(const _Fn& _Func, const _Ty& _Right) { } _STL_RESTORE_DEPRECATED_WARNING -_EXPORT_STD template +_EXPORT_STD template class pointer_to_unary_function : public unary_function<_Arg, _Result> { // functor adapter (*pfunc)(left) public: explicit pointer_to_unary_function(_Fn _Left) : _Pfun(_Left) {} @@ -386,7 +386,7 @@ protected: _Fn _Pfun; // the function pointer }; -_EXPORT_STD template +_EXPORT_STD template class pointer_to_binary_function : public binary_function<_Arg1, _Arg2, _Result> { // functor adapter (*pfunc)(left, right) public: @@ -1682,7 +1682,7 @@ public: }; template -class _Move_only_function_call<_Rx(_Types...)&> : public _Move_only_function_base<_Rx, false, _Types...> { +class _Move_only_function_call<_Rx(_Types...) &> : public _Move_only_function_base<_Rx, false, _Types...> { public: using result_type = _Rx; @@ -2715,7 +2715,7 @@ void _Build_boyer_moore_delta_2_table(_Iter_diff_t<_RanItPat>* const _Shifts, co for (size_t _Jx = _Mx; _Jx > 0; --_Jx, --_Tx) { _Fx[_Jx - 1] = _Tx; while (_Tx <= _Mx && !_Eq(_Pat_first[_Jx - 1], _Pat_first[_Tx - 1])) { - _Shifts[_Tx - 1] = (_STD min)(_Shifts[_Tx - 1], static_cast<_Diff>(_Mx - _Jx)); + _Shifts[_Tx - 1] = (_STD min) (_Shifts[_Tx - 1], static_cast<_Diff>(_Mx - _Jx)); _Tx = _Fx[_Tx - 1]; } } @@ -2735,7 +2735,7 @@ void _Build_boyer_moore_delta_2_table(_Iter_diff_t<_RanItPat>* const _Shifts, co size_t _Qx1 = 1; while (_Qx < _Mx) { for (size_t _Kx = _Qx1; _Kx <= _Qx; ++_Kx) { - _Shifts[_Kx - 1] = (_STD min)(_Shifts[_Kx - 1], static_cast<_Diff>(_Mx + _Qx - _Kx)); + _Shifts[_Kx - 1] = (_STD min) (_Shifts[_Kx - 1], static_cast<_Diff>(_Mx + _Qx - _Kx)); } _Qx1 = _Qx + 1; @@ -2778,7 +2778,7 @@ pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_search( --_Idx; --_UFirst; } while (_Eq(*_UFirst, _UPat_first[_Idx])); - _Shift = (_STD max)(_Delta1._Lookup(*_UFirst), _Delta2[_Idx]); + _Shift = (_STD max) (_Delta1._Lookup(*_UFirst), _Delta2[_Idx]); } } diff --git a/stl/inc/generator b/stl/inc/generator index fbc69d90e11..0bc7ab7a6a8 100644 --- a/stl/inc/generator +++ b/stl/inc/generator @@ -68,7 +68,7 @@ namespace _Gen_detail { return (_Size + sizeof(_Aligned_block) - 1) / sizeof(_Aligned_block); } else { // allocator is stateful, we need storage for it - constexpr size_t _Align = (_STD max)(alignof(_Alloc), sizeof(_Aligned_block)); + constexpr size_t _Align = (_STD max) (alignof(_Alloc), sizeof(_Aligned_block)); return (_Size + sizeof(_Alloc) + _Align - 1) / sizeof(_Aligned_block); } } @@ -143,7 +143,7 @@ namespace _Gen_detail { if constexpr (_Stateless_allocator<_Alloc>) { _Bytes += sizeof(_Aligned_block) - 1; } else { - constexpr size_t _Align = (_STD max)(alignof(_Alloc), sizeof(_Aligned_block)); + constexpr size_t _Align = (_STD max) (alignof(_Alloc), sizeof(_Aligned_block)); _Bytes += sizeof(_Alloc) + _Align - 1; } return _Bytes / sizeof(_Aligned_block); diff --git a/stl/inc/list b/stl/inc/list index 445347c1889..b1bd37d0a7f 100644 --- a/stl/inc/list +++ b/stl/inc/list @@ -1205,8 +1205,8 @@ public: } _NODISCARD size_type max_size() const noexcept { - return (_STD min)( - static_cast(_STD _Max_limit()), _Alnode_traits::max_size(_Getal())); + return (_STD min) (static_cast(_STD _Max_limit()), // + _Alnode_traits::max_size(_Getal())); } _NODISCARD_EMPTY_MEMBER bool empty() const noexcept { diff --git a/stl/inc/memory b/stl/inc/memory index 1d1cf71b420..0a5e8e3833f 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -533,7 +533,7 @@ namespace ranges { public: template requires requires(_Ty* _Ptr, _Types&&... _Args) { - ::new (static_cast(_Ptr)) _Ty(static_cast<_Types&&>(_Args)...); // per LWG-3888 + ::new (static_cast(_Ptr)) _Ty(static_cast<_Types &&>(_Args)...); // per LWG-3888 } _STATIC_CALL_OPERATOR constexpr _Ty* operator()(_Ty* _Location, _Types&&... _Args) _CONST_CALL_OPERATOR noexcept(noexcept( @@ -4066,7 +4066,7 @@ protected: } ::__std_atomic_wait_direct( _STD addressof(_Ptr), _STD addressof(_Old_ptr), sizeof(_Old_ptr), _Remaining_timeout); - _Remaining_timeout = (_STD min)(_Max_timeout, _Remaining_timeout * 2); + _Remaining_timeout = (_STD min) (_Max_timeout, _Remaining_timeout * 2); } } @@ -4377,8 +4377,7 @@ public: noexcept(is_nothrow_constructible_v, _ArgsT...>) /* strengthened */ : _Smart_ptr(_Smart_ptr_), _Mypair(_One_then_variadic_args_t{}, tuple<_ArgsT...>{_STD forward<_ArgsT>(_Args_)...}) { - constexpr bool _Is_resettable = requires { _Smart_ptr.reset(); }; // TRANSITION, DevCom-10291456 - if constexpr (_Is_resettable) { + if constexpr (requires { _Smart_ptr.reset(); }) { _Smart_ptr.reset(); } else { static_assert(is_constructible_v<_SmartPtr>, "the adapted pointer type must be default constructible."); diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index 59aee2f5fc0..e98e9724c44 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -324,7 +324,7 @@ namespace pmr { static constexpr bool _Prepare_oversized(size_t& _Bytes, size_t& _Align) noexcept { // adjust size and alignment to allow for an _Oversized_header - _Align = (_STD max)(_Align, alignof(_Oversized_header)); + _Align = (_STD max) (_Align, alignof(_Oversized_header)); if (_Bytes > SIZE_MAX - sizeof(_Oversized_header) - alignof(_Oversized_header) + 1) { // no room for header + alignment padding @@ -523,8 +523,8 @@ namespace pmr { // scale _Next_capacity by 2, saturating so that _Size_for_capacity(_Next_capacity) cannot overflow _Next_capacity = - (_STD min)(_Next_capacity << 1, (_STD min)((PTRDIFF_MAX - sizeof(_Chunk)) >> _Log_of_size, - _Pool_resource._Options.max_blocks_per_chunk)); + (_STD min) (_Next_capacity << 1, (_STD min) ((PTRDIFF_MAX - sizeof(_Chunk)) >> _Log_of_size, + _Pool_resource._Options.max_blocks_per_chunk)); } }; @@ -551,7 +551,7 @@ namespace pmr { pair::iterator, unsigned char> _Find_pool( const size_t _Bytes, const size_t _Align) noexcept { // find the pool from which to allocate a block with size _Bytes and alignment _Align - const size_t _Size = (_STD max)(_Bytes + sizeof(void*), _Align); + const size_t _Size = (_STD max) (_Bytes + sizeof(void*), _Align); const auto _Log_of_size = static_cast(_Ceiling_of_log_2(_Size)); return { _STD lower_bound(_Pools.begin(), _Pools.end(), _Log_of_size, @@ -637,7 +637,7 @@ namespace pmr { // unscale _Next_buffer_size so the next allocation will be the same size as the most recent allocation // (keep synchronized with monotonic_buffer_resource::_Scale) const size_t _Unscaled = (_Next_buffer_size / 3 * 2 + alignof(_Header) - 1) & _Max_allocation; - _Next_buffer_size = (_STD max)(_Unscaled, _Min_allocation); + _Next_buffer_size = (_STD max) (_Unscaled, _Min_allocation); _Intrusive_stack<_Header> _Tmp{}; _STD swap(_Tmp, _Chunks); @@ -722,7 +722,7 @@ namespace pmr { _New_size = (_Bytes + sizeof(_Header) + alignof(_Header) - 1) & _Max_allocation; } - const size_t _New_align = (_STD max)(alignof(_Header), _Align); + const size_t _New_align = (_STD max) (alignof(_Header), _Align); void* _New_buffer = _Resource->allocate(_New_size, _New_align); _Check_alignment(_New_buffer, _New_align); diff --git a/stl/inc/numeric b/stl/inc/numeric index 338abe4ca3c..d9a04eaa4b7 100644 --- a/stl/inc/numeric +++ b/stl/inc/numeric @@ -690,7 +690,7 @@ _NODISCARD constexpr common_type_t<_Mt, _Nt> gcd(const _Mt _Mx, const _Nt _Nx) n const auto _Mx_trailing_zeroes = static_cast(_Countr_zero_impl(_Mx_magnitude)); auto _Nx_trailing_zeroes = static_cast(_Countr_zero_impl(_Nx_magnitude)); - const auto _Common_factors_of_2 = (_STD min)(_Mx_trailing_zeroes, _Nx_trailing_zeroes); + const auto _Common_factors_of_2 = (_STD min) (_Mx_trailing_zeroes, _Nx_trailing_zeroes); _Mx_magnitude >>= _Mx_trailing_zeroes; for (;;) { _Nx_magnitude >>= _Nx_trailing_zeroes; diff --git a/stl/inc/random b/stl/inc/random index 37150284a91..7a033d12e4c 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -308,8 +308,8 @@ _NODISCARD _Real generate_canonical(_Gen& _Gx) { // build a floating-point value } else { using _Result_uint_type = conditional_t<_Minbits <= 32, uint32_t, uint64_t>; - constexpr auto _Gxmin = (_Gen::min)(); - constexpr auto _Gxmax = (_Gen::max)(); + constexpr auto _Gxmin = (_Gen::min) (); + constexpr auto _Gxmax = (_Gen::max) (); constexpr auto _Params = _Generate_canonical_params(_Minbits, _Gxmax - _Gxmin); _STL_INTERNAL_STATIC_ASSERT(_Params._Kx >= 1); @@ -409,7 +409,8 @@ constexpr bool _Has_static_min_max = false; // This checks a requirement of N4981 [rand.req.urng] `concept uniform_random_bit_generator` but doesn't attempt // to implement the whole concept - we just need to distinguish Standard machinery from tr1 machinery. template -constexpr bool _Has_static_min_max<_Gen, void_t::value)>> = true; +constexpr bool _Has_static_min_max<_Gen, void_t::value)>> = + true; template _NODISCARD _Real _Nrand_impl(_Gen& _Gx) { // build a floating-point value from random sequence @@ -1104,8 +1105,7 @@ public: this->_Ax[_Ix] |= static_cast<_Ty>(_Arr[_Idx0 + _Jx]) << (32 * _Jx); } - constexpr bool _Mod_non_zero = _Traits::_Mod != 0; - if constexpr (_Mod_non_zero) { + if constexpr (_Traits::_Mod != 0) { this->_Ax[_Ix] %= _Traits::_Mod; } } @@ -1809,11 +1809,11 @@ public: } _NODISCARD static constexpr result_type(min)() noexcept /* strengthened */ { - return (_Engine::min)(); + return (_Engine::min) (); } _NODISCARD static constexpr result_type(max)() noexcept /* strengthened */ { - return (_Engine::max)(); + return (_Engine::max) (); } _NODISCARD friend bool operator==(const discard_block_engine& _Left, const discard_block_engine& _Right) { @@ -1907,7 +1907,7 @@ public: for (; _Idx < _Nx0; ++_Idx) { // pack _Wx0-bit values for (;;) { // get a small enough value - _Val = _Eng() - (_Engine::min)(); + _Val = _Eng() - (_Engine::min) (); if (_Val <= _Yx0) { break; } @@ -1918,7 +1918,7 @@ public: _Mask = _Mask << 1 | 1; for (; _Idx < _Nx; ++_Idx) { // pack _Wx0+1-bit values for (;;) { // get a small enough value - _Val = _Eng() - (_Engine::min)(); + _Val = _Eng() - (_Engine::min) (); if (_Val <= _Yx1) { break; } @@ -1959,7 +1959,7 @@ public: private: void _Init() { // compute values for operator() size_t _Mx = 0; - _Eres _Rx = (_Engine::max)() - (_Engine::min)() + 1; + _Eres _Rx = (_Engine::max) () - (_Engine::min) () + 1; _Eres _Tmp = _Rx; if (_Tmp == 0) { // all bits used, make _Rx finite @@ -2043,11 +2043,11 @@ public: } _NODISCARD static constexpr result_type(min)() noexcept /* strengthened */ { - return (_Engine::min)(); + return (_Engine::min) (); } _NODISCARD static constexpr result_type(max)() noexcept /* strengthened */ { - return (_Engine::max)(); + return (_Engine::max) (); } _NODISCARD result_type operator()() { @@ -2194,7 +2194,7 @@ public: private: _Udiff _Get_bits() { // return a random value within [0, _Bmask] - static constexpr auto _Urng_min = (_Urng::min)(); + static constexpr auto _Urng_min = (_Urng::min) (); for (;;) { // repeat until random value is in range const _Udiff _Val = _Ref() - _Urng_min; @@ -2207,7 +2207,7 @@ private: static constexpr size_t _Calc_bits() { auto _Bits_local = _Udiff_bits; auto _Bmask_local = static_cast<_Udiff>(-1); - for (; (_Urng::max)() - (_Urng::min)() < _Bmask_local; _Bmask_local >>= 1) { + for (; (_Urng::max) () - (_Urng::min) () < _Bmask_local; _Bmask_local >>= 1) { --_Bits_local; } @@ -3174,7 +3174,7 @@ private: // inequality gives -1+p*t >= -(1-p)^t, so 1 - (1-p)^t <= p*t = mean. For the other bound, 1-(1-p)^t = // 1-(1-p)(1-mean/t)^(t-1) <= 1-(1-p)(1-1/t)^(t-1) <= 1-(1-p)/e. const _Ty1 _Ub = - (_STD min)(_Par0._Mean, _Ty1{3.678794411714423216e-1} * _Par0._Pp + _Ty1{6.32120558828557678e-1}); + (_STD min) (_Par0._Mean, _Ty1{3.678794411714423216e-1} * _Par0._Pp + _Ty1{6.32120558828557678e-1}); if (_Rand > _Ub) { _Res = _Ty{0}; } else { @@ -3777,7 +3777,7 @@ private: // Bad _Sx value! Very small values will overflow log(_Sx) / _Sx. // Generate a new value based on scaling method. const _Ty _Ln2{_Ty{0.69314718055994530941723212145818}}; - const _Ty _Maxabs{(_STD max)(_STD abs(_Vx1), _STD abs(_Vx2))}; + const _Ty _Maxabs{(_STD max) (_STD abs(_Vx1), _STD abs(_Vx2))}; const int _ExpMax{_STD ilogb(_Maxabs)}; _Vx1 = _STD scalbn(_Vx1, -_ExpMax); _Vx2 = _STD scalbn(_Vx2, -_ExpMax); diff --git a/stl/inc/ranges b/stl/inc/ranges index 1374e0bce35..4dd831145fc 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -644,7 +644,7 @@ namespace ranges { noexcept(noexcept(single_view>(_STD forward<_Ty>(_Val)))) requires requires { typename single_view>; - single_view>(static_cast<_Ty&&>(_Val)); + single_view>(static_cast<_Ty &&>(_Val)); } { return single_view>(_STD forward<_Ty>(_Val)); @@ -1041,7 +1041,7 @@ namespace ranges { template _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(noexcept(iota_view>(static_cast<_Ty&&>(_Val)))) - requires requires { iota_view>(static_cast<_Ty&&>(_Val)); } + requires requires { iota_view>(static_cast<_Ty &&>(_Val)); } { return iota_view>(static_cast<_Ty&&>(_Val)); } @@ -1050,7 +1050,7 @@ namespace ranges { _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()( _Ty1&& _Start, _Ty2&& _Bound) _CONST_CALL_OPERATOR noexcept(noexcept(iota_view(static_cast<_Ty1&&>(_Start), static_cast<_Ty2&&>(_Bound)))) - requires requires { iota_view(static_cast<_Ty1&&>(_Start), static_cast<_Ty2&&>(_Bound)); } + requires requires { iota_view(static_cast<_Ty1 &&>(_Start), static_cast<_Ty2 &&>(_Bound)); } { return iota_view(static_cast<_Ty1&&>(_Start), static_cast<_Ty2&&>(_Bound)); } @@ -1543,7 +1543,7 @@ namespace ranges { // direct-non-list-initialization is specified in the Standard (N4981 [range.as.rvalue.overview]/2.2) // and needed for EDG, DevCom-10698021 template - concept _Can_as_rvalue = requires(_Rng&& __r) { as_rvalue_view(static_cast<_Rng&&>(__r)); }; + concept _Can_as_rvalue = requires(_Rng&& __r) { as_rvalue_view(static_cast<_Rng &&>(__r)); }; class _As_rvalue_fn : public _Pipe::_Base<_As_rvalue_fn> { private: @@ -1828,7 +1828,7 @@ namespace ranges { template _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Pr&& _Pred) _CONST_CALL_OPERATOR noexcept(noexcept(filter_view(_STD forward<_Rng>(_Range), _STD forward<_Pr>(_Pred)))) - requires requires { filter_view(static_cast<_Rng&&>(_Range), _STD forward<_Pr>(_Pred)); } + requires requires { filter_view(static_cast<_Rng &&>(_Range), _STD forward<_Pr>(_Pred)); } { return filter_view(_STD forward<_Rng>(_Range), _STD forward<_Pr>(_Pred)); } @@ -1963,7 +1963,7 @@ namespace ranges { } } else if constexpr (sized_sentinel_for, iterator_t<_Vw>>) { auto _Iter = _RANGES begin(_Range); - const auto _Size = (_STD min)(_Count, _RANGES end(_Range) - _Iter); + const auto _Size = (_STD min) (_Count, _RANGES end(_Range) - _Iter); return counted_iterator(_STD move(_Iter), _Size); } else { return counted_iterator(_RANGES begin(_Range), _Count); @@ -1982,7 +1982,7 @@ namespace ranges { } } else if constexpr (sized_sentinel_for, iterator_t>) { auto _Iter = _RANGES begin(_Range); - const auto _Size = (_STD min)(_Count, _RANGES end(_Range) - _Iter); + const auto _Size = (_STD min) (_Count, _RANGES end(_Range) - _Iter); return counted_iterator(_STD move(_Iter), _Size); } else { return counted_iterator(_RANGES begin(_Range), _Count); @@ -2025,14 +2025,14 @@ namespace ranges { requires sized_range<_Vw> { const auto _Length = _RANGES size(_Range); - return (_STD min)(_Length, static_cast(_Count)); + return (_STD min) (_Length, static_cast(_Count)); } _NODISCARD constexpr auto size() const requires sized_range { const auto _Length = _RANGES size(_Range); - return (_STD min)(_Length, static_cast(_Count)); + return (_STD min) (_Length, static_cast(_Count)); } }; @@ -2114,7 +2114,7 @@ namespace ranges { #endif // _HAS_CXX23 } else { // it's a "reconstructible range"; return the same kind of range with a restricted extent - _Count = (_STD min)(_RANGES distance(_Range), _Count); + _Count = (_STD min) (_RANGES distance(_Range), _Count); const auto _First = _RANGES begin(_Range); if constexpr (_Strat == _St::_Reconstruct_span) { @@ -2300,7 +2300,7 @@ namespace ranges { template _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Pr _Pred) _CONST_CALL_OPERATOR noexcept(noexcept(take_while_view(_STD forward<_Rng>(_Range), _STD move(_Pred)))) - requires requires { take_while_view(static_cast<_Rng&&>(_Range), _STD move(_Pred)); } + requires requires { take_while_view(static_cast<_Rng &&>(_Range), _STD move(_Pred)); } { return take_while_view(_STD forward<_Rng>(_Range), _STD move(_Pred)); } @@ -2375,7 +2375,7 @@ namespace ranges { requires (!(_Simple_view<_Vw> && random_access_range && sized_range) ) { if constexpr (sized_range<_Vw> && random_access_range<_Vw>) { - const auto _Offset = (_STD min)(_RANGES distance(_Range), _Count); + const auto _Offset = (_STD min) (_RANGES distance(_Range), _Count); return _RANGES begin(_Range) + _Offset; } else { if constexpr (forward_range<_Vw>) { @@ -2395,7 +2395,7 @@ namespace ranges { _NODISCARD constexpr auto begin() const requires random_access_range && sized_range { - const auto _Offset = (_STD min)(_RANGES distance(_Range), _Count); + const auto _Offset = (_STD min) (_RANGES distance(_Range), _Count); return _RANGES begin(_Range) + _Offset; } @@ -2515,7 +2515,7 @@ namespace ranges { } else if constexpr (_Strat == _St::_Reconstruct_repeat) { if constexpr (sized_range<_Rng>) { const auto _Size = _RANGES distance(_Range); - _Count = _Size - (_STD min)(_Size, _Count); + _Count = _Size - (_STD min) (_Size, _Count); return repeat_view(_STD forward_like<_Rng>(*_Range._Value), _Count); } else { return _Range; @@ -2523,7 +2523,7 @@ namespace ranges { #endif // _HAS_CXX23 } else { // it's a "reconstructible range"; return the same kind of range with a restricted extent - _Count = (_STD min)(_RANGES distance(_Range), _Count); + _Count = (_STD min) (_RANGES distance(_Range), _Count); if constexpr (_Strat == _St::_Reconstruct_span) { return span(_Ubegin(_Range) + _Count, _Uend(_Range)); @@ -2625,7 +2625,7 @@ namespace ranges { template _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Pr _Pred) _CONST_CALL_OPERATOR noexcept(noexcept(drop_while_view(_STD forward<_Rng>(_Range), _STD move(_Pred)))) - requires requires { drop_while_view(static_cast<_Rng&&>(_Range), _STD move(_Pred)); } + requires requires { drop_while_view(static_cast<_Rng &&>(_Range), _STD move(_Pred)); } { return drop_while_view(_STD forward<_Rng>(_Range), _STD move(_Pred)); } @@ -3056,7 +3056,7 @@ namespace ranges { template _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR noexcept(noexcept(join_view>{_STD forward<_Rng>(_Range)})) - requires requires { join_view>{static_cast<_Rng&&>(_Range)}; } + requires requires { join_view>{static_cast<_Rng &&>(_Range)}; } { return join_view>{_STD forward<_Rng>(_Range)}; } @@ -3589,7 +3589,7 @@ namespace ranges { const bool _Overflow = _Mul_overflow(static_cast<_Size_type>(_Compile_time_max_size<_Rng>), static_cast<_Size_type>(_Compile_time_max_size<_Inner>), _Joined_max_size) - || _Mul_overflow((_STD max)(static_cast<_Size_type>(_Compile_time_max_size<_Rng>), _Size_type{1}) - 1, + || _Mul_overflow((_STD max) (static_cast<_Size_type>(_Compile_time_max_size<_Rng>), _Size_type{1}) - 1, static_cast<_Size_type>(_Compile_time_max_size<_Pat>), _Pattern_max_size) || _Add_overflow(_Joined_max_size, _Pattern_max_size, _Result); if (_Overflow) { @@ -4028,7 +4028,7 @@ namespace ranges { _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()( _Rng&& _Range, _Pat&& _Pattern) _CONST_CALL_OPERATOR noexcept(noexcept(lazy_split_view(_STD forward<_Rng>(_Range), _STD forward<_Pat>(_Pattern)))) - requires requires { lazy_split_view(static_cast<_Rng&&>(_Range), static_cast<_Pat&&>(_Pattern)); } + requires requires { lazy_split_view(static_cast<_Rng &&>(_Range), static_cast<_Pat &&>(_Pattern)); } { return lazy_split_view(_STD forward<_Rng>(_Range), _STD forward<_Pat>(_Pattern)); } @@ -4214,7 +4214,7 @@ namespace ranges { _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()( _Rng&& _Range, _Pat&& _Pattern) _CONST_CALL_OPERATOR noexcept(noexcept(split_view(_STD forward<_Rng>(_Range), _STD forward<_Pat>(_Pattern)))) - requires requires { split_view(static_cast<_Rng&&>(_Range), static_cast<_Pat&&>(_Pattern)); } + requires requires { split_view(static_cast<_Rng &&>(_Range), static_cast<_Pat &&>(_Pattern)); } { return split_view(_STD forward<_Rng>(_Range), _STD forward<_Pat>(_Pattern)); } @@ -4498,10 +4498,10 @@ namespace ranges { namespace views { template - concept _Can_extract_base = requires(_Rng&& __r) { static_cast<_Rng&&>(__r).base(); }; + concept _Can_extract_base = requires(_Rng&& __r) { static_cast<_Rng &&>(__r).base(); }; template - concept _Can_reverse = requires(_Rng&& __r) { reverse_view{static_cast<_Rng&&>(__r)}; }; + concept _Can_reverse = requires(_Rng&& __r) { reverse_view{static_cast<_Rng &&>(__r)}; }; class _Reverse_fn : public _Pipe::_Base<_Reverse_fn> { private: @@ -4642,7 +4642,7 @@ namespace ranges { namespace views { template - concept _Can_as_const = requires(_Rng&& __r) { as_const_view{static_cast<_Rng&&>(__r)}; }; + concept _Can_as_const = requires(_Rng&& __r) { as_const_view{static_cast<_Rng &&>(__r)}; }; class _As_const_fn : public _Pipe::_Base<_As_const_fn> { private: @@ -5119,7 +5119,7 @@ namespace ranges { template _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR noexcept(noexcept(elements_view, _Index>{_STD forward<_Rng>(_Range)})) - requires requires { elements_view, _Index>{static_cast<_Rng&&>(_Range)}; } + requires requires { elements_view, _Index>{static_cast<_Rng &&>(_Range)}; } { return elements_view, _Index>{_STD forward<_Rng>(_Range)}; } @@ -5509,7 +5509,7 @@ namespace ranges { _NODISCARD constexpr range_difference_t<_Vw> _Get_size() const noexcept(noexcept(_RANGES end(_Parent->_Range) - *_Parent->_Current)) { - return (_STD min)(_Parent->_Remainder, _RANGES end(_Parent->_Range) - *_Parent->_Current); + return (_STD min) (_Parent->_Remainder, _RANGES end(_Parent->_Range) - *_Parent->_Current); } _NODISCARD constexpr const iterator_t<_Vw>& _Get_current() const noexcept { @@ -5644,7 +5644,7 @@ namespace ranges { requires sized_sentinel_for, iterator_t<_Vw>> { return _To_unsigned_like( - (_STD min)(_Parent->_Remainder, _RANGES end(_Parent->_Range) - *_Parent->_Current)); + (_STD min) (_Parent->_Remainder, _RANGES end(_Parent->_Range) - *_Parent->_Current)); } }; @@ -7124,12 +7124,13 @@ namespace ranges { requires (sizeof...(_LHSTupleTypes) == sizeof...(_RHSTupleTypes)) _NODISCARD constexpr _ResultType _Zip_get_smallest_distance( const tuple<_LHSTupleTypes...>& _Lhs_tuple, const tuple<_RHSTupleTypes...>& _Rhs_tuple) - // clang-format off noexcept((noexcept(static_cast<_ResultType>( - _STD declval() - _STD declval())) && ...)) { - constexpr bool _Is_noexcept = (noexcept(static_cast<_ResultType>( - _STD declval() - _STD declval())) && ...); - // clang-format on + _STD declval() - _STD declval())) + && ...)) { + constexpr bool _Is_noexcept = + (noexcept(static_cast<_ResultType>( // + _STD declval() - _STD declval())) + && ...); const auto _Get_smallest_distance_closure = [&_Lhs_tuple, &_Rhs_tuple]( index_sequence<_FirstIdx, _Idxs...>) noexcept(_Is_noexcept) { @@ -7140,8 +7141,8 @@ namespace ranges { } const initializer_list<_ResultType> _Sizes = { _First_size, (_STD get<_Idxs>(_Lhs_tuple) - _STD get<_Idxs>(_Rhs_tuple))...}; - return _First_size < 0 ? static_cast<_ResultType>((_RANGES max)(_Sizes)) - : static_cast<_ResultType>((_RANGES min)(_Sizes)); + return _First_size < 0 ? static_cast<_ResultType>((_RANGES max) (_Sizes)) + : static_cast<_ResultType>((_RANGES min) (_Sizes)); }; return _Get_smallest_distance_closure(index_sequence_for<_LHSTupleTypes...>{}); @@ -7154,7 +7155,7 @@ namespace ranges { noexcept((noexcept(_STD declval() == _STD declval()) && ...)) { const auto _Evaluate_equality_closure = [&_Lhs_tuple, &_Rhs_tuple](index_sequence<_Indices...>) noexcept( - (noexcept(_STD declval() == _STD declval())&&...)) { + (noexcept(_STD declval() == _STD declval()) &&...)) { return ((_STD get<_Indices>(_Lhs_tuple) == _STD get<_Indices>(_Rhs_tuple)) || ... || false); }; @@ -7470,7 +7471,7 @@ namespace ranges { static constexpr auto _Size_closure = [](auto... _Sizes) _STATIC_LAMBDA noexcept { using _Common_unsigned_type = _Make_unsigned_like_t>; - return (_RANGES min)({static_cast<_Common_unsigned_type>(_Sizes)...}); + return (_RANGES min) ({static_cast<_Common_unsigned_type>(_Sizes)...}); }; public: @@ -7542,7 +7543,7 @@ namespace ranges { template _NODISCARD consteval auto _Zip_view_compile_time_max_size() { using _Size_type = common_type_t)...>; - return (_STD min)({static_cast<_Size_type>(_Compile_time_max_size<_Rngs>)...}); + return (_STD min) ({static_cast<_Size_type>(_Compile_time_max_size<_Rngs>)...}); } template @@ -7813,7 +7814,7 @@ namespace ranges { template requires sized_sentinel_for<_Zentinel<_IsConst>, _Ziperator<_IteratorConst>> _NODISCARD friend constexpr _Iter_sent_difference_type<_IteratorConst> // TRANSITION, DevCom-10253131 - operator-(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel & _Rhs) + operator-(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel& _Rhs) noexcept(noexcept(_Get_iterator_inner(_Lhs) - _Rhs._Inner)) /* strengthened */ { return _Get_iterator_inner(_Lhs) - _Rhs._Inner; } @@ -7821,7 +7822,7 @@ namespace ranges { template requires sized_sentinel_for<_Zentinel<_IsConst>, _Ziperator<_IteratorConst>> _NODISCARD friend constexpr _Iter_sent_difference_type<_IteratorConst> // TRANSITION, DevCom-10253131 - operator-(const _Sentinel & _Lhs, const _Iterator<_IteratorConst>& _Rhs) + operator-(const _Sentinel& _Lhs, const _Iterator<_IteratorConst>& _Rhs) noexcept(noexcept(_Lhs._Inner - _Get_iterator_inner(_Rhs))) /* strengthened */ { return _Lhs._Inner - _Get_iterator_inner(_Rhs); } @@ -8329,7 +8330,7 @@ namespace ranges { using _Size_type = decltype(_RANGES size(_Range)); using _Common_size_type = common_type_t<_Size_type, size_t>; auto _Size = static_cast<_Common_size_type>(_RANGES size(_Range)); - _Size -= (_STD min)(_Size, static_cast<_Common_size_type>(_Nx - 1)); + _Size -= (_STD min) (_Size, static_cast<_Common_size_type>(_Nx - 1)); return static_cast<_Size_type>(_Size); } @@ -8339,7 +8340,7 @@ namespace ranges { using _Size_type = decltype(_RANGES size(_Range)); using _Common_size_type = common_type_t<_Size_type, size_t>; auto _Size = static_cast<_Common_size_type>(_RANGES size(_Range)); - _Size -= (_STD min)(_Size, static_cast<_Common_size_type>(_Nx - 1)); + _Size -= (_STD min) (_Size, static_cast<_Common_size_type>(_Nx - 1)); return static_cast<_Size_type>(_Size); } }; @@ -8351,7 +8352,7 @@ namespace ranges { _NODISCARD consteval auto _Adjacent_view_compile_time_max_size() { using _Size_type = common_type_t), size_t>; auto _Size = static_cast<_Size_type>(_Compile_time_max_size<_Rng>); - _Size -= (_STD min)(_Size, static_cast<_Size_type>(_Nx - 1)); + _Size -= (_STD min) (_Size, static_cast<_Size_type>(_Nx - 1)); return static_cast<_Size_type>(_Size); } diff --git a/stl/inc/span b/stl/inc/span index ec504c98775..e1f58060c8a 100644 --- a/stl/inc/span +++ b/stl/inc/span @@ -465,8 +465,6 @@ public: return _Mydata[_Off]; } -#pragma warning(push) -#pragma warning(disable : 4127) // conditional expression is constant _NODISCARD constexpr reference front() const noexcept /* strengthened */ { #if _MSVC_STL_HARDENING_SPAN || _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_Mysize > 0, "front() called on empty span"); @@ -482,7 +480,6 @@ public: return _Mydata[_Mysize - 1]; } -#pragma warning(pop) _NODISCARD constexpr pointer data() const noexcept { return _Mydata; diff --git a/stl/inc/sstream b/stl/inc/sstream index b148784abbf..ae2d25d1613 100644 --- a/stl/inc/sstream +++ b/stl/inc/sstream @@ -198,7 +198,7 @@ public: // writable, make string view from write buffer const auto _Base = _Mysb::pbase(); _Result._Ptr = _Base; - _Result._Size = static_cast<_Mysize_type>((_STD max)(_Mysb::pptr(), _Seekhigh) - _Base); + _Result._Size = static_cast<_Mysize_type>((_STD max) (_Mysb::pptr(), _Seekhigh) - _Base); _Result._Res = static_cast<_Mysize_type>(_Mysb::epptr() - _Base); } else if (!(_Mystate & _Noread) && _Mysb::gptr()) { // readable, make string view from read buffer @@ -380,7 +380,7 @@ protected: return _Traits::eof(); } - const auto _Local_highwater = (_STD max)(_Seekhigh, _Pptr); + const auto _Local_highwater = (_STD max) (_Seekhigh, _Pptr); if (_Local_highwater <= _Gptr) { // nothing in the put area to take return _Traits::eof(); } diff --git a/stl/inc/tuple b/stl/inc/tuple index 5eb1453bd7b..cbb51e5ce56 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -753,7 +753,7 @@ public: template static constexpr bool _Can_equal_compare_with_tuple_like_v<_Other, index_sequence<_Indices...>> = (requires(const tuple& _Left, const _Other& _Right) { - { _STD get<_Indices>(_Left) == _STD get<_Indices>(_Right) } -> _Boolean_testable; + { _STD get<_Indices>(_Left) == _STD get<_Indices>(_Right) }->_Boolean_testable; } && ...); template diff --git a/stl/inc/utility b/stl/inc/utility index 326b5f8978b..dd4d327ea21 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -626,15 +626,15 @@ struct _MSVC_KNOWN_SEMANTICS tuple_element<_Index, const _Tuple> : tuple_element }; template -struct _CXX20_DEPRECATE_VOLATILE _MSVC_KNOWN_SEMANTICS tuple_element<_Index, volatile _Tuple> - : tuple_element<_Index, _Tuple> { +struct _CXX20_DEPRECATE_VOLATILE _MSVC_KNOWN_SEMANTICS + tuple_element<_Index, volatile _Tuple> : tuple_element<_Index, _Tuple> { using _Mybase = tuple_element<_Index, _Tuple>; using type = add_volatile_t; }; template -struct _CXX20_DEPRECATE_VOLATILE _MSVC_KNOWN_SEMANTICS tuple_element<_Index, const volatile _Tuple> - : tuple_element<_Index, _Tuple> { +struct _CXX20_DEPRECATE_VOLATILE _MSVC_KNOWN_SEMANTICS + tuple_element<_Index, const volatile _Tuple> : tuple_element<_Index, _Tuple> { using _Mybase = tuple_element<_Index, _Tuple>; using type = add_cv_t; }; diff --git a/stl/inc/vector b/stl/inc/vector index 28b982087b1..3e469e3d15e 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -1916,7 +1916,8 @@ public: } _NODISCARD _CONSTEXPR20 size_type max_size() const noexcept { - return (_STD min)(static_cast(_STD _Max_limit()), _Alty_traits::max_size(_Getal())); + return (_STD min) (static_cast(_STD _Max_limit()), // + _Alty_traits::max_size(_Getal())); } _NODISCARD _CONSTEXPR20 size_type capacity() const noexcept { @@ -2332,7 +2333,7 @@ _NODISCARD constexpr _Synth_three_way_result<_Ty> operator<=>( const vector<_Ty, _Alloc>& _Left, const vector<_Ty, _Alloc>& _Right) { if constexpr (is_same_v<_Ty, bool>) { // This optimization works because vector "trims" its underlying storage by zeroing out unused bits. - const auto _Min_word_size = (_STD min)(_Left._Myvec.size(), _Right._Myvec.size()); + const auto _Min_word_size = (_STD min) (_Left._Myvec.size(), _Right._Myvec.size()); const auto _Left_words = _Left._Myvec._Unchecked_begin(); const auto _Right_words = _Right._Myvec._Unchecked_begin(); @@ -2359,7 +2360,7 @@ _NODISCARD _CONSTEXPR20 bool operator<(const vector<_Ty, _Alloc>& _Left, const v auto _First = _Left._Myvec._Unchecked_begin(); auto _Other = _Right._Myvec._Unchecked_begin(); - const auto _Last = _First + (_STD min)(_Left._Myvec.size(), _Right._Myvec.size()); + const auto _Last = _First + (_STD min) (_Left._Myvec.size(), _Right._Myvec.size()); for (; _First != _Last; ++_First, (void) ++_Other) { using _Comp = _Vbase_compare_three_way; diff --git a/stl/inc/xcharconv_ryu.h b/stl/inc/xcharconv_ryu.h index c01ee82d805..b14752430b1 100644 --- a/stl/inc/xcharconv_ryu.h +++ b/stl/inc/xcharconv_ryu.h @@ -74,7 +74,7 @@ _STD_BEGIN // https://github.com/ulfjack/ryu/tree/59661c3/ryu // (Keep the cgmanifest.json commitHash in sync.) -// clang-format off +// clang-format off: avoid diverging from external code // vvvvvvvvvv DERIVED FROM common.h vvvvvvvvvv diff --git a/stl/inc/xcharconv_ryu_tables.h b/stl/inc/xcharconv_ryu_tables.h index cbda03e8b05..ad312ce2a0b 100644 --- a/stl/inc/xcharconv_ryu_tables.h +++ b/stl/inc/xcharconv_ryu_tables.h @@ -56,7 +56,7 @@ _STD_BEGIN // See xcharconv_ryu.h for the exact commit. // (Keep the cgmanifest.json commitHash in sync.) -// clang-format off +// clang-format off: avoid diverging from external code // vvvvvvvvvv DERIVED FROM digit_table.h vvvvvvvvvv diff --git a/stl/inc/xhash b/stl/inc/xhash index aa6e57fd686..4acd8622e13 100644 --- a/stl/inc/xhash +++ b/stl/inc/xhash @@ -268,8 +268,8 @@ struct _Hash_vec { } _NODISCARD size_type max_size() const noexcept { - return (_STD min)( - static_cast(_STD _Max_limit()), _Aliter_traits::max_size(_Mypair._Get_first())); + return (_STD min) (static_cast(_STD _Max_limit()), + _Aliter_traits::max_size(_Mypair._Get_first())); } _NODISCARD size_type capacity() const noexcept { @@ -916,13 +916,13 @@ public: } void max_load_factor(float _Newmax) noexcept /* strengthened */ { - _STL_ASSERT(!(_CSTD isnan)(_Newmax) && _Newmax > 0, "invalid hash load factor"); + _STL_ASSERT(!(_CSTD isnan) (_Newmax) && _Newmax > 0, "invalid hash load factor"); _Max_bucket_size() = _Newmax; } void rehash(size_type _Buckets) { // rebuild table with at least _Buckets buckets // don't violate a.bucket_count() >= a.size() / a.max_load_factor() invariant: - _Buckets = (_STD max)(_Min_load_factor_buckets(_List.size()), _Buckets); + _Buckets = (_STD max) (_Min_load_factor_buckets(_List.size()), _Buckets); if (_Buckets <= _Maxidx) { // we already have enough buckets; nothing to do return; } @@ -1704,7 +1704,7 @@ protected: _NODISCARD size_type _Desired_grow_bucket_count(const size_type _For_size) const noexcept { const size_type _Old_buckets = bucket_count(); - const size_type _Req_buckets = (_STD max)(_Min_buckets, _Min_load_factor_buckets(_For_size)); + const size_type _Req_buckets = (_STD max) (_Min_buckets, _Min_load_factor_buckets(_For_size)); if (_Old_buckets >= _Req_buckets) { // we already have enough buckets so there's no need to change the count return _Old_buckets; diff --git a/stl/inc/xlocale b/stl/inc/xlocale index ab5eda706e6..f5664e7ba5e 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -28,7 +28,6 @@ class _Locbase {}; // TRANSITION, ABI, affects sizeof(locale) _EXPORT_STD template class collate; -// clang-format off: clang-format 19 doesn't understand _CRTIMP2_PURE_IMPORT and will poorly format the following code extern "C++" struct _CRTIMP2_PURE_IMPORT _Crt_new_delete { // base class for marking allocations as CRT blocks #ifdef _DEBUG void* __CLRCALL_OR_CDECL operator new(size_t _Size) { // replace operator new @@ -59,7 +58,6 @@ extern "C++" struct _CRTIMP2_PURE_IMPORT _Crt_new_delete { // base class for mar void __CLRCALL_OR_CDECL operator delete(void*, void*) noexcept {} // imitate True Placement Delete #endif // _DEBUG }; -// clang-format on _EXPORT_STD extern "C++" class locale : public _Locbase, public _Crt_new_delete { public: @@ -798,8 +796,8 @@ protected: // return p - _First1, for the largest value p in [_First1, _Last1] such that [_First1, p) successfully // converts to at most _Count _Elems // assumes 1:1 conversion - const auto _Dist = static_cast((_STD min)(_Last1 - _First1, ptrdiff_t{INT_MAX})); - return static_cast((_STD min)(_Count, _Dist)); + const auto _Dist = static_cast((_STD min) (_Last1 - _First1, ptrdiff_t{INT_MAX})); + return static_cast((_STD min) (_Count, _Dist)); } }; @@ -841,7 +839,7 @@ _NODISCARD int _Codecvt_do_length( if (_Result != codecvt_base::ok) { if (_Result == codecvt_base::noconv) { - _First1 += (_STD min)(static_cast(_Last1 - _First1), _Count); + _First1 += (_STD min) (static_cast(_Last1 - _First1), _Count); } break; // error, noconv, or partial @@ -854,7 +852,7 @@ _NODISCARD int _Codecvt_do_length( _First1 = _Mid1; } - return static_cast((_STD min)(_First1 - _Old_first1, ptrdiff_t{INT_MAX})); + return static_cast((_STD min) (_First1 - _Old_first1, ptrdiff_t{INT_MAX})); } enum _Codecvt_mode { _Consume_header = 4, _Generate_header = 2 }; @@ -1673,7 +1671,7 @@ protected: _First1 = _Peek; } - return static_cast((_STD min)(_First1 - _Old_first1, ptrdiff_t{INT_MAX})); + return static_cast((_STD min) (_First1 - _Old_first1, ptrdiff_t{INT_MAX})); } bool __CLR_OR_THIS_CALL do_always_noconv() const noexcept override { @@ -1915,7 +1913,7 @@ protected: _First1 = _Peek; } - return static_cast((_STD min)(_First1 - _Old_first1, ptrdiff_t{INT_MAX})); + return static_cast((_STD min) (_First1 - _Old_first1, ptrdiff_t{INT_MAX})); } bool __CLR_OR_THIS_CALL do_always_noconv() const noexcept override { @@ -2111,7 +2109,7 @@ protected: _First1 += _Bytes; } - return static_cast((_STD min)(_First1 - _Old_first1, ptrdiff_t{INT_MAX})); + return static_cast((_STD min) (_First1 - _Old_first1, ptrdiff_t{INT_MAX})); } bool __CLR_OR_THIS_CALL do_always_noconv() const noexcept override { @@ -2312,7 +2310,7 @@ protected: _First1 += _Bytes; } - return static_cast((_STD min)(_First1 - _Old_first1, ptrdiff_t{INT_MAX})); + return static_cast((_STD min) (_First1 - _Old_first1, ptrdiff_t{INT_MAX})); } bool __CLR_OR_THIS_CALL do_always_noconv() const noexcept override { @@ -2356,8 +2354,8 @@ protected: _STL_DISABLE_DEPRECATED_WARNING template <> -class _CXX20_DEPRECATE_CODECVT_FACETS codecvt_byname - : public codecvt { +class _CXX20_DEPRECATE_CODECVT_FACETS + codecvt_byname : public codecvt { public: explicit __CLR_OR_THIS_CALL codecvt_byname(const char* _Locname, size_t _Refs = 0) : codecvt(_Locinfo(_Locname), _Refs) {} @@ -2370,8 +2368,8 @@ protected: }; template <> -class _CXX20_DEPRECATE_CODECVT_FACETS codecvt_byname - : public codecvt { +class _CXX20_DEPRECATE_CODECVT_FACETS + codecvt_byname : public codecvt { public: explicit __CLR_OR_THIS_CALL codecvt_byname(const char* _Locname, size_t _Refs = 0) : codecvt(_Locinfo(_Locname), _Refs) {} @@ -2385,8 +2383,8 @@ protected: #ifdef __cpp_char8_t template <> -class _CXX20_DEPRECATE_CODECVT_CHAR8_T_FACETS codecvt_byname - : public codecvt { +class _CXX20_DEPRECATE_CODECVT_CHAR8_T_FACETS + codecvt_byname : public codecvt { public: explicit __CLR_OR_THIS_CALL codecvt_byname(const char* _Locname, size_t _Refs = 0) : codecvt(_Locinfo(_Locname), _Refs) {} @@ -2399,8 +2397,8 @@ protected: }; template <> -class _CXX20_DEPRECATE_CODECVT_CHAR8_T_FACETS codecvt_byname - : public codecvt { +class _CXX20_DEPRECATE_CODECVT_CHAR8_T_FACETS + codecvt_byname : public codecvt { public: explicit __CLR_OR_THIS_CALL codecvt_byname(const char* _Locname, size_t _Refs = 0) : codecvt(_Locinfo(_Locname), _Refs) {} @@ -2884,8 +2882,8 @@ private: }; extern "C++" template <> -class _CRTIMP2_PURE_IMPORT ctype - : public ctype_base { // facet for classifying wchar_t elements, converting cases +class _CRTIMP2_PURE_IMPORT + ctype : public ctype_base { // facet for classifying wchar_t elements, converting cases public: using _Elem = wchar_t; using char_type = _Elem; @@ -3085,8 +3083,8 @@ private: #if defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS extern "C++" template <> -class _CRTIMP2_PURE_IMPORT ctype - : public ctype_base { // facet for classifying unsigned short elements, converting cases +class _CRTIMP2_PURE_IMPORT + ctype : public ctype_base { // facet for classifying unsigned short elements, converting cases public: using _Elem = unsigned short; using char_type = _Elem; diff --git a/stl/inc/xlocmon b/stl/inc/xlocmon index 0b584c21977..661991f766e 100644 --- a/stl/inc/xlocmon +++ b/stl/inc/xlocmon @@ -198,7 +198,7 @@ private: // international or bad parameters _Ptr = "$+xv"; } else { - // clang-format off + // clang-format off: preserve column/row/group structure of the string literal _Ptr = "+v$x" "+v$x" "v$+x" "v+$x" "v$+x" "+$vx" "+$vx" "$v+x" "+$vx" "$+vx" diff --git a/stl/inc/xlocnum b/stl/inc/xlocnum index ac526dbb0c7..fca7454e0b4 100644 --- a/stl/inc/xlocnum +++ b/stl/inc/xlocnum @@ -1067,7 +1067,7 @@ private: const ptrdiff_t _Exponent_part_preadjustment_round_up = _Parse_hex ? (_STD abs(_Exponent_part) - 1) / 4 + 1 : _STD abs(_Exponent_part); const ptrdiff_t _Exp_rep_adjustment = - (_STD min)(_Exponent_part_preadjustment_round_up, _STD abs(_Power_of_rep_base)); + (_STD min) (_Exponent_part_preadjustment_round_up, _STD abs(_Power_of_rep_base)); if (_Exponent_part >= 0) { _Exponent_part -= _Parse_hex ? _Exp_rep_adjustment * 4 : _Exp_rep_adjustment; @@ -1362,7 +1362,7 @@ protected: } _Buf.resize(_Bufsize + 50); // add fudge factor - const bool _Is_finite = (_STD isfinite)(_Val); + const bool _Is_finite = (_STD isfinite) (_Val); const auto _Adjusted_flags = // TRANSITION, DevCom-10519861 _Is_finite ? _Iosbase.flags() : _Iosbase.flags() & ~ios_base::showpoint; const auto _Ngen = static_cast(_CSTD sprintf_s( @@ -1389,7 +1389,7 @@ protected: } _Buf.resize(_Bufsize + 50); // add fudge factor - const bool _Is_finite = (_STD isfinite)(_Val); + const bool _Is_finite = (_STD isfinite) (_Val); const auto _Adjusted_flags = // TRANSITION, DevCom-10519861 _Is_finite ? _Iosbase.flags() : _Iosbase.flags() & ~ios_base::showpoint; const auto _Ngen = static_cast(_CSTD sprintf_s( diff --git a/stl/inc/xmemory b/stl/inc/xmemory index e4cfa3008b5..f1e86a66e1e 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -127,7 +127,7 @@ _NODISCARD constexpr size_t _Get_size_of_n(const size_t _Count) { } template -constexpr size_t _New_alignof = (_STD max)(alignof(_Ty), __STDCPP_DEFAULT_NEW_ALIGNMENT__); +constexpr size_t _New_alignof = (_STD max) (alignof(_Ty), __STDCPP_DEFAULT_NEW_ALIGNMENT__); #ifdef __clang__ // Clang and MSVC implement P0784R7 differently; see GH-1532 #define _CLANG_CONSTEXPR20 _CONSTEXPR20 @@ -244,7 +244,7 @@ __declspec(allocator) _CONSTEXPR20 void* _Allocate(const size_t _Bytes) { #if defined(_M_IX86) || defined(_M_X64) if (_Bytes >= _Big_allocation_threshold) { // boost the alignment of big allocations to help autovectorization - _Passed_align = (_STD max)(_Align, _Big_allocation_alignment); + _Passed_align = (_STD max) (_Align, _Big_allocation_alignment); } #endif // defined(_M_IX86) || defined(_M_X64) return _Traits::_Allocate_aligned(_Bytes, _Passed_align); @@ -277,7 +277,7 @@ _CONSTEXPR20 void _Deallocate(void* _Ptr, size_t _Bytes) noexcept { #if defined(_M_IX86) || defined(_M_X64) if (_Bytes >= _Big_allocation_threshold) { // boost the alignment of big allocations to help autovectorization - _Passed_align = (_STD max)(_Align, _Big_allocation_alignment); + _Passed_align = (_STD max) (_Align, _Big_allocation_alignment); } #endif // defined(_M_IX86) || defined(_M_X64) ::operator delete(_Ptr, _Bytes, align_val_t{_Passed_align}); @@ -929,8 +929,8 @@ constexpr size_t _Container_allocation_minimum_asan_alignment = alignof(typename template constexpr size_t _Container_allocation_minimum_asan_alignment<_Container, void_t> = - (_STD max)( - alignof(typename _Container::value_type), _Container::allocator_type::_Minimum_asan_allocation_alignment); + (_STD max) (alignof(typename _Container::value_type), + _Container::allocator_type::_Minimum_asan_allocation_alignment); _EXPORT_STD template class allocator { @@ -1782,7 +1782,7 @@ namespace ranges { const auto _ILast_ch = const_cast(reinterpret_cast(_ILastPtr)); const auto _OFirst_ch = const_cast(reinterpret_cast(_OFirstPtr)); const auto _OLast_ch = const_cast(reinterpret_cast(_OLastPtr)); - const auto _Count_bytes = static_cast((_STD min)(_ILast_ch - _IFirst_ch, _OLast_ch - _OFirst_ch)); + const auto _Count_bytes = static_cast((_STD min) (_ILast_ch - _IFirst_ch, _OLast_ch - _OFirst_ch)); _CSTD memcpy(_OFirst_ch, _IFirst_ch, _Count_bytes); if constexpr (is_pointer_v<_InIt>) { _IFirst = reinterpret_cast<_InIt>(_IFirst_ch + _Count_bytes); @@ -2770,8 +2770,7 @@ _NODISCARD _Elem* _UIntegral_to_buff(_Elem* _RNext, _UTy _UVal) { // used by bot auto _UVal_trunc = _UVal; #else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv - constexpr bool _Big_uty = sizeof(_UTy) > 4; - if constexpr (_Big_uty) { // For 64-bit numbers, work in chunks to avoid 64-bit divisions. + if constexpr (sizeof(_UTy) > 4) { // For 64-bit numbers, work in chunks to avoid 64-bit divisions. while (_UVal > 0xFFFFFFFFU) { auto _UVal_chunk = static_cast(_UVal % 1000000000); _UVal /= 1000000000; diff --git a/stl/inc/xstring b/stl/inc/xstring index 265ffc64a8e..a76ff0843b1 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -484,7 +484,7 @@ public: _NODISCARD _CONSTEXPR20 size_type _Clamp_suffix_size(const size_type _Off, const size_type _Size) const noexcept { // trims _Size to the longest it can be assuming a string at/after _Off - return (_STD min)(_Size, _Mysize - _Off); + return (_STD min) (_Size, _Mysize - _Off); } union _Bxty { // storage for small buffer or pointer to larger one @@ -2145,7 +2145,7 @@ public: return; } - size_type _Target_capacity = (_STD min)(_My_data._Mysize | _Alloc_mask, max_size()); + size_type _Target_capacity = (_STD min) (_My_data._Mysize | _Alloc_mask, max_size()); if (_Target_capacity < _My_data._Myres) { // worth shrinking, do it auto& _Al = _Getal(); const pointer _New_ptr = @@ -2284,8 +2284,8 @@ public: _NODISCARD _CONSTEXPR20 size_type max_size() const noexcept { const size_type _Alloc_max = _Alty_traits::max_size(_Getal()); const size_type _Storage_max = // can always store small string - (_STD max)(_Alloc_max, static_cast(_BUF_SIZE)); - return (_STD min)(static_cast(_STD _Max_limit()), + (_STD max) (_Alloc_max, static_cast(_BUF_SIZE)); + return (_STD min) (static_cast(_STD _Max_limit()), _Storage_max - 1 // -1 is for null terminator and/or npos ); } @@ -2895,7 +2895,7 @@ private: return _Max; } - return (_STD max)(_Masked, _Old + _Old / 2); + return (_STD max) (_Masked, _Old + _Old / 2); } _NODISCARD _CONSTEXPR20 size_type _Calculate_growth(const size_type _Requested) const noexcept { diff --git a/stl/inc/xtree b/stl/inc/xtree index 3b03dde8fbc..98b195a34ee 100644 --- a/stl/inc/xtree +++ b/stl/inc/xtree @@ -1221,8 +1221,8 @@ public: } _NODISCARD size_type max_size() const noexcept { - return (_STD min)( - static_cast(_STD _Max_limit()), _Alnode_traits::max_size(_Getal())); + return (_STD min) (static_cast(_STD _Max_limit()), // + _Alnode_traits::max_size(_Getal())); } _NODISCARD_EMPTY_MEMBER bool empty() const noexcept { diff --git a/stl/inc/xutility b/stl/inc/xutility index c262b62aaaa..9351e68c70e 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -860,11 +860,11 @@ namespace ranges { template concept _Has_ADL = _Has_class_or_enum_type<_Ty> && requires(_Ty&& __t) { - iter_move(static_cast<_Ty&&>(__t)); // intentional ADL + iter_move(static_cast<_Ty &&>(__t)); // intentional ADL }; template - concept _Can_deref = requires(_Ty&& __t) { *static_cast<_Ty&&>(__t); }; + concept _Can_deref = requires(_Ty&& __t) { *static_cast<_Ty &&>(__t); }; struct _Must_have_ADL_found_iter_move_or_be_dereferenceable {}; @@ -975,10 +975,10 @@ using iter_common_reference_t = common_reference_t, _Indir _EXPORT_STD template concept indirectly_writable = requires(_It&& __i, _Ty&& __t) { - *__i = static_cast<_Ty&&>(__t); - *static_cast<_It&&>(__i) = static_cast<_Ty&&>(__t); - const_cast&&>(*__i) = static_cast<_Ty&&>(__t); - const_cast&&>(*static_cast<_It&&>(__i)) = static_cast<_Ty&&>(__t); + *__i = static_cast<_Ty &&>(__t); + *static_cast<_It &&>(__i) = static_cast<_Ty &&>(__t); + const_cast &&>(*__i) = static_cast<_Ty &&>(__t); + const_cast &&>(*static_cast<_It &&>(__i)) = static_cast<_Ty &&>(__t); }; template @@ -1052,7 +1052,7 @@ concept input_iterator = input_or_output_iterator<_It> && indirectly_readable<_I _EXPORT_STD template concept output_iterator = input_or_output_iterator<_It> && indirectly_writable<_It, _Ty> - && requires(_It __i, _Ty&& __t) { *__i++ = static_cast<_Ty&&>(__t); }; + && requires(_It __i, _Ty&& __t) { *__i++ = static_cast<_Ty &&>(__t); }; _EXPORT_STD template concept forward_iterator = input_iterator<_It> && derived_from<_Iter_concept<_It>, forward_iterator_tag> @@ -1193,7 +1193,7 @@ namespace ranges { template concept _Has_ADL = (_Has_class_or_enum_type<_Ty1> || _Has_class_or_enum_type<_Ty2>) && requires(_Ty1&& __t1, _Ty2&& __t2) { - iter_swap(static_cast<_Ty1&&>(__t1), static_cast<_Ty2&&>(__t2)); // intentional ADL + iter_swap(static_cast<_Ty1 &&>(__t1), static_cast<_Ty2 &&>(__t2)); // intentional ADL }; template @@ -2994,7 +2994,7 @@ namespace ranges { template > _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(noexcept(_RANGES begin(static_cast<_CTy&&>(_Val)))) - requires requires { _RANGES begin(static_cast<_CTy&&>(_Val)); } + requires requires { _RANGES begin(static_cast<_CTy &&>(_Val)); } { return _RANGES begin(static_cast<_CTy&&>(_Val)); } @@ -3024,7 +3024,7 @@ namespace ranges { template > _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(noexcept(_RANGES end(static_cast<_CTy&&>(_Val)))) - requires requires { _RANGES end(static_cast<_CTy&&>(_Val)); } + requires requires { _RANGES end(static_cast<_CTy &&>(_Val)); } { return _RANGES end(static_cast<_CTy&&>(_Val)); } @@ -3194,7 +3194,7 @@ namespace ranges { template > _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(noexcept(_RANGES rbegin(static_cast<_CTy&&>(_Val)))) - requires requires { _RANGES rbegin(static_cast<_CTy&&>(_Val)); } + requires requires { _RANGES rbegin(static_cast<_CTy &&>(_Val)); } { return _RANGES rbegin(static_cast<_CTy&&>(_Val)); } @@ -3224,7 +3224,7 @@ namespace ranges { template > _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(noexcept(_RANGES rend(static_cast<_CTy&&>(_Val)))) - requires requires { _RANGES rend(static_cast<_CTy&&>(_Val)); } + requires requires { _RANGES rend(static_cast<_CTy &&>(_Val)); } { return _RANGES rend(static_cast<_CTy&&>(_Val)); } @@ -3451,7 +3451,7 @@ namespace ranges { template > _NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(noexcept(_RANGES data(static_cast<_CTy&&>(_Val)))) - requires requires { _RANGES data(static_cast<_CTy&&>(_Val)); } + requires requires { _RANGES data(static_cast<_CTy &&>(_Val)); } { return _RANGES data(static_cast<_CTy&&>(_Val)); } @@ -4550,7 +4550,7 @@ _NODISCARD _CONSTEXPR17 bool operator==(const move_iterator<_Iter1>& _Left, cons noexcept(noexcept(_STD _Fake_copy_init(_Left.base() == _Right.base()))) /* strengthened */ #if _HAS_CXX20 requires requires { - { _Left.base() == _Right.base() } -> _Implicitly_convertible_to; + { _Left.base() == _Right.base() }->_Implicitly_convertible_to; } #endif // _HAS_CXX20 { @@ -4570,7 +4570,7 @@ _NODISCARD _CONSTEXPR17 bool operator<(const move_iterator<_Iter1>& _Left, const noexcept(noexcept(_STD _Fake_copy_init(_Left.base() < _Right.base()))) /* strengthened */ #if _HAS_CXX20 requires requires { - { _Left.base() < _Right.base() } -> _Implicitly_convertible_to; + { _Left.base() < _Right.base() }->_Implicitly_convertible_to; } #endif // _HAS_CXX20 { @@ -4628,7 +4628,7 @@ _NODISCARD _CONSTEXPR17 move_iterator<_Iter> operator+( noexcept(noexcept(move_iterator<_Iter>(_Right.base() + _Off))) /* strengthened */ #if _HAS_CXX20 requires requires { - { _Right.base() + _Off } -> same_as<_Iter>; + { _Right.base() + _Off }->same_as<_Iter>; } #endif // _HAS_CXX20 { @@ -5961,7 +5961,7 @@ _NODISCARD _CONSTEXPR20 bool lexicographical_compare( { const auto _Num1 = static_cast(_ULast1 - _UFirst1); const auto _Num2 = static_cast(_ULast2 - _UFirst2); - const size_t _Num = (_STD min)(_Num1, _Num2); + const size_t _Num = (_STD min) (_Num1, _Num2); #if _USE_STD_VECTOR_ALGORITHMS const auto _First1_ptr = _STD _To_address(_UFirst1); const auto _First2_ptr = _STD _To_address(_UFirst2); @@ -6086,7 +6086,7 @@ _NODISCARD constexpr auto lexicographical_compare_three_way(const _InIt1 _First1 if (!_STD is_constant_evaluated()) { const auto _Num1 = static_cast(_ULast1 - _UFirst1); const auto _Num2 = static_cast(_ULast2 - _UFirst2); - const size_t _Num = (_STD min)(_Num1, _Num2); + const size_t _Num = (_STD min) (_Num1, _Num2); #if _USE_STD_VECTOR_ALGORITHMS const auto _First1_ptr = _STD to_address(_UFirst1); const auto _First2_ptr = _STD to_address(_UFirst2); @@ -7303,7 +7303,7 @@ _NODISCARD constexpr _Ty(max)(initializer_list<_Ty> _Ilist, _Pr _Pred) { _EXPORT_STD template _NODISCARD constexpr _Ty(max)(initializer_list<_Ty> _Ilist) { // return leftmost/largest - return (_STD max)(_Ilist, less<>{}); + return (_STD max) (_Ilist, less<>{}); } #if _HAS_CXX20 @@ -7527,7 +7527,7 @@ _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist, _Pr _Pred) { _EXPORT_STD template _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist) { // return leftmost/smallest - return (_STD min)(_Ilist, less<>{}); + return (_STD min) (_Ilist, less<>{}); } #if _HAS_CXX20 diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index d6f55304d10..445d9f71dc3 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -815,7 +815,7 @@ // warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed #ifndef _STL_DISABLED_WARNINGS -// clang-format off +// clang-format off: make macros readable #define _STL_DISABLED_WARNINGS \ 4180 4324 4412 4455 4494 4514 4574 4582 4583 4587 \ 4588 4619 4623 4625 4626 4643 4648 4702 4793 4820 \ @@ -839,7 +839,7 @@ // warning: unknown pragma ignored [-Wunknown-pragmas] #ifndef _STL_DISABLE_CLANG_WARNINGS #ifdef __clang__ -// clang-format off +// clang-format off: make macros readable #define _STL_DISABLE_CLANG_WARNINGS \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ @@ -869,7 +869,7 @@ // floating-point options [-Wnan-infinity-disabled] #ifndef _STL_DISABLE_CLANG_WARNING_NAN_INF_DISABLED #ifdef __clang__ -// clang-format off +// clang-format off: make macros readable #define _STL_DISABLE_CLANG_WARNING_NAN_INF_DISABLED \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wnan-infinity-disabled\"") @@ -887,7 +887,7 @@ #endif // ^^^ !defined(__clang__) ^^^ #endif // !defined(_STL_RESTORE_CLANG_WARNING_NAN_INF_DISABLED) -// clang-format off +// clang-format off: make macros readable #ifndef _STL_DISABLE_DEPRECATED_WARNING #ifdef __clang__ #define _STL_DISABLE_DEPRECATED_WARNING \ @@ -921,12 +921,12 @@ _EMIT_STL_ERROR(STL1002, "Unexpected compiler version, expected CUDA 12.4 or new #elif defined(__EDG__) // not attempting to detect __EDG_VERSION__ being less than expected #elif defined(__clang__) -#if __clang_major__ < 19 -_EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 19.0.0 or newer."); +#if __clang_major__ < 20 +_EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 20 or newer."); #endif // ^^^ old Clang ^^^ #elif defined(_MSC_VER) -#if _MSC_VER < 1944 // Coarse-grained, not inspecting _MSC_FULL_VER -_EMIT_STL_ERROR(STL1001, "Unexpected compiler version, expected MSVC 19.44 or newer."); +#if _MSC_VER < 1950 // Coarse-grained, not inspecting _MSC_FULL_VER +_EMIT_STL_ERROR(STL1001, "Unexpected compiler version, expected MSVC Compiler 19.50 or newer."); #endif // ^^^ old MSVC ^^^ #else // vvv other compilers vvv // not attempting to detect other compilers diff --git a/stl/src/excptptr.cpp b/stl/src/excptptr.cpp index 46cafd13e97..c94180de2ce 100644 --- a/stl/src/excptptr.cpp +++ b/stl/src/excptptr.cpp @@ -131,7 +131,7 @@ namespace { // copy the number of parameters in use constexpr auto _Max_parameters = static_cast(EXCEPTION_MAXIMUM_PARAMETERS); - const auto _In_use = (_STD min)(_Parameters, _Max_parameters); + const auto _In_use = (_STD min) (_Parameters, _Max_parameters); _CSTD memcpy(_Dest.ExceptionInformation, _Src.ExceptionInformation, _In_use * sizeof(ULONG_PTR)); _CSTD memset(&_Dest.ExceptionInformation[_In_use], 0, (_Max_parameters - _In_use) * sizeof(ULONG_PTR)); } diff --git a/stl/src/vector_algorithms.cpp b/stl/src/vector_algorithms.cpp index 475900b762d..67d008a1c99 100644 --- a/stl/src/vector_algorithms.cpp +++ b/stl/src/vector_algorithms.cpp @@ -252,49 +252,6 @@ namespace { } } - - // TRANSITION, GH-5506 "VCRuntime: memmove() is surprisingly slow for more than 8 KB on certain CPUs": - // As a workaround, the following code calls memmove() for 8 KB portions. - constexpr size_t _Portion_size = 8192; - constexpr size_t _Portion_mask = _Portion_size - 1; - static_assert((_Portion_size & _Portion_mask) == 0); - - void _Move_to_lower_address(void* _Dest, const void* _Src, const size_t _Size) noexcept { - const size_t _Whole_portions_size = _Size & ~_Portion_mask; - - void* _Dest_end = _Dest; - _Advance_bytes(_Dest_end, _Whole_portions_size); - - while (_Dest != _Dest_end) { - memmove(_Dest, _Src, _Portion_size); - _Advance_bytes(_Dest, _Portion_size); - _Advance_bytes(_Src, _Portion_size); - } - - if (const size_t _Tail = _Size - _Whole_portions_size; _Tail != 0) { - memmove(_Dest, _Src, _Tail); - } - } - - void _Move_to_higher_address(void* const _Dest, const void* const _Src, const size_t _Size) noexcept { - const size_t _Whole_portions_size = _Size & ~_Portion_mask; - - void* _Dest_end = _Dest; - _Advance_bytes(_Dest_end, _Whole_portions_size); - const void* _Src_end = _Src; - _Advance_bytes(_Src_end, _Whole_portions_size); - - if (const size_t _Tail = _Size - _Whole_portions_size; _Tail != 0) { - memmove(_Dest_end, _Src_end, _Tail); - } - - while (_Dest_end != _Dest) { - _Rewind_bytes(_Dest_end, _Portion_size); - _Rewind_bytes(_Src_end, _Portion_size); - memmove(_Dest_end, _Src_end, _Portion_size); - } - } - constexpr size_t _Buf_size = 512; bool _Use_buffer(const size_t _Smaller, const size_t _Larger) noexcept { @@ -319,7 +276,7 @@ __declspec(noalias) void __stdcall __std_rotate(void* _First, void* const _Mid, if (_Rotating::_Use_buffer(_Left, _Right)) { memcpy(_Buf, _First, _Left); - _Rotating::_Move_to_lower_address(_First, _Mid, _Right); + memmove(_First, _Mid, _Right); _Advance_bytes(_First, _Right); memcpy(_First, _Buf, _Left); break; @@ -346,7 +303,7 @@ __declspec(noalias) void __stdcall __std_rotate(void* _First, void* const _Mid, memcpy(_Buf, _Last, _Right); void* _Mid2 = _First; _Advance_bytes(_Mid2, _Right); - _Rotating::_Move_to_higher_address(_Mid2, _First, _Left); + memmove(_Mid2, _First, _Left); memcpy(_First, _Buf, _Right); break; } diff --git a/stl/src/xcharconv_ryu_tables.cpp b/stl/src/xcharconv_ryu_tables.cpp index 1a3e411e742..a9a7d6f5069 100644 --- a/stl/src/xcharconv_ryu_tables.cpp +++ b/stl/src/xcharconv_ryu_tables.cpp @@ -34,7 +34,7 @@ namespace std { - // clang-format off + // clang-format off: avoid diverging from external code // vvvvvvvvvv DERIVED FROM d2s_full_table.h vvvvvvvvvv diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 159635d7bb8..5eff18c8162 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -51,6 +51,16 @@ std/strings/basic.string/string.modifiers/string_append/initializer_list.pass.cp std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp:0 FAIL std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp:1 FAIL +# LLVM-158302: Clang 20 i686-pc-windows-msvc regression, silent bad codegen for std::current_exception() +# SKIPPED because this is x86-specific. +std/language.support/support.exception/except.nested/assign.pass.cpp:2 SKIPPED +std/language.support/support.exception/except.nested/ctor_copy.pass.cpp:2 SKIPPED +std/language.support/support.exception/except.nested/ctor_default.pass.cpp:2 SKIPPED + +# LLVM-158341: Coroutines on arm64ec-pc-windows-msvc emit error LNK2001: unresolved external symbol #__NoopCoro_ResumeDestroy (EC Symbol) +# SKIPPED because this is ARM64EC-specific. +std/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp:2 SKIPPED + # Non-Standard regex behavior. # "It seems likely that the test is still non-conforming due to how libc++ handles the 'w' character class." std/re/re.traits/lookup_classname.pass.cpp FAIL @@ -634,16 +644,6 @@ std/algorithms/robust_re_difference_type.compile.pass.cpp:1 FAIL # Note: The :1 (ASan) configuration doesn't run static analysis. std/language.support/support.coroutines/end.to.end/go.pass.cpp:0 FAIL -# DevCom-1638496 VSO-1462745: C1XX doesn't properly reject int <=> unsigned -std/language.support/cmp/cmp.concept/three_way_comparable_with.compile.pass.cpp:0 FAIL -std/language.support/cmp/cmp.concept/three_way_comparable_with.compile.pass.cpp:1 FAIL -std/language.support/cmp/cmp.result/compare_three_way_result.compile.pass.cpp:0 FAIL -std/language.support/cmp/cmp.result/compare_three_way_result.compile.pass.cpp:1 FAIL - -# VSO-1513409: Bogus `warning C4100: '<_Args_0>': unreferenced formal parameter` when `if constexpr` selects another branch -std/containers/views/mdspan/mdspan/ctor.dh_integers.pass.cpp:0 FAIL -std/containers/views/mdspan/mdspan/ctor.dh_integers.pass.cpp:1 FAIL - # DevCom-10026599 VSO-1532879: conditional expression has two different types std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp:0 FAIL std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp:1 FAIL @@ -656,18 +656,6 @@ std/containers/sequences/array/array.cons/initialization.pass.cpp:1 FAIL std/algorithms/robust_against_adl.compile.pass.cpp:0 FAIL std/algorithms/robust_against_adl.compile.pass.cpp:1 FAIL -# VSO-1923988: constexpr evaluation performs an assignment with a derived type when it should use a base type -std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp:0 FAIL -std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp:1 FAIL -std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp:0 FAIL -std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp:1 FAIL -std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp:0 FAIL -std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp:1 FAIL -std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp:0 FAIL -std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp:1 FAIL -std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp:0 FAIL -std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp:1 FAIL - # VSO-1948221 x86chk ICE with constexpr type_info: Assertion failed: isIndirection() std/language.support/support.rtti/type.info/type_info.equal.pass.cpp:0 FAIL std/language.support/support.rtti/type.info/type_info.equal.pass.cpp:1 FAIL @@ -712,6 +700,34 @@ std/algorithms/alg.modifying.operations/alg.move/ranges.move_backward.segmented. std/algorithms/alg.modifying.operations/alg.move/ranges.move.segmented.pass.cpp:0 FAIL std/algorithms/alg.modifying.operations/alg.move/ranges.move.segmented.pass.cpp:1 FAIL +# VSO-2574451 constexpr error with designated initializers: failure was caused by a read of a variable outside its lifetime +std/ranges/range.adaptors/range.join.with/range.join.with.iterator/types.compile.pass.cpp:0 FAIL +std/ranges/range.adaptors/range.join.with/range.join.with.iterator/types.compile.pass.cpp:1 FAIL +std/ranges/range.adaptors/range.join.with/range.join.with.view/begin.pass.cpp:0 FAIL +std/ranges/range.adaptors/range.join.with/range.join.with.view/begin.pass.cpp:1 FAIL + +# VSO-2574465 constexpr error with a static_assert accessing a local variable: failure was caused by a read of a variable outside its lifetime +std/containers/views/mdspan/mdspan/index_operator.pass.cpp:0 FAIL +std/containers/views/mdspan/mdspan/index_operator.pass.cpp:1 FAIL + +# VSO-2574469 constexpr error in unique_ptr with a reference-to-function deleter: failure was caused by a read of an uninitialized symbol +std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.pass.cpp:0 FAIL +std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.pass.cpp:1 FAIL + +# VSO-2574473 constexpr error in ranges::join_with_view: failure was caused by unevaluable pointer value +std/ranges/range.adaptors/range.join.with/range.join.with.iterator/ctor.not_const.pass.cpp:0 FAIL +std/ranges/range.adaptors/range.join.with/range.join.with.iterator/ctor.not_const.pass.cpp:1 FAIL + +# VSO-2574489 constexpr ICE-on-valid with vector +std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp:0 FAIL +std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp:1 FAIL +std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp:0 FAIL +std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp:1 FAIL +std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp:0 FAIL +std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp:1 FAIL +std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp:0 FAIL +std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp:1 FAIL + # *** CLANG COMPILER BUGS *** # LLVM-46207 Clang's tgmath.h interferes with the UCRT's tgmath.h @@ -1290,50 +1306,6 @@ std/time/time.syn/formatter.tai_time.pass.cpp:2 FAIL std/time/time.syn/formatter.utc_time.pass.cpp:2 FAIL std/time/time.syn/formatter.zoned_time.pass.cpp:2 FAIL -# Not analyzed. constexpr evaluation fails with note: failure was caused by out of range index MEOW; allowed range is 0 <= index < 2 -std/ranges/range.adaptors/range.join/adaptor.pass.cpp:0 FAIL -std/ranges/range.adaptors/range.join/adaptor.pass.cpp:1 FAIL -std/ranges/range.adaptors/range.join/range.join.iterator/increment.pass.cpp:0 FAIL -std/ranges/range.adaptors/range.join/range.join.iterator/increment.pass.cpp:1 FAIL - -# Not analyzed. constexpr evaluation fails in assert(*--iter == i). -std/ranges/range.adaptors/range.join/range.join.iterator/decrement.pass.cpp:0 FAIL -std/ranges/range.adaptors/range.join/range.join.iterator/decrement.pass.cpp:1 FAIL - -# Not analyzed. constexpr evaluation fails in assert(*iter++ == i). -std/ranges/range.adaptors/range.join/range.join.iterator/star.pass.cpp:0 FAIL -std/ranges/range.adaptors/range.join/range.join.iterator/star.pass.cpp:1 FAIL - -# Not analyzed. constexpr evaluation fails in ranges::swap. -std/ranges/range.adaptors/range.join/range.join.iterator/iter.swap.pass.cpp:0 FAIL -std/ranges/range.adaptors/range.join/range.join.iterator/iter.swap.pass.cpp:1 FAIL - -# Not analyzed. Likely MSVC constexpr bug, "note: failure was caused by a read of a variable outside its lifetime" -std/containers/views/mdspan/mdspan/index_operator.pass.cpp:0 FAIL -std/containers/views/mdspan/mdspan/index_operator.pass.cpp:1 FAIL -std/ranges/range.adaptors/range.join.with/range.join.with.iterator/types.compile.pass.cpp:0 FAIL -std/ranges/range.adaptors/range.join.with/range.join.with.iterator/types.compile.pass.cpp:1 FAIL -std/ranges/range.adaptors/range.join.with/range.join.with.view/begin.pass.cpp:0 FAIL -std/ranges/range.adaptors/range.join.with/range.join.with.view/begin.pass.cpp:1 FAIL - -# Not analyzed. Likely MSVC constexpr bug, "note: failure was caused by a read of an uninitialized symbol" -std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.pass.cpp:0 FAIL -std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.pass.cpp:1 FAIL - -# Not analyzed. Likely MSVC constexpr bug, "note: failure was caused by unevaluable pointer value" -std/ranges/range.adaptors/range.join.with/range.join.with.iterator/ctor.not_const.pass.cpp:0 FAIL -std/ranges/range.adaptors/range.join.with/range.join.with.iterator/ctor.not_const.pass.cpp:1 FAIL - -# Not analyzed. Likely MSVC constexpr bug, "note: a non-constant (sub-)expression was encountered" in swap() -std/utilities/utility/utility.swap/swap_array.pass.cpp:0 FAIL -std/utilities/utility/utility.swap/swap_array.pass.cpp:1 FAIL - -# Not analyzed. MSVC constexpr ICE. -std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp:0 FAIL -std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp:1 FAIL -std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp:0 FAIL -std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp:1 FAIL - # Not analyzed. Possible Clang constexpr bug involving the test's sized_allocator and our check for transposed ranges. std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp:2 FAIL @@ -1547,6 +1519,12 @@ std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp # Clang asserts `allocated_ == 0 || allocated_ >= i` due to the container proxy object. std/strings/basic.string/string.capacity/deallocate_size.pass.cpp FAIL +# Not analyzed. MSVC emits warning C4267: 'argument': conversion from 'size_t' to 'unsigned char', possible loss of data +std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp:0 FAIL +std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp:1 FAIL +std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp:0 FAIL +std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp:1 FAIL + # *** XFAILS WHICH PASS *** # These tests contain `// XFAIL: msvc` comments, which accurately describe runtime failures for x86 and x64. diff --git a/tests/std/include/test_mdspan_support.hpp b/tests/std/include/test_mdspan_support.hpp index e9706697bed..81c638df713 100644 --- a/tests/std/include/test_mdspan_support.hpp +++ b/tests/std/include/test_mdspan_support.hpp @@ -201,7 +201,7 @@ namespace detail { template constexpr void check_members_with_mixed_extents(Fn&& fn) { auto select_extent = [](size_t e) consteval { - return e == std::dynamic_extent ? (std::min)(sizeof...(Extents), size_t{3}) : e; + return e == std::dynamic_extent ? (std::min) (sizeof...(Extents), size_t{3}) : e; }; // Check signed integers @@ -222,7 +222,7 @@ namespace detail { template constexpr void check_members_with_various_extents_impl(Fn&& fn, std::index_sequence) { auto static_or_dynamic = [](size_t i) consteval { - return i == 0 ? std::dynamic_extent : (std::min)(sizeof...(Seq), size_t{3}); + return i == 0 ? std::dynamic_extent : (std::min) (sizeof...(Seq), size_t{3}); }; if constexpr (sizeof...(Seq) <= 1) { diff --git a/tests/std/tests/Dev11_0272959_make_signed/test.compile.pass.cpp b/tests/std/tests/Dev11_0272959_make_signed/test.compile.pass.cpp index f3a875cb40f..f8c720eaf7f 100644 --- a/tests/std/tests/Dev11_0272959_make_signed/test.compile.pass.cpp +++ b/tests/std/tests/Dev11_0272959_make_signed/test.compile.pass.cpp @@ -218,6 +218,6 @@ void example() { STATIC_ASSERT(is_assignable_v); STATIC_ASSERT(is_assignable_v); - STATIC_ASSERT(is_assignable_v); + STATIC_ASSERT(is_assignable_v); STATIC_ASSERT(!is_assignable_v); } diff --git a/tests/std/tests/Dev11_0437519_container_requirements/test.compile.pass.cpp b/tests/std/tests/Dev11_0437519_container_requirements/test.compile.pass.cpp index 97ba3180c29..4cfa84a262e 100644 --- a/tests/std/tests/Dev11_0437519_container_requirements/test.compile.pass.cpp +++ b/tests/std/tests/Dev11_0437519_container_requirements/test.compile.pass.cpp @@ -322,7 +322,7 @@ struct emplace_argument { emplace_argument(key) {} }; -// clang-format off +// clang-format off: make macros readable #define DEFINE_TYPE(name, dtor, def_ctor, copy_ctor, move_ctor, emp_ctor, copy_assign, move_assign, emp_assign) \ class name { \ @@ -573,39 +573,37 @@ struct container_traits : unordered_set_associative_container // // -// clang-format off - #ifdef __clang__ - #pragma clang diagnostic ignored "-Wunused-local-typedef" +#pragma clang diagnostic ignored "-Wunused-local-typedef" #endif // __clang__ -#define GENERATE_CONTAINER_TYPEDEFS(name, opt_typename) \ - typedef opt_typename Traits::template bind_container::type c_of_ ## name; \ - typedef opt_typename Traits::template bind_value ::type v_of_ ## name; +#define GENERATE_CONTAINER_TYPEDEFS(opt_typename, name) \ + typedef opt_typename Traits::template bind_container::type c_of_##name; \ + typedef opt_typename Traits::template bind_value::type v_of_##name; #define GENERATE_ALL_CONTAINER_TYPEDEFS(unused, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(erasable, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(default_constructible, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(copy_insertable, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(move_insertable, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(emplace_constructible, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(copy_assignable, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(move_assignable, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(equality_comparable, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(less_comparable, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(ca_ci, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(ci_ma, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(dc_mi, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(ec_ma_mi, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(ec_mi, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(ma_mi, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(ec_ea, opt_typename) \ - GENERATE_CONTAINER_TYPEDEFS(ec_ea_mi, opt_typename) + GENERATE_CONTAINER_TYPEDEFS(opt_typename, erasable) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, default_constructible) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, copy_insertable) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, move_insertable) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, emplace_constructible) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, copy_assignable) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, move_assignable) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, equality_comparable) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, less_comparable) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, ca_ci) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, ci_ma) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, dc_mi) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, ec_ma_mi) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, ec_mi) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, ma_mi) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, ec_ea) \ + GENERATE_CONTAINER_TYPEDEFS(opt_typename, ec_ea_mi) #define DEFINE_TEST_IMPL(name, opt_typename, template_parameters, specialization, preface_text, ...) \ template \ struct name specialization { \ - preface_text \ + preface_text; \ typedef container_traits Traits; \ \ name() { \ @@ -614,32 +612,17 @@ struct container_traits : unordered_set_associative_container } \ } -#define DEFINE_TEST(name, ...) \ - DEFINE_TEST_IMPL( \ - /* name */ name, \ - /* opt_typename */ typename, \ - /* template_parameters */ container_tag Tag, \ - /* specialization */ /* empty */, \ - /* preface_text */ /* empty */, \ - /* ... */ __VA_ARGS__) - -#define DEFINE_TEST_SPECIALIZATION(name, specialized_tag, ...) \ - DEFINE_TEST_IMPL( \ - /* name */ name, \ - /* opt_typename */ /* empty */, \ - /* template_parameters */ /* empty */, \ - /* specialization */ , \ - /* preface_text */ static container_tag const Tag = specialized_tag;, \ - /* ... */ __VA_ARGS__) +#define DEFINE_TEST(name, ...) \ + DEFINE_TEST_IMPL(name, typename, container_tag Tag, /* empty */, /* empty */, __VA_ARGS__) + +#define DEFINE_TEST_SPECIALIZATION(name, my_tag, ...) \ + DEFINE_TEST_IMPL(name, /* empty */, /* empty */, , static container_tag const Tag = my_tag;, __VA_ARGS__) // These macros prevent the test named 'name' from being run for the container specified by the // 'specialized_tag'. The NOT_SUPPORTED_SPECIALIZATION macro should be used for tests that do not // pass because the container is specified as not supporting the operation being tested. -#define NOT_SUPPORTED_SPECIALIZATION(name, specialized_tag) \ - DEFINE_TEST_SPECIALIZATION(name, specialized_tag, { }) - -// clang-format on +#define NOT_SUPPORTED_SPECIALIZATION(name, specialized_tag) DEFINE_TEST_SPECIALIZATION(name, specialized_tag, {}) // diff --git a/tests/std/tests/GH_000178_uniform_int/test.cpp b/tests/std/tests/GH_000178_uniform_int/test.cpp index 4375a4e0949..1bc76e03348 100644 --- a/tests/std/tests/GH_000178_uniform_int/test.cpp +++ b/tests/std/tests/GH_000178_uniform_int/test.cpp @@ -69,7 +69,7 @@ int main() { // (2) URBG provides enough bits for our upper bound, but not enough to fill the type // (3) URBG is called multiple times, but doesn't fill the type // (4) URBG is called multiple times and overflows the number of bits in the type - assert((basic_test())); + assert(basic_test()); assert((basic_test>())); assert((basic_test>())); assert((basic_test>())); diff --git a/tests/std/tests/GH_000625_vector_bool_optimization/test.cpp b/tests/std/tests/GH_000625_vector_bool_optimization/test.cpp index 79e4a7a127d..c16091f24c2 100644 --- a/tests/std/tests/GH_000625_vector_bool_optimization/test.cpp +++ b/tests/std/tests/GH_000625_vector_bool_optimization/test.cpp @@ -20,26 +20,24 @@ constexpr int blockSize = 32; static_assert(blockSize == _VBITS, "Invalid block size"); // This test data is not random, but irregular enough to ensure confidence in the tests -// clang-format off -const vector source = { true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false - }; -// clang-format on +const vector source = { // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false}; void test_fill_helper(const size_t length) { @@ -263,46 +261,48 @@ void test_huge_vector_bool() { void test_copy_no_offset(const size_t length) { vector result; - // clang-format off switch (length) { case 3: - result = { true, false, true }; + result = {true, false, true}; break; case 8: - result = { true, false, true, false, true, true, true, false }; + result = {true, false, true, false, true, true, true, false}; break; case 22: - result = { true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true }; + result = {// + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true}; break; case 31: - result = { true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true }; + result = {// + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true}; break; case 32: - result = { true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false }; + result = {// + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false}; break; case 67: - result = { true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true }; + result = {// + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true}; break; default: assert(false); } - // clang-format on { vector dest(length, false); @@ -343,48 +343,51 @@ void test_copy_no_offset(const size_t length) { void test_copy_offset_source(const size_t length) { vector result; - // clang-format off switch (length) { case 3: - result = { false, true, false}; + result = {/***/ false, true, false}; break; case 8: - result = { false, true, false, true, true, true, false, - true }; + result = {// + /***/ false, true, false, true, true, true, false, // + true}; break; case 22: - result = { false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true }; + result = {// + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true}; break; case 31: - result = { false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false }; + result = {// + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false}; break; case 32: - result = { false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true}; + result = {// + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true}; break; case 67: - result = { false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false }; + result = {// + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false}; break; default: assert(false); } - // clang-format on { vector dest(length, false); @@ -426,52 +429,56 @@ void test_copy_offset_source(const size_t length) { void test_copy_offset_dest(const size_t length) { vector result; - // clang-format off switch (length) { case 3: - result = { false, - true, false, true }; + result = {// + false, // + true, false, true}; break; case 8: - result = { false, - true, false, true, false, true, true, true, false }; + result = {// + false, // + true, false, true, false, true, true, true, false}; break; case 22: - result = { false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true }; + result = {// + false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true}; break; case 31: - result = { false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true }; + result = {// + false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true}; break; case 32: - result = { false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false }; + result = {// + false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false}; break; case 67: - result = { false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true }; + result = {// + false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true}; break; default: assert(false); } - // clang-format on { vector dest(length + 1, false); @@ -512,52 +519,56 @@ void test_copy_offset_dest(const size_t length) { void test_copy_offset_match(const size_t length) { vector result; - // clang-format off switch (length) { case 3: - result = { false, - false, true }; + result = {// + false, // + /***/ false, true}; break; case 8: - result = { false, - false, true, false, true, true, true, false }; + result = {// + false, // + /***/ false, true, false, true, true, true, false}; break; case 22: - result = { false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true }; + result = {// + false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true}; break; case 31: - result = { false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true }; + result = {// + false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true}; break; case 32: - result = { false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false }; + result = {// + false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false}; break; case 67: - result = { false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true }; + result = {// + false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true}; break; default: assert(false); } - // clang-format on { vector dest(length, false); @@ -599,52 +610,56 @@ void test_copy_offset_match(const size_t length) { void test_copy_offset_mismatch_leftshift(const size_t length) { vector result; - // clang-format off switch (length) { case 3: - result = { false, false, - false, true }; + result = {// + false, false, // + /***/ false, true}; break; case 8: - result = { false, false, - false, true, false, true, true, true, false }; + result = {// + false, false, // + /***/ false, true, false, true, true, true, false}; break; case 22: - result = { false, false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true }; + result = {// + false, false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true}; break; case 31: - result = { false, false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true }; + result = {// + false, false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true}; break; case 32: - result = { false, false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false }; + result = {// + false, false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false}; break; case 67: - result = { false, false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true }; + result = {// + false, false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true}; break; default: assert(false); } - // clang-format on { vector dest(length + 1, false); @@ -686,54 +701,58 @@ void test_copy_offset_mismatch_leftshift(const size_t length) { void test_copy_offset_mismatch_rightshift(const size_t length) { vector result; - // clang-format off switch (length) { case 3: - result = { false, - true, false }; + result = {// + false, // + /**********/ true, false}; break; case 8: - result = { false, - true, false, true, true, true, false, - true }; + result = {// + false, // + /**********/ true, false, true, true, true, false, // + true}; break; case 22: - result = { false, - true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true }; + result = {// + false, // + /**********/ true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true}; break; case 31: - result = { false, - true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false }; + result = {// + false, // + /**********/ true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false}; break; case 32: - result = { false, - true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true }; + result = {// + false, // + /**********/ true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true}; break; case 67: - result = { false, - true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false }; + result = {// + false, // + /**********/ true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false}; break; default: assert(false); } - // clang-format on { vector dest(length, false); @@ -775,52 +794,56 @@ void test_copy_offset_mismatch_rightshift(const size_t length) { void test_copy_offset_aligned(const size_t length) { vector result; - // clang-format off switch (length) { case 3: - result = { false, - false, true }; + result = {// + false, // + /***/ false, true}; break; case 8: - result = { false, - false, true, false, true, true, true, false }; + result = {// + false, // + /***/ false, true, false, true, true, true, false}; break; case 22: - result = { false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true }; + result = {// + false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true}; break; case 31: - result = { false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true }; + result = {// + false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true}; break; case 32: - result = { false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false }; + result = {// + false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false}; break; case 67: - result = { false, - false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true, false, true, true, true, false, - true, false, true }; + result = {// + false, // + /***/ false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true, false, true, true, true, false, // + true, false, true}; break; default: assert(false); } - // clang-format on { vector dest(length, false); diff --git a/tests/std/tests/GH_000639_nvcc_include_all/env.lst b/tests/std/tests/GH_000639_nvcc_include_all/env.lst index d2f0a5adb98..b58d105f344 100644 --- a/tests/std/tests/GH_000639_nvcc_include_all/env.lst +++ b/tests/std/tests/GH_000639_nvcc_include_all/env.lst @@ -1,7 +1,8 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -PM_COMPILER="nvcc" PM_CL="--x cu -Xcompiler -Od,-EHsc,-nologo,-W4,-WX,-openmp" +# TRANSITION, CUDA 12.4 rejected MSVC Compiler 19.50 as unsupported, so we need --allow-unsupported-compiler +PM_COMPILER="nvcc" PM_CL="--x cu -Xcompiler -Od,-EHsc,-nologo,-W4,-WX,-openmp --allow-unsupported-compiler" RUNALL_CROSSLIST PM_CL="-Xcompiler -MT" PM_CL="--debug -Xcompiler -MTd" diff --git a/tests/std/tests/GH_001541_case_sensitive_boolalpha/test.cpp b/tests/std/tests/GH_001541_case_sensitive_boolalpha/test.cpp index 42cdbdc11d5..e23498bba14 100644 --- a/tests/std/tests/GH_001541_case_sensitive_boolalpha/test.cpp +++ b/tests/std/tests/GH_001541_case_sensitive_boolalpha/test.cpp @@ -15,19 +15,17 @@ struct TestCase { bool result; }; -// clang-format off constexpr TestCase test_cases[] = { - {"0", ios_base::fmtflags{}, Parse::Success, false}, - {"1", ios_base::fmtflags{}, Parse::Success, true }, - {"2", ios_base::fmtflags{}, Parse::Failure, true }, // N4868 [facet.num.get.virtuals]/6 - {"WOOF", ios_base::fmtflags{}, Parse::Failure, false}, // N4868 [facet.num.get.virtuals]/3.6 - {"false", ios_base::boolalpha, Parse::Success, false}, - {"true", ios_base::boolalpha, Parse::Success, true }, - {"WOOF", ios_base::boolalpha, Parse::Failure, false}, // N4868 [facet.num.get.virtuals]/7 - {"FALSE", ios_base::boolalpha, Parse::Failure, false}, // GH-1541 - {"TRUE", ios_base::boolalpha, Parse::Failure, false}, // GH-1541 + {"0", ios_base::fmtflags{}, Parse::Success, false}, // + {"1", ios_base::fmtflags{}, Parse::Success, true}, // + {"2", ios_base::fmtflags{}, Parse::Failure, true}, // N4868 [facet.num.get.virtuals]/6 + {"WOOF", ios_base::fmtflags{}, Parse::Failure, false}, // N4868 [facet.num.get.virtuals]/3.6 + {"false", ios_base::boolalpha, Parse::Success, false}, // + {"true", ios_base::boolalpha, Parse::Success, true}, // + {"WOOF", ios_base::boolalpha, Parse::Failure, false}, // N4868 [facet.num.get.virtuals]/7 + {"FALSE", ios_base::boolalpha, Parse::Failure, false}, // GH-1541 + {"TRUE", ios_base::boolalpha, Parse::Failure, false}, // GH-1541 }; -// clang-format on int main() { for (const auto& test : test_cases) { diff --git a/tests/std/tests/P0019R8_atomic_ref/test.cpp b/tests/std/tests/P0019R8_atomic_ref/test.cpp index ad351d42b23..25c02826768 100644 --- a/tests/std/tests/P0019R8_atomic_ref/test.cpp +++ b/tests/std/tests/P0019R8_atomic_ref/test.cpp @@ -45,7 +45,9 @@ void test_atomic_ref_constraints_single() { // COMPILE-ONLY static_assert(std::is_same_v); static_assert(requires(const AR& r, TD v, std::memory_order ord) { +#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-2574432 r.operator TD(); +#endif // ^^^ no workaround ^^^ { r.load() } -> std::same_as; { r.load(ord) } -> std::same_as; { r.wait(v) } -> std::same_as; diff --git a/tests/std/tests/P0088R3_variant/test.cpp b/tests/std/tests/P0088R3_variant/test.cpp index 5c44ad66c12..8a5beedb993 100644 --- a/tests/std/tests/P0088R3_variant/test.cpp +++ b/tests/std/tests/P0088R3_variant/test.cpp @@ -38,7 +38,7 @@ #include -// clang-format off +// clang-format off: avoid diverging from external code // LLVM SOURCES BEGIN // -- BEGIN: test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp //===----------------------------------------------------------------------===// diff --git a/tests/std/tests/P0122R7_span/test.cpp b/tests/std/tests/P0122R7_span/test.cpp index 276e1b3d455..939a832d954 100644 --- a/tests/std/tests/P0122R7_span/test.cpp +++ b/tests/std/tests/P0122R7_span/test.cpp @@ -449,35 +449,35 @@ constexpr bool test() { } { - static_assert(is_nothrow_constructible_v, int(&)[3]>); - static_assert(!is_constructible_v, const int(&)[3]>); - static_assert(!is_constructible_v, double(&)[3]>); + static_assert(is_nothrow_constructible_v, int (&)[3]>); + static_assert(!is_constructible_v, const int (&)[3]>); + static_assert(!is_constructible_v, double (&)[3]>); static_assert(is_nothrow_constructible_v, array&>); static_assert(!is_constructible_v, const array&>); static_assert(!is_constructible_v, array&>); - static_assert(is_nothrow_constructible_v, int(&)[3]>); - static_assert(!is_constructible_v, const int(&)[3]>); - static_assert(!is_constructible_v, double(&)[3]>); + static_assert(is_nothrow_constructible_v, int (&)[3]>); + static_assert(!is_constructible_v, const int (&)[3]>); + static_assert(!is_constructible_v, double (&)[3]>); static_assert(is_nothrow_constructible_v, array&>); static_assert(!is_constructible_v, const array&>); static_assert(!is_constructible_v, array&>); - static_assert(!is_constructible_v, int(&)[500]>); + static_assert(!is_constructible_v, int (&)[500]>); static_assert(!is_constructible_v, array&>); - static_assert(is_nothrow_constructible_v, int(&)[3]>); - static_assert(is_nothrow_constructible_v, const int(&)[3]>); - static_assert(!is_constructible_v, double(&)[3]>); + static_assert(is_nothrow_constructible_v, int (&)[3]>); + static_assert(is_nothrow_constructible_v, const int (&)[3]>); + static_assert(!is_constructible_v, double (&)[3]>); static_assert(is_nothrow_constructible_v, array&>); static_assert(is_nothrow_constructible_v, const array&>); static_assert(!is_constructible_v, array&>); - static_assert(is_nothrow_convertible_v>); + static_assert(is_nothrow_convertible_v>); static_assert(is_nothrow_convertible_v&, span>); - static_assert(is_nothrow_convertible_v>); + static_assert(is_nothrow_convertible_v>); static_assert(is_nothrow_convertible_v&, span>); - static_assert(is_nothrow_convertible_v>); - static_assert(is_nothrow_convertible_v>); + static_assert(is_nothrow_convertible_v>); + static_assert(is_nothrow_convertible_v>); static_assert(is_nothrow_convertible_v&, span>); static_assert(is_nothrow_convertible_v&, span>); diff --git a/tests/std/tests/P0218R1_filesystem/test.cpp b/tests/std/tests/P0218R1_filesystem/test.cpp index 13c260dc8a7..c3a0afc5b54 100644 --- a/tests/std/tests/P0218R1_filesystem/test.cpp +++ b/tests/std/tests/P0218R1_filesystem/test.cpp @@ -2494,14 +2494,14 @@ void test_conversions() { static_assert(is_constructible_v>>); static_assert(is_constructible_v>>); - static_assert(is_constructible_v); + static_assert(is_constructible_v); static_assert(is_constructible_v); - static_assert(is_constructible_v); - static_assert(is_constructible_v); - static_assert(is_constructible_v); + static_assert(is_constructible_v); + static_assert(is_constructible_v); + static_assert(is_constructible_v); static_assert(is_constructible_v); - static_assert(is_constructible_v); - static_assert(is_constructible_v); + static_assert(is_constructible_v); + static_assert(is_constructible_v); static_assert(is_constructible_v); static_assert(is_constructible_v); @@ -2532,11 +2532,11 @@ void test_conversions() { static_assert(!is_constructible_v>); static_assert(!is_constructible_v>); - static_assert(!is_constructible_v); + static_assert(!is_constructible_v); static_assert(!is_constructible_v); static_assert(!is_constructible_v>); static_assert(!is_constructible_v>); - static_assert(!is_constructible_v); + static_assert(!is_constructible_v); static_assert(!is_constructible_v); static_assert(!is_constructible_v); static_assert(!is_constructible_v); diff --git a/tests/std/tests/P0220R1_any/test.cpp b/tests/std/tests/P0220R1_any/test.cpp index 2ee2b6f48ad..391bb7b0ed1 100644 --- a/tests/std/tests/P0220R1_any/test.cpp +++ b/tests/std/tests/P0220R1_any/test.cpp @@ -38,7 +38,7 @@ // Silence a warning emitted by test/std/utilities/any/any.class/any.cons/default.pass.cpp below. #pragma warning(disable : 4640) // construction of local static object is not thread-safe -// clang-format off +// clang-format off: avoid diverging from external code // LLVM SOURCES BEGIN // -- BEGIN: test/std/utilities/any/any.class/any.assign/copy.pass.cpp //===----------------------------------------------------------------------===// diff --git a/tests/std/tests/P0220R1_optional/test.cpp b/tests/std/tests/P0220R1_optional/test.cpp index caa83e68f17..4736b3e26c7 100644 --- a/tests/std/tests/P0220R1_optional/test.cpp +++ b/tests/std/tests/P0220R1_optional/test.cpp @@ -32,7 +32,7 @@ #include // Must precede any other libc++ headers #include -// clang-format off +// clang-format off: avoid diverging from external code // LLVM SOURCES BEGIN // -- BEGIN: test/std/utilities/utility/utility.inplace/inplace.pass.cpp //===----------------------------------------------------------------------===// diff --git a/tests/std/tests/P0288R9_move_only_function/test.cpp b/tests/std/tests/P0288R9_move_only_function/test.cpp index e0c30ad480f..6c863e6c611 100644 --- a/tests/std/tests/P0288R9_move_only_function/test.cpp +++ b/tests/std/tests/P0288R9_move_only_function/test.cpp @@ -458,7 +458,7 @@ void test_const() { void test_qual() { move_only_function f1([](auto i) { return i + 1; }); assert(f1(1) == 2); - move_only_function f2([](auto i) { return i + 1; }); + move_only_function f2([](auto i) { return i + 1; }); assert(f2(2) == 3); move_only_function f3([](auto i) { return i + 1; }); assert(move(f3)(3) == 4); diff --git a/tests/std/tests/P0355R7_calendars_and_time_zones_dates/test.cpp b/tests/std/tests/P0355R7_calendars_and_time_zones_dates/test.cpp index 39e42ff49a0..4cc6c4de521 100644 --- a/tests/std/tests/P0355R7_calendars_and_time_zones_dates/test.cpp +++ b/tests/std/tests/P0355R7_calendars_and_time_zones_dates/test.cpp @@ -706,160 +706,158 @@ constexpr void year_month_day_test() { } if (is_constant_evaluated()) { - // clang-format off - static_assert(sys_days{ 2000y/ 1/ 1} == sys_days{days{ 10957}}); - static_assert(sys_days{ 2000y/ 1/31} == sys_days{days{ 10987}}); - static_assert(sys_days{ 2000y/ 2/ 1} == sys_days{days{ 10988}}); - static_assert(sys_days{ 2000y/ 2/29} == sys_days{days{ 11016}}); - static_assert(sys_days{ 2000y/ 3/ 1} == sys_days{days{ 11017}}); - static_assert(sys_days{ 2000y/ 3/31} == sys_days{days{ 11047}}); - static_assert(sys_days{ 2000y/ 4/ 1} == sys_days{days{ 11048}}); - static_assert(sys_days{ 2000y/ 4/30} == sys_days{days{ 11077}}); - static_assert(sys_days{ 2000y/ 5/ 1} == sys_days{days{ 11078}}); - static_assert(sys_days{ 2000y/ 5/31} == sys_days{days{ 11108}}); - static_assert(sys_days{ 2000y/ 6/ 1} == sys_days{days{ 11109}}); - static_assert(sys_days{ 2000y/ 6/30} == sys_days{days{ 11138}}); - static_assert(sys_days{ 2000y/ 7/ 1} == sys_days{days{ 11139}}); - static_assert(sys_days{ 2000y/ 7/31} == sys_days{days{ 11169}}); - static_assert(sys_days{ 2000y/ 8/ 1} == sys_days{days{ 11170}}); - static_assert(sys_days{ 2000y/ 8/31} == sys_days{days{ 11200}}); - static_assert(sys_days{ 2000y/ 9/ 1} == sys_days{days{ 11201}}); - static_assert(sys_days{ 2000y/ 9/30} == sys_days{days{ 11230}}); - static_assert(sys_days{ 2000y/10/ 1} == sys_days{days{ 11231}}); - static_assert(sys_days{ 2000y/10/31} == sys_days{days{ 11261}}); - static_assert(sys_days{ 2000y/11/ 1} == sys_days{days{ 11262}}); - static_assert(sys_days{ 2000y/11/30} == sys_days{days{ 11291}}); - static_assert(sys_days{ 2000y/12/ 1} == sys_days{days{ 11292}}); - static_assert(sys_days{ 2000y/12/31} == sys_days{days{ 11322}}); - static_assert(sys_days{ -400y/ 2/29} == sys_days{days{ -865566}}); - static_assert(sys_days{ -400y/ 3/ 1} == sys_days{days{ -865565}}); - static_assert(sys_days{ -1y/ 2/28} == sys_days{days{ -719835}}); - static_assert(sys_days{ -1y/ 3/ 1} == sys_days{days{ -719834}}); - static_assert(sys_days{ -1y/12/31} == sys_days{days{ -719529}}); - static_assert(sys_days{ 0y/ 1/ 1} == sys_days{days{ -719528}}); - static_assert(sys_days{ 0y/ 2/29} == sys_days{days{ -719469}}); - static_assert(sys_days{ 0y/ 3/ 1} == sys_days{days{ -719468}}); - static_assert(sys_days{ 1900y/ 3/ 1} == sys_days{days{ -25508}}); - static_assert(sys_days{ 1901y/ 2/28} == sys_days{days{ -25144}}); - static_assert(sys_days{ 1903y/ 3/ 1} == sys_days{days{ -24413}}); - static_assert(sys_days{ 1904y/ 2/29} == sys_days{days{ -24048}}); - static_assert(sys_days{ 1996y/ 3/ 1} == sys_days{days{ 9556}}); - static_assert(sys_days{ 1997y/ 2/28} == sys_days{days{ 9920}}); - static_assert(sys_days{ 1999y/ 3/ 1} == sys_days{days{ 10651}}); - static_assert(sys_days{ 2000y/ 2/29} == sys_days{days{ 11016}}); - static_assert(sys_days{ 2000y/ 3/ 1} == sys_days{days{ 11017}}); - static_assert(sys_days{ 2001y/ 2/28} == sys_days{days{ 11381}}); - static_assert(sys_days{ 2003y/ 3/ 1} == sys_days{days{ 12112}}); - static_assert(sys_days{ 2004y/ 2/29} == sys_days{days{ 12477}}); - static_assert(sys_days{ 2096y/ 3/ 1} == sys_days{days{ 46081}}); - static_assert(sys_days{ 2097y/ 2/28} == sys_days{days{ 46445}}); - static_assert(sys_days{ 2099y/ 3/ 1} == sys_days{days{ 47176}}); - static_assert(sys_days{ 2100y/ 2/28} == sys_days{days{ 47540}}); - static_assert(sys_days{-32767y/ 1/ 1} == sys_days{days{-12687428}}); - static_assert(sys_days{ 32767y/12/31} == sys_days{days{ 11248737}}); - - static_assert( 2000y/ 1/ 1 == year_month_day{sys_days{days{ 10957}}}); - static_assert( 2000y/ 1/31 == year_month_day{sys_days{days{ 10987}}}); - static_assert( 2000y/ 2/ 1 == year_month_day{sys_days{days{ 10988}}}); - static_assert( 2000y/ 2/29 == year_month_day{sys_days{days{ 11016}}}); - static_assert( 2000y/ 3/ 1 == year_month_day{sys_days{days{ 11017}}}); - static_assert( 2000y/ 3/31 == year_month_day{sys_days{days{ 11047}}}); - static_assert( 2000y/ 4/ 1 == year_month_day{sys_days{days{ 11048}}}); - static_assert( 2000y/ 4/30 == year_month_day{sys_days{days{ 11077}}}); - static_assert( 2000y/ 5/ 1 == year_month_day{sys_days{days{ 11078}}}); - static_assert( 2000y/ 5/31 == year_month_day{sys_days{days{ 11108}}}); - static_assert( 2000y/ 6/ 1 == year_month_day{sys_days{days{ 11109}}}); - static_assert( 2000y/ 6/30 == year_month_day{sys_days{days{ 11138}}}); - static_assert( 2000y/ 7/ 1 == year_month_day{sys_days{days{ 11139}}}); - static_assert( 2000y/ 7/31 == year_month_day{sys_days{days{ 11169}}}); - static_assert( 2000y/ 8/ 1 == year_month_day{sys_days{days{ 11170}}}); - static_assert( 2000y/ 8/31 == year_month_day{sys_days{days{ 11200}}}); - static_assert( 2000y/ 9/ 1 == year_month_day{sys_days{days{ 11201}}}); - static_assert( 2000y/ 9/30 == year_month_day{sys_days{days{ 11230}}}); - static_assert( 2000y/10/ 1 == year_month_day{sys_days{days{ 11231}}}); - static_assert( 2000y/10/31 == year_month_day{sys_days{days{ 11261}}}); - static_assert( 2000y/11/ 1 == year_month_day{sys_days{days{ 11262}}}); - static_assert( 2000y/11/30 == year_month_day{sys_days{days{ 11291}}}); - static_assert( 2000y/12/ 1 == year_month_day{sys_days{days{ 11292}}}); - static_assert( 2000y/12/31 == year_month_day{sys_days{days{ 11322}}}); - static_assert( -400y/ 2/29 == year_month_day{sys_days{days{ -865566}}}); - static_assert( -400y/ 3/ 1 == year_month_day{sys_days{days{ -865565}}}); - static_assert( -1y/ 2/28 == year_month_day{sys_days{days{ -719835}}}); - static_assert( -1y/ 3/ 1 == year_month_day{sys_days{days{ -719834}}}); - static_assert( -1y/12/31 == year_month_day{sys_days{days{ -719529}}}); - static_assert( 0y/ 1/ 1 == year_month_day{sys_days{days{ -719528}}}); - static_assert( 0y/ 2/29 == year_month_day{sys_days{days{ -719469}}}); - static_assert( 0y/ 3/ 1 == year_month_day{sys_days{days{ -719468}}}); - static_assert( 1900y/ 3/ 1 == year_month_day{sys_days{days{ -25508}}}); - static_assert( 1901y/ 2/28 == year_month_day{sys_days{days{ -25144}}}); - static_assert( 1903y/ 3/ 1 == year_month_day{sys_days{days{ -24413}}}); - static_assert( 1904y/ 2/29 == year_month_day{sys_days{days{ -24048}}}); - static_assert( 1996y/ 3/ 1 == year_month_day{sys_days{days{ 9556}}}); - static_assert( 1997y/ 2/28 == year_month_day{sys_days{days{ 9920}}}); - static_assert( 1999y/ 3/ 1 == year_month_day{sys_days{days{ 10651}}}); - static_assert( 2000y/ 2/29 == year_month_day{sys_days{days{ 11016}}}); - static_assert( 2000y/ 3/ 1 == year_month_day{sys_days{days{ 11017}}}); - static_assert( 2001y/ 2/28 == year_month_day{sys_days{days{ 11381}}}); - static_assert( 2003y/ 3/ 1 == year_month_day{sys_days{days{ 12112}}}); - static_assert( 2004y/ 2/29 == year_month_day{sys_days{days{ 12477}}}); - static_assert( 2096y/ 3/ 1 == year_month_day{sys_days{days{ 46081}}}); - static_assert( 2097y/ 2/28 == year_month_day{sys_days{days{ 46445}}}); - static_assert( 2099y/ 3/ 1 == year_month_day{sys_days{days{ 47176}}}); - static_assert( 2100y/ 2/28 == year_month_day{sys_days{days{ 47540}}}); - static_assert(-32767y/ 1/ 1 == year_month_day{sys_days{days{-12687428}}}); - static_assert( 32767y/12/31 == year_month_day{sys_days{days{ 11248737}}}); - - static_assert(sys_days{ 2000y/ 1/ 0} == sys_days{days{ 10956}}); - static_assert(sys_days{ 2000y/ 1/255} == sys_days{days{ 11211}}); - static_assert(sys_days{ 2000y/ 2/ 0} == sys_days{days{ 10987}}); - static_assert(sys_days{ 2000y/ 2/255} == sys_days{days{ 11242}}); - static_assert(sys_days{ 2000y/ 3/ 0} == sys_days{days{ 11016}}); - static_assert(sys_days{ 2000y/ 3/255} == sys_days{days{ 11271}}); - static_assert(sys_days{ 2000y/ 4/ 0} == sys_days{days{ 11047}}); - static_assert(sys_days{ 2000y/ 4/255} == sys_days{days{ 11302}}); - static_assert(sys_days{ 2000y/ 5/ 0} == sys_days{days{ 11077}}); - static_assert(sys_days{ 2000y/ 5/255} == sys_days{days{ 11332}}); - static_assert(sys_days{ 2000y/ 6/ 0} == sys_days{days{ 11108}}); - static_assert(sys_days{ 2000y/ 6/255} == sys_days{days{ 11363}}); - static_assert(sys_days{ 2000y/ 7/ 0} == sys_days{days{ 11138}}); - static_assert(sys_days{ 2000y/ 7/255} == sys_days{days{ 11393}}); - static_assert(sys_days{ 2000y/ 8/ 0} == sys_days{days{ 11169}}); - static_assert(sys_days{ 2000y/ 8/255} == sys_days{days{ 11424}}); - static_assert(sys_days{ 2000y/ 9/ 0} == sys_days{days{ 11200}}); - static_assert(sys_days{ 2000y/ 9/255} == sys_days{days{ 11455}}); - static_assert(sys_days{ 2000y/10/ 0} == sys_days{days{ 11230}}); - static_assert(sys_days{ 2000y/10/255} == sys_days{days{ 11485}}); - static_assert(sys_days{ 2000y/11/ 0} == sys_days{days{ 11261}}); - static_assert(sys_days{ 2000y/11/255} == sys_days{days{ 11516}}); - static_assert(sys_days{ 2000y/12/ 0} == sys_days{days{ 11291}}); - static_assert(sys_days{ 2000y/12/255} == sys_days{days{ 11546}}); - static_assert(sys_days{ -400y/ 2/255} == sys_days{days{ -865340}}); - static_assert(sys_days{ -400y/ 3/ 0} == sys_days{days{ -865566}}); - static_assert(sys_days{ -1y/ 2/255} == sys_days{days{ -719608}}); - static_assert(sys_days{ -1y/ 3/ 0} == sys_days{days{ -719835}}); - static_assert(sys_days{ -1y/12/255} == sys_days{days{ -719305}}); - static_assert(sys_days{ 0y/ 1/ 0} == sys_days{days{ -719529}}); - static_assert(sys_days{ 0y/ 2/255} == sys_days{days{ -719243}}); - static_assert(sys_days{ 0y/ 3/ 0} == sys_days{days{ -719469}}); - static_assert(sys_days{ 1900y/ 3/ 0} == sys_days{days{ -25509}}); - static_assert(sys_days{ 1901y/ 2/255} == sys_days{days{ -24917}}); - static_assert(sys_days{ 1903y/ 3/ 0} == sys_days{days{ -24414}}); - static_assert(sys_days{ 1904y/ 2/255} == sys_days{days{ -23822}}); - static_assert(sys_days{ 1996y/ 3/ 0} == sys_days{days{ 9555}}); - static_assert(sys_days{ 1997y/ 2/255} == sys_days{days{ 10147}}); - static_assert(sys_days{ 1999y/ 3/ 0} == sys_days{days{ 10650}}); - static_assert(sys_days{ 2000y/ 2/255} == sys_days{days{ 11242}}); - static_assert(sys_days{ 2000y/ 3/ 0} == sys_days{days{ 11016}}); - static_assert(sys_days{ 2001y/ 2/255} == sys_days{days{ 11608}}); - static_assert(sys_days{ 2003y/ 3/ 0} == sys_days{days{ 12111}}); - static_assert(sys_days{ 2004y/ 2/255} == sys_days{days{ 12703}}); - static_assert(sys_days{ 2096y/ 3/ 0} == sys_days{days{ 46080}}); - static_assert(sys_days{ 2097y/ 2/255} == sys_days{days{ 46672}}); - static_assert(sys_days{ 2099y/ 3/ 0} == sys_days{days{ 47175}}); - static_assert(sys_days{ 2100y/ 2/255} == sys_days{days{ 47767}}); - static_assert(sys_days{-32767y/ 1/ 0} == sys_days{days{-12687429}}); - static_assert(sys_days{ 32767y/12/255} == sys_days{days{ 11248961}}); - // clang-format on + static_assert(sys_days{2000y / 1 / 1} == sys_days{days{10957}}); + static_assert(sys_days{2000y / 1 / 31} == sys_days{days{10987}}); + static_assert(sys_days{2000y / 2 / 1} == sys_days{days{10988}}); + static_assert(sys_days{2000y / 2 / 29} == sys_days{days{11016}}); + static_assert(sys_days{2000y / 3 / 1} == sys_days{days{11017}}); + static_assert(sys_days{2000y / 3 / 31} == sys_days{days{11047}}); + static_assert(sys_days{2000y / 4 / 1} == sys_days{days{11048}}); + static_assert(sys_days{2000y / 4 / 30} == sys_days{days{11077}}); + static_assert(sys_days{2000y / 5 / 1} == sys_days{days{11078}}); + static_assert(sys_days{2000y / 5 / 31} == sys_days{days{11108}}); + static_assert(sys_days{2000y / 6 / 1} == sys_days{days{11109}}); + static_assert(sys_days{2000y / 6 / 30} == sys_days{days{11138}}); + static_assert(sys_days{2000y / 7 / 1} == sys_days{days{11139}}); + static_assert(sys_days{2000y / 7 / 31} == sys_days{days{11169}}); + static_assert(sys_days{2000y / 8 / 1} == sys_days{days{11170}}); + static_assert(sys_days{2000y / 8 / 31} == sys_days{days{11200}}); + static_assert(sys_days{2000y / 9 / 1} == sys_days{days{11201}}); + static_assert(sys_days{2000y / 9 / 30} == sys_days{days{11230}}); + static_assert(sys_days{2000y / 10 / 1} == sys_days{days{11231}}); + static_assert(sys_days{2000y / 10 / 31} == sys_days{days{11261}}); + static_assert(sys_days{2000y / 11 / 1} == sys_days{days{11262}}); + static_assert(sys_days{2000y / 11 / 30} == sys_days{days{11291}}); + static_assert(sys_days{2000y / 12 / 1} == sys_days{days{11292}}); + static_assert(sys_days{2000y / 12 / 31} == sys_days{days{11322}}); + static_assert(sys_days{-400y / 2 / 29} == sys_days{days{-865566}}); + static_assert(sys_days{-400y / 3 / 1} == sys_days{days{-865565}}); + static_assert(sys_days{-1y / 2 / 28} == sys_days{days{-719835}}); + static_assert(sys_days{-1y / 3 / 1} == sys_days{days{-719834}}); + static_assert(sys_days{-1y / 12 / 31} == sys_days{days{-719529}}); + static_assert(sys_days{0y / 1 / 1} == sys_days{days{-719528}}); + static_assert(sys_days{0y / 2 / 29} == sys_days{days{-719469}}); + static_assert(sys_days{0y / 3 / 1} == sys_days{days{-719468}}); + static_assert(sys_days{1900y / 3 / 1} == sys_days{days{-25508}}); + static_assert(sys_days{1901y / 2 / 28} == sys_days{days{-25144}}); + static_assert(sys_days{1903y / 3 / 1} == sys_days{days{-24413}}); + static_assert(sys_days{1904y / 2 / 29} == sys_days{days{-24048}}); + static_assert(sys_days{1996y / 3 / 1} == sys_days{days{9556}}); + static_assert(sys_days{1997y / 2 / 28} == sys_days{days{9920}}); + static_assert(sys_days{1999y / 3 / 1} == sys_days{days{10651}}); + static_assert(sys_days{2000y / 2 / 29} == sys_days{days{11016}}); + static_assert(sys_days{2000y / 3 / 1} == sys_days{days{11017}}); + static_assert(sys_days{2001y / 2 / 28} == sys_days{days{11381}}); + static_assert(sys_days{2003y / 3 / 1} == sys_days{days{12112}}); + static_assert(sys_days{2004y / 2 / 29} == sys_days{days{12477}}); + static_assert(sys_days{2096y / 3 / 1} == sys_days{days{46081}}); + static_assert(sys_days{2097y / 2 / 28} == sys_days{days{46445}}); + static_assert(sys_days{2099y / 3 / 1} == sys_days{days{47176}}); + static_assert(sys_days{2100y / 2 / 28} == sys_days{days{47540}}); + static_assert(sys_days{-32767y / 1 / 1} == sys_days{days{-12687428}}); + static_assert(sys_days{32767y / 12 / 31} == sys_days{days{11248737}}); + + static_assert(2000y / 1 / 1 == year_month_day{sys_days{days{10957}}}); + static_assert(2000y / 1 / 31 == year_month_day{sys_days{days{10987}}}); + static_assert(2000y / 2 / 1 == year_month_day{sys_days{days{10988}}}); + static_assert(2000y / 2 / 29 == year_month_day{sys_days{days{11016}}}); + static_assert(2000y / 3 / 1 == year_month_day{sys_days{days{11017}}}); + static_assert(2000y / 3 / 31 == year_month_day{sys_days{days{11047}}}); + static_assert(2000y / 4 / 1 == year_month_day{sys_days{days{11048}}}); + static_assert(2000y / 4 / 30 == year_month_day{sys_days{days{11077}}}); + static_assert(2000y / 5 / 1 == year_month_day{sys_days{days{11078}}}); + static_assert(2000y / 5 / 31 == year_month_day{sys_days{days{11108}}}); + static_assert(2000y / 6 / 1 == year_month_day{sys_days{days{11109}}}); + static_assert(2000y / 6 / 30 == year_month_day{sys_days{days{11138}}}); + static_assert(2000y / 7 / 1 == year_month_day{sys_days{days{11139}}}); + static_assert(2000y / 7 / 31 == year_month_day{sys_days{days{11169}}}); + static_assert(2000y / 8 / 1 == year_month_day{sys_days{days{11170}}}); + static_assert(2000y / 8 / 31 == year_month_day{sys_days{days{11200}}}); + static_assert(2000y / 9 / 1 == year_month_day{sys_days{days{11201}}}); + static_assert(2000y / 9 / 30 == year_month_day{sys_days{days{11230}}}); + static_assert(2000y / 10 / 1 == year_month_day{sys_days{days{11231}}}); + static_assert(2000y / 10 / 31 == year_month_day{sys_days{days{11261}}}); + static_assert(2000y / 11 / 1 == year_month_day{sys_days{days{11262}}}); + static_assert(2000y / 11 / 30 == year_month_day{sys_days{days{11291}}}); + static_assert(2000y / 12 / 1 == year_month_day{sys_days{days{11292}}}); + static_assert(2000y / 12 / 31 == year_month_day{sys_days{days{11322}}}); + static_assert(-400y / 2 / 29 == year_month_day{sys_days{days{-865566}}}); + static_assert(-400y / 3 / 1 == year_month_day{sys_days{days{-865565}}}); + static_assert(-1y / 2 / 28 == year_month_day{sys_days{days{-719835}}}); + static_assert(-1y / 3 / 1 == year_month_day{sys_days{days{-719834}}}); + static_assert(-1y / 12 / 31 == year_month_day{sys_days{days{-719529}}}); + static_assert(0y / 1 / 1 == year_month_day{sys_days{days{-719528}}}); + static_assert(0y / 2 / 29 == year_month_day{sys_days{days{-719469}}}); + static_assert(0y / 3 / 1 == year_month_day{sys_days{days{-719468}}}); + static_assert(1900y / 3 / 1 == year_month_day{sys_days{days{-25508}}}); + static_assert(1901y / 2 / 28 == year_month_day{sys_days{days{-25144}}}); + static_assert(1903y / 3 / 1 == year_month_day{sys_days{days{-24413}}}); + static_assert(1904y / 2 / 29 == year_month_day{sys_days{days{-24048}}}); + static_assert(1996y / 3 / 1 == year_month_day{sys_days{days{9556}}}); + static_assert(1997y / 2 / 28 == year_month_day{sys_days{days{9920}}}); + static_assert(1999y / 3 / 1 == year_month_day{sys_days{days{10651}}}); + static_assert(2000y / 2 / 29 == year_month_day{sys_days{days{11016}}}); + static_assert(2000y / 3 / 1 == year_month_day{sys_days{days{11017}}}); + static_assert(2001y / 2 / 28 == year_month_day{sys_days{days{11381}}}); + static_assert(2003y / 3 / 1 == year_month_day{sys_days{days{12112}}}); + static_assert(2004y / 2 / 29 == year_month_day{sys_days{days{12477}}}); + static_assert(2096y / 3 / 1 == year_month_day{sys_days{days{46081}}}); + static_assert(2097y / 2 / 28 == year_month_day{sys_days{days{46445}}}); + static_assert(2099y / 3 / 1 == year_month_day{sys_days{days{47176}}}); + static_assert(2100y / 2 / 28 == year_month_day{sys_days{days{47540}}}); + static_assert(-32767y / 1 / 1 == year_month_day{sys_days{days{-12687428}}}); + static_assert(32767y / 12 / 31 == year_month_day{sys_days{days{11248737}}}); + + static_assert(sys_days{2000y / 1 / 0} == sys_days{days{10956}}); + static_assert(sys_days{2000y / 1 / 255} == sys_days{days{11211}}); + static_assert(sys_days{2000y / 2 / 0} == sys_days{days{10987}}); + static_assert(sys_days{2000y / 2 / 255} == sys_days{days{11242}}); + static_assert(sys_days{2000y / 3 / 0} == sys_days{days{11016}}); + static_assert(sys_days{2000y / 3 / 255} == sys_days{days{11271}}); + static_assert(sys_days{2000y / 4 / 0} == sys_days{days{11047}}); + static_assert(sys_days{2000y / 4 / 255} == sys_days{days{11302}}); + static_assert(sys_days{2000y / 5 / 0} == sys_days{days{11077}}); + static_assert(sys_days{2000y / 5 / 255} == sys_days{days{11332}}); + static_assert(sys_days{2000y / 6 / 0} == sys_days{days{11108}}); + static_assert(sys_days{2000y / 6 / 255} == sys_days{days{11363}}); + static_assert(sys_days{2000y / 7 / 0} == sys_days{days{11138}}); + static_assert(sys_days{2000y / 7 / 255} == sys_days{days{11393}}); + static_assert(sys_days{2000y / 8 / 0} == sys_days{days{11169}}); + static_assert(sys_days{2000y / 8 / 255} == sys_days{days{11424}}); + static_assert(sys_days{2000y / 9 / 0} == sys_days{days{11200}}); + static_assert(sys_days{2000y / 9 / 255} == sys_days{days{11455}}); + static_assert(sys_days{2000y / 10 / 0} == sys_days{days{11230}}); + static_assert(sys_days{2000y / 10 / 255} == sys_days{days{11485}}); + static_assert(sys_days{2000y / 11 / 0} == sys_days{days{11261}}); + static_assert(sys_days{2000y / 11 / 255} == sys_days{days{11516}}); + static_assert(sys_days{2000y / 12 / 0} == sys_days{days{11291}}); + static_assert(sys_days{2000y / 12 / 255} == sys_days{days{11546}}); + static_assert(sys_days{-400y / 2 / 255} == sys_days{days{-865340}}); + static_assert(sys_days{-400y / 3 / 0} == sys_days{days{-865566}}); + static_assert(sys_days{-1y / 2 / 255} == sys_days{days{-719608}}); + static_assert(sys_days{-1y / 3 / 0} == sys_days{days{-719835}}); + static_assert(sys_days{-1y / 12 / 255} == sys_days{days{-719305}}); + static_assert(sys_days{0y / 1 / 0} == sys_days{days{-719529}}); + static_assert(sys_days{0y / 2 / 255} == sys_days{days{-719243}}); + static_assert(sys_days{0y / 3 / 0} == sys_days{days{-719469}}); + static_assert(sys_days{1900y / 3 / 0} == sys_days{days{-25509}}); + static_assert(sys_days{1901y / 2 / 255} == sys_days{days{-24917}}); + static_assert(sys_days{1903y / 3 / 0} == sys_days{days{-24414}}); + static_assert(sys_days{1904y / 2 / 255} == sys_days{days{-23822}}); + static_assert(sys_days{1996y / 3 / 0} == sys_days{days{9555}}); + static_assert(sys_days{1997y / 2 / 255} == sys_days{days{10147}}); + static_assert(sys_days{1999y / 3 / 0} == sys_days{days{10650}}); + static_assert(sys_days{2000y / 2 / 255} == sys_days{days{11242}}); + static_assert(sys_days{2000y / 3 / 0} == sys_days{days{11016}}); + static_assert(sys_days{2001y / 2 / 255} == sys_days{days{11608}}); + static_assert(sys_days{2003y / 3 / 0} == sys_days{days{12111}}); + static_assert(sys_days{2004y / 2 / 255} == sys_days{days{12703}}); + static_assert(sys_days{2096y / 3 / 0} == sys_days{days{46080}}); + static_assert(sys_days{2097y / 2 / 255} == sys_days{days{46672}}); + static_assert(sys_days{2099y / 3 / 0} == sys_days{days{47175}}); + static_assert(sys_days{2100y / 2 / 255} == sys_days{days{47767}}); + static_assert(sys_days{-32767y / 1 / 0} == sys_days{days{-12687429}}); + static_assert(sys_days{32767y / 12 / 255} == sys_days{days{11248961}}); } else { sys_days sys2{year{y_min} / 1 / 1}; diff --git a/tests/std/tests/P0645R10_text_formatting_args/test.cpp b/tests/std/tests/P0645R10_text_formatting_args/test.cpp index 2c02e298e3d..39fcd5edb51 100644 --- a/tests/std/tests/P0645R10_text_formatting_args/test.cpp +++ b/tests/std/tests/P0645R10_text_formatting_args/test.cpp @@ -268,7 +268,7 @@ void test_lvalue_only_visitation() { } template -concept CanMakeFormatArgs = requires(Args&&... args) { make_format_args(static_cast(args)...); }; +concept CanMakeFormatArgs = requires(Args&&... args) { make_format_args(static_cast(args)...); }; // P2905R2 Runtime format strings (make make_(w)format_args only take lvalue references) template diff --git a/tests/std/tests/P0645R10_text_formatting_formatting/test.cpp b/tests/std/tests/P0645R10_text_formatting_formatting/test.cpp index f6fc8bdbde3..410104d18b0 100644 --- a/tests/std/tests/P0645R10_text_formatting_formatting/test.cpp +++ b/tests/std/tests/P0645R10_text_formatting_formatting/test.cpp @@ -1364,9 +1364,9 @@ void libfmt_formatter_test_runtime_width() { throw_helper(STR("{0:{1}}"), 0); throw_helper(STR("{0:{0:}}"), 0); throw_helper(STR("{0:{1}}"), 0, -1); - throw_helper(STR("{0:{1}}"), 0, (int_max + 1u)); + throw_helper(STR("{0:{1}}"), 0, int_max + 1u); throw_helper(STR("{0:{1}}"), 0, -1l); - throw_helper(STR("{0:{1}}"), 0, (int_max + 1ul)); + throw_helper(STR("{0:{1}}"), 0, int_max + 1ul); throw_helper(STR("{0:{1}}"), 0, 0.0); // LWG-3720: Restrict the valid types of arg-id for width and precision in std-format-spec @@ -1402,9 +1402,9 @@ void libfmt_formatter_test_runtime_precision() { throw_helper(STR("{0:.{1}}"), 0); throw_helper(STR("{0:.{0:}}"), 0); throw_helper(STR("{0:.{1}}"), 0, -1); - throw_helper(STR("{0:.{1}}"), 0, (int_max + 1u)); + throw_helper(STR("{0:.{1}}"), 0, int_max + 1u); throw_helper(STR("{0:.{1}}"), 0, -1l); - throw_helper(STR("{0:.{1}}"), 0, (int_max + 1ul)); + throw_helper(STR("{0:.{1}}"), 0, int_max + 1ul); throw_helper(STR("{0:.{1}}"), 0, '0'); throw_helper(STR("{0:.{1}}"), 0, 0.0); throw_helper(STR("{0:.{1}}"), 42, 2); diff --git a/tests/std/tests/P0896R4_P1614R2_comparisons/test.cpp b/tests/std/tests/P0896R4_P1614R2_comparisons/test.cpp index baef549e326..db949504e83 100644 --- a/tests/std/tests/P0896R4_P1614R2_comparisons/test.cpp +++ b/tests/std/tests/P0896R4_P1614R2_comparisons/test.cpp @@ -84,21 +84,30 @@ struct three_way_archetype { three_way_archetype(three_way_archetype const&) = delete; three_way_archetype& operator=(three_way_archetype const&) = delete; ~three_way_archetype() = delete; - // clang-format off // 0: not equality_comparable - bool operator==(three_way_archetype const&) const requires (I == 0) = delete; - bool operator==(three_way_archetype const&) const requires (I != 0); + bool operator==(three_way_archetype const&) const + requires (I == 0) + = delete; + bool operator==(three_way_archetype const&) const + requires (I != 0); // 1: not totally_ordered - bool operator<(three_way_archetype const&) const requires (I == 1) = delete; - bool operator<(three_way_archetype const&) const requires (I != 1); - bool operator>(three_way_archetype const&) const requires (I != 1); - bool operator<=(three_way_archetype const&) const requires (I != 1); - bool operator>=(three_way_archetype const&) const requires (I != 1); + bool operator<(three_way_archetype const&) const + requires (I == 1) + = delete; + bool operator<(three_way_archetype const&) const + requires (I != 1); + bool operator>(three_way_archetype const&) const + requires (I != 1); + bool operator<=(three_way_archetype const&) const + requires (I != 1); + bool operator>=(three_way_archetype const&) const + requires (I != 1); // 2: <=> isn't defined - Category operator<=>(three_way_archetype const&) const requires (I != 2 && I != 3); + Category operator<=>(three_way_archetype const&) const + requires (I != 2 && I != 3); // 3: <=> doesn't return a comparison category type - int operator<=>(three_way_archetype const&) const requires (I == 3); - // clang-format on + int operator<=>(three_way_archetype const&) const + requires (I == 3); }; constexpr int three_way_archetype_max = 4; diff --git a/tests/std/tests/P0896R4_common_iterator/test.cpp b/tests/std/tests/P0896R4_common_iterator/test.cpp index f3640bcc17f..4c15f975dc0 100644 --- a/tests/std/tests/P0896R4_common_iterator/test.cpp +++ b/tests/std/tests/P0896R4_common_iterator/test.cpp @@ -203,15 +203,13 @@ constexpr bool test_operator_arrow() { // common_iterator supports "copyable but not equality_comparable" iterators, which combination test::iterator does not // provide (I don't think this is a combination of properties that any real iterator will ever exhibit). Whip up // something so we can test the iterator_category metaprogramming. -// clang-format off template -concept no_iterator_traits = !requires { typename iterator_traits::iterator_concept; } - && !requires { typename iterator_traits::iterator_category; } - && !requires { typename iterator_traits::value_type; } - && !requires { typename iterator_traits::difference_type; } - && !requires { typename iterator_traits::pointer; } - && !requires { typename iterator_traits::reference; }; -// clang-format on +concept no_iterator_traits = !requires { typename iterator_traits::iterator_concept; } // + && !requires { typename iterator_traits::iterator_category; } // + && !requires { typename iterator_traits::value_type; } // + && !requires { typename iterator_traits::difference_type; } // + && !requires { typename iterator_traits::pointer; } // + && !requires { typename iterator_traits::reference; }; struct input_copy_but_no_eq { using value_type = int; diff --git a/tests/std/tests/P0896R4_ranges_algorithm_machinery/test.compile.pass.cpp b/tests/std/tests/P0896R4_ranges_algorithm_machinery/test.compile.pass.cpp index 9c0f120473d..a1b80d9401c 100644 --- a/tests/std/tests/P0896R4_ranges_algorithm_machinery/test.compile.pass.cpp +++ b/tests/std/tests/P0896R4_ranges_algorithm_machinery/test.compile.pass.cpp @@ -41,9 +41,8 @@ template struct simple_iter_archetype { using value_type = T; - // clang-format off - simple_reference operator*() const requires (I != 0); // 0: not indirectly_readable - // clang-format on + simple_reference operator*() const + requires (I != 0); // 0: not indirectly_readable friend void iter_swap(simple_iter_archetype const&, simple_iter_archetype const&) {} }; static_assert(!std::indirectly_readable>); @@ -73,25 +72,34 @@ namespace indirectly_unary_invocable_test { template struct Fn : base { - // clang-format off // 1: not invocable&> - void operator()(int&) const requires (I == 1) = delete; + void operator()(int&) const + requires (I == 1) + = delete; // 2: not invocable> - void operator()(simple_reference) const requires (I == 2) = delete; + void operator()(simple_reference) const + requires (I == 2) + = delete; // 3: not invocable> // This case is made valid by P2997R1 // "Removing The Common Reference Requirement From The Indirectly Invocable Concepts". - void operator()(simple_common_reference) const requires (I == 3) = delete; + void operator()(simple_common_reference) const + requires (I == 3) + = delete; // 4 : not common_reference_with&>, // invoke_result_t>>; - void operator()(int&) const requires (I == 4); - int operator()(simple_reference) const requires (I == 4); - - int operator()(int&) const requires (I != 1 && I != 4); - int operator()(simple_reference) const requires (I != 2 && I != 4); - int operator()(simple_common_reference) const requires (I != 3 && I != 4); - // clang-format on + void operator()(int&) const + requires (I == 4); + int operator()(simple_reference) const + requires (I == 4); + + int operator()(int&) const + requires (I != 1 && I != 4); + int operator()(simple_reference) const + requires (I != 2 && I != 4); + int operator()(simple_common_reference) const + requires (I != 3 && I != 4); }; template @@ -126,21 +134,27 @@ namespace indirect_unary_predicate_test { template struct Fn : base { - // clang-format off // 1: not predicate&> - void operator()(int&) const requires (I == 1); + void operator()(int&) const + requires (I == 1); // 2: not predicate> - void operator()(simple_reference) const requires (I == 2) = delete; + void operator()(simple_reference) const + requires (I == 2) + = delete; // 3: not predicate> // This case is made valid by P2997R1 // "Removing The Common Reference Requirement From The Indirectly Invocable Concepts". - void operator()(simple_common_reference) const requires (I == 3) = delete; + void operator()(simple_common_reference) const + requires (I == 3) + = delete; // 4: all of the above - int operator()(int&) const requires (I != 1 && I != 4); - int operator()(simple_reference) const requires (I != 2 && I != 4); - int operator()(simple_common_reference) const requires (I != 3 && I != 4); - // clang-format on + int operator()(int&) const + requires (I != 1 && I != 4); + int operator()(simple_reference) const + requires (I != 2 && I != 4); + int operator()(simple_common_reference) const + requires (I != 3 && I != 4); }; static_assert(!indirect_unary_predicate, simple_iter_archetype<1>>); @@ -168,26 +182,34 @@ namespace indirect_binary_predicate_test { template struct Fn : base { - // clang-format off // 1: not predicate&, iter_value_t&> - void operator()(int&, int&) const requires (I == 1); + void operator()(int&, int&) const + requires (I == 1); // 2: not predicate&, iter_reference_t> - void operator()(int&, simple_reference) const requires (I == 2); + void operator()(int&, simple_reference) const + requires (I == 2); // 3: not predicate, iter_value_t&> - void operator()(simple_reference, int&) const requires (I == 3); + void operator()(simple_reference, int&) const + requires (I == 3); // 4: not predicate, iter_reference_t> - void operator()(simple_reference, simple_reference) const requires (I == 4); + void operator()(simple_reference, simple_reference) const + requires (I == 4); // 5: not predicate, iter_common_reference_t> // This case is made valid by P2997R1 // "Removing The Common Reference Requirement From The Indirectly Invocable Concepts". - void operator()(simple_common_reference, simple_common_reference) const requires (I == 5); - - bool operator()(int&, int&) const requires (I != 1); - int operator()(int&, simple_reference) const requires (I != 2); - int* operator()(simple_reference, int&) const requires (I != 3); - std::true_type operator()(simple_reference, simple_reference) const requires (I != 4); - std::false_type operator()(simple_common_reference, simple_common_reference) const requires (I != 5); - // clang-format on + void operator()(simple_common_reference, simple_common_reference) const + requires (I == 5); + + bool operator()(int&, int&) const + requires (I != 1); + int operator()(int&, simple_reference) const + requires (I != 2); + int* operator()(simple_reference, int&) const + requires (I != 3); + std::true_type operator()(simple_reference, simple_reference) const + requires (I != 4); + std::false_type operator()(simple_common_reference, simple_common_reference) const + requires (I != 5); }; template @@ -253,19 +275,24 @@ namespace indirectly_movable_test { // also covers indirectly_movable_storable template struct value_type { - // clang-format off value_type() = default; value_type(value_type&&) = default; - value_type& operator=(value_type&&) requires (I != 0) = default; // 0: not movable + value_type& operator=(value_type&&) + requires (I != 0) + = default; // 0: not movable // 1: not constructible_from>: template - value_type(simple_reference) requires (I == 1) = delete; + value_type(simple_reference) + requires (I == 1) + = delete; // 2: not assignable_from>: template - value_type& operator=(simple_reference) requires (I != 2); + value_type& operator=(simple_reference) + requires (I != 2); template - void operator=(simple_reference) requires (I == 2) = delete; - // clang-format on + void operator=(simple_reference) + requires (I == 2) + = delete; }; // Ensure specializations of value_type have the intended properties static_assert(!movable>); @@ -283,15 +310,19 @@ namespace indirectly_movable_test { // also covers indirectly_movable_storable template struct out_archetype { - // clang-format off out_archetype& operator*() const; // 0: not indirectly_writable - void operator=(simple_reference>&&) const requires (I == 0) = delete; - void operator=(simple_reference>&&) const requires (I != 0); + void operator=(simple_reference>&&) const + requires (I == 0) + = delete; + void operator=(simple_reference>&&) const + requires (I != 0); // 1: not indirectly_writable - void operator=(value_type&&) const requires (I == 1) = delete; - void operator=(value_type&&) const requires (I != 1); - // clang-format on + void operator=(value_type&&) const + requires (I == 1) + = delete; + void operator=(value_type&&) const + requires (I != 1); }; // Ensure specializations of out_archetype have the intended properties static_assert(!indirectly_writable, simple_reference>>); @@ -323,17 +354,22 @@ namespace indirectly_copyable_test { // also covers indirectly_copyable_storable struct value_type { value_type() = default; value_type(value_type const&) = default; - // clang-format off - value_type& operator=(value_type const&) requires (I != 0) = default; // 0: not copyable + value_type& operator=(value_type const&) + requires (I != 0) + = default; // 0: not copyable // 1: not constructible_from>: template - value_type(simple_reference) requires (I == 1) = delete; + value_type(simple_reference) + requires (I == 1) + = delete; // 2: not assignable_from>: template - value_type& operator=(simple_reference) requires (I != 2); + value_type& operator=(simple_reference) + requires (I != 2); template - void operator=(simple_reference) requires (I == 2) = delete; - // clang-format on + void operator=(simple_reference) + requires (I == 2) + = delete; }; // Ensure specializations of value_type have the intended properties static_assert(!copyable>); @@ -351,24 +387,37 @@ namespace indirectly_copyable_test { // also covers indirectly_copyable_storable template struct out_archetype { - // clang-format off out_archetype& operator*() const; // 0: not indirectly_writable - void operator=(simple_reference>&&) const requires (I == 0) = delete; - void operator=(simple_reference>&&) const requires (I != 0); + void operator=(simple_reference>&&) const + requires (I == 0) + = delete; + void operator=(simple_reference>&&) const + requires (I != 0); // 1: not indirectly_writable - void operator=(value_type&) const requires (I == 1) = delete; - void operator=(value_type&) const requires (I != 1); + void operator=(value_type&) const + requires (I == 1) + = delete; + void operator=(value_type&) const + requires (I != 1); // 2: not indirectly_writable - void operator=(value_type&&) const requires (I == 2) = delete; - void operator=(value_type&&) const requires (I != 2); + void operator=(value_type&&) const + requires (I == 2) + = delete; + void operator=(value_type&&) const + requires (I != 2); // 3: not indirectly_writable - void operator=(value_type const&&) const requires (I == 3) = delete; - void operator=(value_type const&&) const requires (I != 3); + void operator=(value_type const&&) const + requires (I == 3) + = delete; + void operator=(value_type const&&) const + requires (I != 3); // 4: not indirectly_writable - void operator=(value_type const&) const requires (I == 4) = delete; - void operator=(value_type const&) const requires (I != 4); - // clang-format on + void operator=(value_type const&) const + requires (I == 4) + = delete; + void operator=(value_type const&) const + requires (I != 4); }; // Ensure specializations of out_archetype have the intended properties static_assert(!indirectly_writable, simple_reference>>); @@ -436,15 +485,16 @@ namespace indirectly_swappable_test { operator int() const; }; - // clang-format off - reference operator*() const noexcept requires (I != 0); + reference operator*() const noexcept + requires (I != 0); - friend constexpr void iter_swap(archetype const&, archetype const&) requires (I != 1) {} + friend constexpr void iter_swap(archetype const&, archetype const&) + requires (I != 1) + {} template requires (I != J && I != 2 && J != 2) friend constexpr void iter_swap(archetype const&, archetype const&) {} - // clang-format on }; // We have to be careful to avoid checking some !indirectly_swappable cases that fail when the Evil Extension is @@ -500,11 +550,11 @@ namespace indirectly_comparable_test { template struct Fn : base { - // clang-format off // 1: not predicate - void operator()(int, int) const requires (I == 1); - void* operator()(int, int) const requires (I != 1); - // clang-format on + void operator()(int, int) const + requires (I == 1); + void* operator()(int, int) const + requires (I != 1); }; static_assert(!indirectly_comparable, simple_iter_archetype<1>, Fn<0>, Proj, Proj>); @@ -720,9 +770,8 @@ namespace permutable_test { operator int() const; // 1: not indirectly_movable_storable - // clang-format off - void operator=(int) const requires (I != 1); - // clang-format on + void operator=(int) const + requires (I != 1); }; proxy operator*() const; @@ -730,10 +779,10 @@ namespace permutable_test { archetype& operator++(); archetype operator++(int); - // clang-format off // 0: not forward_iterator (input only) - bool operator==(archetype const&) const requires (I != 0) = default; - // clang-format on + bool operator==(archetype const&) const + requires (I != 0) + = default; friend int iter_move(archetype const&) { return 42; @@ -777,10 +826,9 @@ namespace mergeable_test { T const& operator*() const; readable_archetype& operator++(); - // clang-format off // 0: not input_iterator - void operator++(int) requires (RS != readable_status::not_input_iter); - // clang-format on + void operator++(int) + requires (RS != readable_status::not_input_iter); }; enum class writable_status { not_weakly_incrementable, not_ind_copy_int, not_ind_copy_long, good }; @@ -792,17 +840,22 @@ namespace mergeable_test { writable_archetype& operator*(); writable_archetype& operator++(); - // clang-format off - writable_archetype operator++(int) requires (WS != writable_status::not_weakly_incrementable); + writable_archetype operator++(int) + requires (WS != writable_status::not_weakly_incrementable); // 1: not indirectly_copyable - void operator=(int) requires (WS == writable_status::not_ind_copy_int) = delete; - writable_archetype& operator=(int) requires (WS != writable_status::not_ind_copy_int); + void operator=(int) + requires (WS == writable_status::not_ind_copy_int) + = delete; + writable_archetype& operator=(int) + requires (WS != writable_status::not_ind_copy_int); // 2: not indirectly_copyable - void operator=(long) requires (WS == writable_status::not_ind_copy_long) = delete; - writable_archetype& operator=(long) requires (WS != writable_status::not_ind_copy_long); - // clang-format on + void operator=(long) + requires (WS == writable_status::not_ind_copy_long) + = delete; + writable_archetype& operator=(long) + requires (WS != writable_status::not_ind_copy_long); }; void test() { @@ -1008,17 +1061,20 @@ namespace special_memory_concepts { using difference_type = int; using value_type = std::conditional_t; - // clang-format off - int operator*() const requires (I == iterator_status::not_lvalue_reference); - int& operator*() const requires (I != iterator_status::not_lvalue_reference); + int operator*() const + requires (I == iterator_status::not_lvalue_reference); + int& operator*() const + requires (I != iterator_status::not_lvalue_reference); iterator_archetype& operator++(); - void operator++(int) requires (I != iterator_status::forward); - iterator_archetype operator++(int) requires (I == iterator_status::forward); + void operator++(int) + requires (I != iterator_status::forward); + iterator_archetype operator++(int) + requires (I == iterator_status::forward); bool operator==(std::default_sentinel_t) const; - bool operator==(iterator_archetype const&) const requires (I == iterator_status::forward); - // clang-format on + bool operator==(iterator_archetype const&) const + requires (I == iterator_status::forward); }; // Verify iterator_archetype static_assert(!input_iterator>); @@ -1056,10 +1112,9 @@ namespace special_memory_concepts { template struct sentinel_archetype { - // clang-format off template - bool operator==(iterator_archetype const&) const requires (I != sentinel_status::no); - // clang-format on + bool operator==(iterator_archetype const&) const + requires (I != sentinel_status::no); }; // Verify sentinel_archetype static_assert(!sentinel_for, iterator_archetype>); diff --git a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp index e542dfe761c..52e55ab8a12 100644 --- a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp +++ b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp @@ -324,14 +324,18 @@ struct destructible_archetype<0> { }; inline constexpr std::size_t destructible_archetype_max = 1; -// clang-format off -#define COPYABLE_OPS(prefix) \ - prefix##_archetype(prefix##_archetype const&) requires (I != 1); \ - prefix##_archetype(prefix##_archetype&&) requires (I == 2) = delete; \ - \ - prefix##_archetype& operator=(prefix##_archetype const&) requires (I != 3); \ - prefix##_archetype& operator=(prefix##_archetype&&) requires (I == 4) = delete -// clang-format on +#define COPYABLE_OPS(prefix) \ + prefix##_archetype(prefix##_archetype const&) \ + requires (I != 1); \ + prefix##_archetype(prefix##_archetype&&) \ + requires (I == 2) \ + = delete; \ + \ + prefix##_archetype& operator=(prefix##_archetype const&) \ + requires (I != 3); \ + prefix##_archetype& operator=(prefix##_archetype&&) \ + requires (I == 4) \ + = delete template struct semiregular_archetype : destructible_archetype { @@ -359,25 +363,29 @@ struct weakly_incrementable_archetype_dt<7> { template struct increment_ops { - // clang-format off - void operator++() requires (I == 8); - Derived operator++() requires (I == 9); - Derived& operator++() requires (I < 8 || I >= 10); - Post operator++(int) requires (I != 10); - // clang-format on + void operator++() + requires (I == 8); + Derived operator++() + requires (I == 9); + Derived& operator++() + requires (I < 8 || I >= 10); + Post operator++(int) + requires (I != 10); }; template struct weakly_incrementable_archetype : destructible_archetype, weakly_incrementable_archetype_dt, increment_ops, void> { - // clang-format off - weakly_incrementable_archetype(weakly_incrementable_archetype const&) = delete; - weakly_incrementable_archetype(weakly_incrementable_archetype&&) requires (I < 1 || I >= 3) = default; + weakly_incrementable_archetype(weakly_incrementable_archetype const&) = delete; + weakly_incrementable_archetype(weakly_incrementable_archetype&&) + requires (I < 1 || I >= 3) + = default; weakly_incrementable_archetype& operator=(weakly_incrementable_archetype const&) = delete; - weakly_incrementable_archetype& operator=(weakly_incrementable_archetype&&) requires (I < 3 || I >= 5) = default; - // clang-format on + weakly_incrementable_archetype& operator=(weakly_incrementable_archetype&&) + requires (I < 3 || I >= 5) + = default; }; inline constexpr std::size_t weakly_incrementable_archetype_max = 11; @@ -390,11 +398,11 @@ struct incrementable_archetype : weakly_incrementable_archetype, COPYABLE_OPS(incrementable); using increment_ops, incrementable_archetype>::operator++; - // clang-format off - bool operator==(incrementable_archetype const&) const requires (I != 12); + bool operator==(incrementable_archetype const&) const + requires (I != 12); bool operator!=(incrementable_archetype const&) const - requires (I == 13) = delete; - // clang-format on + requires (I == 13) + = delete; }; inline constexpr std::size_t incrementable_archetype_max = 14; @@ -403,13 +411,15 @@ template struct iterator_archetype : weakly_incrementable_archetype { COPYABLE_OPS(iterator); - // clang-format off - iterator_archetype& operator++() requires (I > 9); - void operator++(int) requires (I != 10); + iterator_archetype& operator++() + requires (I > 9); + void operator++(int) + requires (I != 10); - void operator*() requires (I == 11); - int operator*() requires (I != 11); - // clang-format on + void operator*() + requires (I == 11); + int operator*() + requires (I != 11); }; inline constexpr std::size_t iterator_archetype_max = 12; @@ -463,14 +473,15 @@ struct output_iterator_archetype : iterator_archetype, COPYABLE_OPS(output_iterator); using increment_ops, output_iterator_archetype&>::operator++; - // clang-format off // dereference ops from iterator_archetype - void operator*() requires (I == 11); - output_iterator_archetype& operator*() requires (I != 11); + void operator*() + requires (I == 11); + output_iterator_archetype& operator*() + requires (I != 11); // indirectly_writable requirements - void operator=(int) requires (I != 12); - // clang-format on + void operator=(int) + requires (I != 12); }; inline constexpr std::size_t output_iterator_archetype_max = 13; @@ -503,11 +514,11 @@ struct input_iterator_archetype : iterator_archetype, COPYABLE_OPS(input_iterator); using increment_ops, void>::operator++; - // clang-format off // dereference ops from iterator_archetype - void operator*() const requires (I == 11); - int& operator*() const requires (I != 11); - // clang-format on + void operator*() const + requires (I == 11); + int& operator*() const + requires (I != 11); }; inline constexpr std::size_t input_iterator_archetype_max = 16; @@ -520,22 +531,25 @@ struct forward_iterator_archetype : input_iterator_archetype, COPYABLE_OPS(forward_iterator); using increment_ops, forward_iterator_archetype>::operator++; - // clang-format off - bool operator==(forward_iterator_archetype const&) const requires (I != 17); - bool operator!=(forward_iterator_archetype const&) const requires (I == 18) = delete; - // clang-format on + bool operator==(forward_iterator_archetype const&) const + requires (I != 17); + bool operator!=(forward_iterator_archetype const&) const + requires (I == 18) + = delete; }; inline constexpr std::size_t forward_iterator_archetype_max = 19; template struct decrement_ops { - // clang-format off - void operator--() requires (I == 19); - Derived operator--() requires (I == 20); - Derived& operator--() requires (I < 19 || I >= 21); - Derived operator--(int) requires (I != 21); - // clang-format on + void operator--() + requires (I == 19); + Derived operator--() + requires (I == 20); + Derived& operator--() + requires (I < 19 || I >= 21); + Derived operator--(int) + requires (I != 21); }; template @@ -560,22 +574,31 @@ struct random_iterator_archetype : bidi_iterator_archetype, using increment_ops, random_iterator_archetype>::operator++; using decrement_ops>::operator--; - // clang-format off - std::strong_ordering operator<=>(random_iterator_archetype const&) const requires (I != 22); - - int operator-(random_iterator_archetype const&) const requires (I != 5 && I != 23); - - random_iterator_archetype& operator+=(int) requires (I != 24); - random_iterator_archetype operator+(int) const requires (I != 25); - friend random_iterator_archetype operator+(int, random_iterator_archetype const&) requires (I != 26) {} - - random_iterator_archetype& operator-=(int) requires (I != 27); - random_iterator_archetype operator-(int) const requires (I != 28); - - void operator[](int) const requires (I == 29); - int operator[](int) const requires (I == 30); - int& operator[](int) const requires (I < 29 || I >= 31); - // clang-format on + std::strong_ordering operator<=>(random_iterator_archetype const&) const + requires (I != 22); + + int operator-(random_iterator_archetype const&) const + requires (I != 5 && I != 23); + + random_iterator_archetype& operator+=(int) + requires (I != 24); + random_iterator_archetype operator+(int) const + requires (I != 25); + friend random_iterator_archetype operator+(int, random_iterator_archetype const&) + requires (I != 26) + {} + + random_iterator_archetype& operator-=(int) + requires (I != 27); + random_iterator_archetype operator-(int) const + requires (I != 28); + + void operator[](int) const + requires (I == 29); + int operator[](int) const + requires (I == 30); + int& operator[](int) const + requires (I < 29 || I >= 31); }; inline constexpr std::size_t random_iterator_archetype_max = 31; @@ -608,16 +631,21 @@ struct contig_iterator_archetype : increment_ops using increment_ops, contig_iterator_archetype>::operator++; using decrement_ops>::operator--; - // clang-format off - int operator-(contig_iterator_archetype const&) const requires (I != 5 && I != 23); - - contig_iterator_archetype& operator+=(int) requires (I != 24); - contig_iterator_archetype operator+(int) const requires (I != 25); - friend contig_iterator_archetype operator+(int, contig_iterator_archetype const&) requires (I != 26) {} - - contig_iterator_archetype& operator-=(int) requires (I != 27); - contig_iterator_archetype operator-(int) const requires (I != 28); - // clang-format on + int operator-(contig_iterator_archetype const&) const + requires (I != 5 && I != 23); + + contig_iterator_archetype& operator+=(int) + requires (I != 24); + contig_iterator_archetype operator+(int) const + requires (I != 25); + friend contig_iterator_archetype operator+(int, contig_iterator_archetype const&) + requires (I != 26) + {} + + contig_iterator_archetype& operator-=(int) + requires (I != 27); + contig_iterator_archetype operator-(int) const + requires (I != 28); }; template @@ -842,15 +870,13 @@ namespace iterator_traits_test { auto operator<=>(with_pointer const&) const = default; }; - // clang-format off template - concept has_empty_traits = !(requires { typename iterator_traits::iterator_concept; } - || requires { typename iterator_traits::iterator_category; } - || requires { typename iterator_traits::value_type; } - || requires { typename iterator_traits::difference_type; } - || requires { typename iterator_traits::pointer; } - || requires { typename iterator_traits::reference; }); - // clang-format on + concept has_empty_traits = !requires { typename iterator_traits::iterator_concept; } // + && !requires { typename iterator_traits::iterator_category; } // + && !requires { typename iterator_traits::value_type; } // + && !requires { typename iterator_traits::difference_type; } // + && !requires { typename iterator_traits::pointer; } // + && !requires { typename iterator_traits::reference; }; // Verify that iterator_traits pulls from nested member typedefs when the four key names are defined using four_members = @@ -1965,9 +1991,9 @@ namespace iter_ops { constexpr explicit trace_iterator(int const pos, trace& t) noexcept(NoThrow == nothrow::yes) : trace_{&t}, pos_{pos} {} - // clang-format off - trace_iterator(trace_iterator const&) requires is_forward = default; - // clang-format on + trace_iterator(trace_iterator const&) + requires is_forward + = default; trace_iterator(trace_iterator&&) = default; constexpr trace_iterator& operator=(trace_iterator const& that) noexcept(NoThrow == nothrow::yes) @@ -3322,11 +3348,13 @@ namespace move_iterator_test { }; input_iter() = default; - // clang-format off - input_iter(input_iter const&) requires CanCopy = default; + input_iter(input_iter const&) + requires CanCopy + = default; input_iter(input_iter&&) = default; - input_iter& operator=(input_iter const&) requires CanCopy = default; - // clang-format on + input_iter& operator=(input_iter const&) + requires CanCopy + = default; input_iter& operator=(input_iter&&) = default; reference operator*() const; diff --git a/tests/std/tests/P0896R4_views_common/test.cpp b/tests/std/tests/P0896R4_views_common/test.cpp index a1d9c4dd4ac..5bcdfa7409d 100644 --- a/tests/std/tests/P0896R4_views_common/test.cpp +++ b/tests/std/tests/P0896R4_views_common/test.cpp @@ -12,10 +12,10 @@ using namespace std; template -concept CanViewCommon = requires(Rng&& r) { views::common(static_cast(r)); }; +concept CanViewCommon = requires(Rng&& r) { views::common(static_cast(r)); }; template -concept CanViewAll = requires(Rng&& r) { views::all(static_cast(r)); }; +concept CanViewAll = requires(Rng&& r) { views::all(static_cast(r)); }; // Test a silly precomposed range adaptor pipeline constexpr auto pipeline = views::all | views::common; diff --git a/tests/std/tests/P0896R4_views_join/test.cpp b/tests/std/tests/P0896R4_views_join/test.cpp index 2e14c108161..ce0eedeec01 100644 --- a/tests/std/tests/P0896R4_views_join/test.cpp +++ b/tests/std/tests/P0896R4_views_join/test.cpp @@ -743,9 +743,7 @@ int main() { // Validate non-views { // ... C array static constexpr int join_me[5][2] = {{0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}}; -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-934264 static_assert(test_one(join_me, expected_ints)); -#endif // ^^^ no workaround ^^^ test_one(join_me, expected_ints); } { // ... fwd container diff --git a/tests/std/tests/P0898R3_concepts/invocable_cc.hpp b/tests/std/tests/P0898R3_concepts/invocable_cc.hpp index c9846f969cc..0f470478697 100644 --- a/tests/std/tests/P0898R3_concepts/invocable_cc.hpp +++ b/tests/std/tests/P0898R3_concepts/invocable_cc.hpp @@ -16,7 +16,7 @@ void NAME() { { using Fn = int (MCALLCONV tag::*)(int); - using RFn = int (MCALLCONV tag::*)(int)&&; + using RFn = int (MCALLCONV tag::*)(int) &&; { // N4849 [func.require]/1.1: "... f is a pointer to member function of a class T and // is_base_of_v> is true" @@ -355,10 +355,10 @@ void NAME() { static_assert(test()); static_assert(test()); - using PMF0R = int (MCALLCONV S::*)()&; + using PMF0R = int (MCALLCONV S::*)() &; using PMF1R = int* (MCALLCONV S::*) (long) &; using PMF2R = int& (MCALLCONV S::*) (long, int) &; - using PMF1PR = int const& (S::*) (int, ...)&; + using PMF1PR = int const& (S::*) (int, ...) &; static_assert(!test()); static_assert(test()); static_assert(test()); @@ -553,10 +553,10 @@ void NAME() { static_assert(test()); static_assert(test()); - using PMF0RR = int (MCALLCONV S::*)()&&; + using PMF0RR = int (MCALLCONV S::*)() &&; using PMF1RR = int* (MCALLCONV S::*) (long) &&; using PMF2RR = int& (MCALLCONV S::*) (long, int) &&; - using PMF1PRR = int const& (S::*) (int, ...)&&; + using PMF1PRR = int const& (S::*) (int, ...) &&; static_assert(test()); static_assert(!test()); static_assert(!test()); diff --git a/tests/std/tests/P0898R3_concepts/test.cpp b/tests/std/tests/P0898R3_concepts/test.cpp index ae98ff7ab72..bdcdcf8f062 100644 --- a/tests/std/tests/P0898R3_concepts/test.cpp +++ b/tests/std/tests/P0898R3_concepts/test.cpp @@ -2906,7 +2906,7 @@ namespace test_predicate { void test() { { using Fn = Bool (tag::*)(int); - using RFn = Bool (tag::*)(int)&&; + using RFn = Bool (tag::*)(int) &&; { // N4849 [func.require]/1.1: "... f is a pointer to member function of a class T and // is_base_of_v> is true" @@ -3318,7 +3318,7 @@ namespace test_relation { struct Equivalent { template constexpr decltype(auto) operator()(T&& t, U&& u) const - requires requires { static_cast(t) == static_cast(u); } + requires requires { static_cast(t) == static_cast(u); } { return static_cast(t) == static_cast(u); } diff --git a/tests/std/tests/P0912R5_coroutine/test.cpp b/tests/std/tests/P0912R5_coroutine/test.cpp index 287e68dcc19..01df89ff66b 100644 --- a/tests/std/tests/P0912R5_coroutine/test.cpp +++ b/tests/std/tests/P0912R5_coroutine/test.cpp @@ -1,6 +1,10 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#if defined(__clang__) && defined(_M_ARM64EC) // TRANSITION, LLVM-158341 +int main() {} +#else // ^^^ workaround / no workaround vvv + #include #include #include @@ -89,7 +93,6 @@ struct Task { coroutine_handle coro; }; -#if !(defined(__clang__) && defined(_M_IX86)) // TRANSITION, LLVM-56507 Task triangular_number(const int n) { if (n == 0) { co_return 0; @@ -97,7 +100,6 @@ Task triangular_number(const int n) { co_return n + co_await triangular_number(n - 1); } -#endif // ^^^ no workaround ^^^ void test_noop_handle() { // Validate noop_coroutine_handle const noop_coroutine_handle noop = noop_coroutine(); @@ -157,7 +159,6 @@ void test_noop_handle() { // Validate noop_coroutine_handle } int main() { -#if !(defined(__clang__) && defined(_M_IX86)) // TRANSITION, LLVM-56507 assert(g_tasks_destroyed == 0); { @@ -182,7 +183,6 @@ int main() { } assert(g_tasks_destroyed == 11); // triangular_number() called for [0, 10] -#endif // ^^^ no workaround ^^^ { // Also test GH-1422: hash>::operator() must be const @@ -192,3 +192,5 @@ int main() { test_noop_handle(); } + +#endif // ^^^ no workaround ^^^ diff --git a/tests/std/tests/P1206R7_ranges_to_misc/test.cpp b/tests/std/tests/P1206R7_ranges_to_misc/test.cpp index 065b8a5dd82..f168fd834be 100644 --- a/tests/std/tests/P1206R7_ranges_to_misc/test.cpp +++ b/tests/std/tests/P1206R7_ranges_to_misc/test.cpp @@ -368,9 +368,7 @@ int main() { static_assert(test_common_constructible()); test_nested_range(); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1588614 static_assert(test_nested_range()); -#endif // ^^^ no workaround ^^^ test_lwg3733(); static_assert(test_lwg3733()); diff --git a/tests/std/tests/P1208R6_source_location/header.h b/tests/std/tests/P1208R6_source_location/header.h index 8fe4f8d046a..3369da4d637 100644 --- a/tests/std/tests/P1208R6_source_location/header.h +++ b/tests/std/tests/P1208R6_source_location/header.h @@ -18,11 +18,7 @@ constexpr void header_test() { assert(x.column() == 37); #endif // ^^^ C1XX ^^^ #if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION -#ifdef __EDG__ // TRANSITION, EDG is changing to match C1XX's output - assert(x.function_name() == "void __cdecl header_test(void)"sv || x.function_name() == "void header_test()"sv); -#else // ^^^ workaround / no workaround vvv assert(x.function_name() == "void __cdecl header_test(void)"sv); -#endif // ^^^ no workaround ^^^ #else // ^^^ detailed / basic vvv assert(x.function_name() == "header_test"sv); #endif // ^^^ basic ^^^ diff --git a/tests/std/tests/P1208R6_source_location/test.cpp b/tests/std/tests/P1208R6_source_location/test.cpp index 79497062073..c09c70432d8 100644 --- a/tests/std/tests/P1208R6_source_location/test.cpp +++ b/tests/std/tests/P1208R6_source_location/test.cpp @@ -68,11 +68,7 @@ constexpr void local_test() { assert(x.column() == 37); #endif // ^^^ C1XX ^^^ #if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION -#ifdef __EDG__ // TRANSITION, EDG is changing to match C1XX's output - assert(x.function_name() == "void __cdecl local_test(void)"sv || x.function_name() == "void local_test()"sv); -#else // ^^^ workaround / no workaround vvv assert(x.function_name() == "void __cdecl local_test(void)"sv); -#endif // ^^^ no workaround ^^^ #else // ^^^ detailed / basic vvv assert(x.function_name() == "local_test"sv); #endif // ^^^ basic ^^^ @@ -84,11 +80,7 @@ constexpr void argument_test( assert(x.line() == line); assert(x.column() == column); #if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION -#ifdef __EDG__ // TRANSITION, EDG is changing to match C1XX's output - assert(x.function_name() == "bool __cdecl test(void)"sv || x.function_name() == "bool test()"sv); -#else // ^^^ workaround / no workaround vvv assert(x.function_name() == "bool __cdecl test(void)"sv); -#endif // ^^^ no workaround ^^^ #else // ^^^ detailed / basic vvv assert(x.function_name() == "test"sv); #endif // ^^^ basic ^^^ @@ -110,12 +102,7 @@ constexpr void sloc_constructor_test() { } else #endif // ^^^ workaround ^^^ { -#ifdef __EDG__ // TRANSITION, EDG is changing to match C1XX's output - assert(x.loc.function_name() == "void __cdecl sloc_constructor_test(void)"sv - || x.loc.function_name() == "void sloc_constructor_test()"sv); -#else // ^^^ workaround / no workaround vvv assert(x.loc.function_name() == "void __cdecl sloc_constructor_test(void)"sv); -#endif // ^^^ no workaround ^^^ } #else // ^^^ detailed / basic vvv #if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783 @@ -140,15 +127,13 @@ constexpr void different_constructor_test() { #else // ^^^ EDG / C1XX vvv assert(x.loc.column() == 5); #endif // ^^^ C1XX ^^^ -#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION -#ifdef __EDG__ // TRANSITION, EDG is changing to almost match C1XX's output - assert(x.loc.function_name() == "__cdecl s::s(int)"sv || x.loc.function_name() == "s::s(int)"sv); -#else // ^^^ workaround / no workaround vvv - assert(x.loc.function_name() == THISCALL_OR_CDECL " s::s(int)"sv); -#endif // ^^^ no workaround ^^^ -#else // ^^^ detailed / basic vvv +#if !_USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION assert(x.loc.function_name() == "s"sv); -#endif // ^^^ basic ^^^ +#elif defined(__EDG__) // ^^^ basic / detailed EDG vvv + assert(x.loc.function_name() == "__cdecl s::s(int)"sv); +#else // ^^^ detailed EDG / detailed Other vvv + assert(x.loc.function_name() == THISCALL_OR_CDECL " s::s(int)"sv); +#endif // ^^^ detailed Other ^^^ assert(string_view{x.loc.file_name()}.ends_with(test_cpp)); } @@ -167,12 +152,7 @@ constexpr void sub_member_test() { } else #endif // ^^^ workaround ^^^ { -#ifdef __EDG__ // TRANSITION, EDG is changing to match C1XX's output - assert(s.x.loc.function_name() == "void __cdecl sub_member_test(void)"sv - || s.x.loc.function_name() == "void sub_member_test()"sv); -#else // ^^^ workaround / no workaround vvv assert(s.x.loc.function_name() == "void __cdecl sub_member_test(void)"sv); -#endif // ^^^ no workaround ^^^ } #else // ^^^ detailed / basic vvv #if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783 @@ -195,15 +175,13 @@ constexpr void sub_member_test() { #else // ^^^ EDG / C1XX vvv assert(s_i.x.loc.column() == 5); #endif // ^^^ C1XX ^^^ -#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION -#ifdef __EDG__ // TRANSITION, EDG is changing to almost match C1XX's output - assert(s_i.x.loc.function_name() == "__cdecl s2::s2(int)"sv || s_i.x.loc.function_name() == "s2::s2(int)"sv); -#else // ^^^ workaround / no workaround vvv - assert(s_i.x.loc.function_name() == THISCALL_OR_CDECL " s2::s2(int)"sv); -#endif // ^^^ no workaround ^^^ -#else // ^^^ detailed / basic vvv +#if !_USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION assert(s_i.x.loc.function_name() == "s2"sv); -#endif // ^^^ basic ^^^ +#elif defined(__EDG__) // ^^^ basic / detailed EDG vvv + assert(s_i.x.loc.function_name() == "__cdecl s2::s2(int)"sv); +#else // ^^^ detailed EDG / detailed Other vvv + assert(s_i.x.loc.function_name() == THISCALL_OR_CDECL " s2::s2(int)"sv); +#endif // ^^^ detailed Other ^^^ assert(string_view{s_i.x.loc.file_name()}.ends_with(test_cpp)); } @@ -225,11 +203,7 @@ constexpr void lambda_test() { assert(x2.column() == 50); #endif // ^^^ C1XX ^^^ #if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION -#ifdef __EDG__ // TRANSITION, EDG is changing to match C1XX's output - assert(x1.function_name() == "void __cdecl lambda_test(void)"sv || x1.function_name() == "void lambda_test()"sv); -#else // ^^^ workaround / no workaround vvv assert(x1.function_name() == "void __cdecl lambda_test(void)"sv); -#endif // ^^^ no workaround ^^^ #else // ^^^ detailed / basic vvv assert(x1.function_name() == "lambda_test"sv); #endif // ^^^ basic ^^^ @@ -242,11 +216,9 @@ constexpr void lambda_test() { #endif // ^^^ Other ^^^ #elif defined(__clang__) // ^^^ basic / detailed Clang vvv assert(fun2 == "auto " THISCALL_OR_CDECL " lambda_test()::(anonymous class)::operator()(void) const"sv); -#elif defined(__EDG__) // ^^^ detailed Clang / detailed __EDG__ vvv - // TRANSITION, EDG is changing to resemble C1XX's output somewhat more closely - assert(fun2 == "__cdecl lambda [](void)->auto::operator()(void)->auto"sv - || fun2 == "lambda []()->auto::operator()()->auto"sv); -#else // ^^^ detailed __EDG__ / detailed C1XX vvv +#elif defined(__EDG__) // ^^^ detailed Clang / detailed EDG vvv + assert(fun2 == "__cdecl lambda [](void)->auto::operator()(void)->auto"sv); +#else // ^^^ detailed EDG / detailed C1XX vvv assert(fun2.starts_with("struct std::source_location " THISCALL_OR_CDECL " lambda_test::(void)"sv - || x1.function_name() == "std::source_location function_template()"sv); -#else // ^^^ detailed __EDG__ / detailed C1XX vvv +#elif defined(__EDG__) // ^^^ detailed Clang / detailed EDG vvv + assert(x1.function_name() == "std::source_location __cdecl function_template(void)"sv); +#else // ^^^ detailed EDG / detailed C1XX vvv assert(x1.function_name() == "struct std::source_location __cdecl function_template(void)"sv); #endif // ^^^ detailed C1XX ^^^ assert(string_view{x1.file_name()}.ends_with(test_cpp)); @@ -289,11 +259,9 @@ constexpr void function_template_test() { assert(x2.function_name() == "function_template"sv); #elif defined(__clang__) // ^^^ basic / detailed Clang vvv assert(x2.function_name() == "source_location __cdecl function_template(void) [T = int]"sv); -#elif defined(__EDG__) // ^^^ detailed Clang / detailed __EDG__ vvv - // TRANSITION, EDG is changing to almost match C1XX's output - assert(x2.function_name() == "std::source_location __cdecl function_template(void)"sv - || x2.function_name() == "std::source_location function_template()"sv); -#else // ^^^ detailed __EDG__ / detailed C1XX vvv +#elif defined(__EDG__) // ^^^ detailed Clang / detailed EDG vvv + assert(x2.function_name() == "std::source_location __cdecl function_template(void)"sv); +#else // ^^^ detailed EDG / detailed C1XX vvv assert(x2.function_name() == "struct std::source_location __cdecl function_template(void)"sv); #endif // ^^^ detailed C1XX ^^^ assert(string_view{x1.file_name()} == string_view{x2.file_name()}); diff --git a/tests/std/tests/P2165R4_tuple_like_pair/test.cpp b/tests/std/tests/P2165R4_tuple_like_pair/test.cpp index d73f00f3a46..79018a47dbb 100644 --- a/tests/std/tests/P2165R4_tuple_like_pair/test.cpp +++ b/tests/std/tests/P2165R4_tuple_like_pair/test.cpp @@ -173,17 +173,17 @@ using BinaryArray = array; int main() { static_assert(test_pair_like_constructor()); - assert((test_pair_like_constructor())); + assert(test_pair_like_constructor()); static_assert(test_pair_like_constructor()); - assert((test_pair_like_constructor())); + assert(test_pair_like_constructor()); static_assert(test_pair_like_assignment()); - assert((test_pair_like_assignment())); + assert(test_pair_like_assignment()); static_assert(test_pair_like_assignment()); - assert((test_pair_like_assignment())); + assert(test_pair_like_assignment()); static_assert(test_pair_like_const_assignment()); - assert((test_pair_like_const_assignment())); + assert(test_pair_like_const_assignment()); static_assert(test_pair_like_const_assignment()); - assert((test_pair_like_const_assignment())); + assert(test_pair_like_const_assignment()); } diff --git a/tests/std/tests/P2278R4_views_as_const/test.cpp b/tests/std/tests/P2278R4_views_as_const/test.cpp index 5bc64dd26cc..6b1e68830a5 100644 --- a/tests/std/tests/P2278R4_views_as_const/test.cpp +++ b/tests/std/tests/P2278R4_views_as_const/test.cpp @@ -628,7 +628,7 @@ using move_only_view = test::range; int main() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, LLVM-62096 and VSO-1901430 +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, LLVM-62096 (fixed in Clang 21) and VSO-1901430 { // Validate views // ... copyable constexpr span s{some_ints}; @@ -694,7 +694,7 @@ int main() { test_one(as_const(views::empty), empty_arr); } -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, LLVM-62096 and VSO-1901430 +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, LLVM-62096 (fixed in Clang 21) and VSO-1901430 { // empty range using Span = span; static_assert(test_one(Span{}, Span{})); diff --git a/tests/std/tests/P2321R2_views_zip/test.cpp b/tests/std/tests/P2321R2_views_zip/test.cpp index 5f370874c83..c38d0251d09 100644 --- a/tests/std/tests/P2321R2_views_zip/test.cpp +++ b/tests/std/tests/P2321R2_views_zip/test.cpp @@ -356,12 +356,9 @@ constexpr bool test_one(TestContainerType& test_container, RangeTypes&&... rngs) return do_tuples_reference_same_objects(lhs_tuple, rhs_tuple); })); -#pragma warning(push) -#pragma warning(disable : 4127) // Conditional Expression is Constant if (!(ranges::forward_range> && ...)) { // intentionally not if constexpr return true; } -#pragma warning(pop) // Validate view_interface::data() // diff --git a/tests/std/tests/P2321R2_views_zip_transform/test.cpp b/tests/std/tests/P2321R2_views_zip_transform/test.cpp index dd08fcb1b90..e29f45c3078 100644 --- a/tests/std/tests/P2321R2_views_zip_transform/test.cpp +++ b/tests/std/tests/P2321R2_views_zip_transform/test.cpp @@ -498,13 +498,10 @@ constexpr bool test_one(TransformType_&& transformer, const TransformedElementsC // Validate contents of zip-transformed range assert(ranges::equal(zipped_transformed_range, transformed_elements)); -#pragma warning(push) -#pragma warning(disable : 4127) // Conditional Expression is Constant if (!(ranges::forward_range> && ...)) // intentionally not if constexpr { return true; } -#pragma warning(pop) // Validate view_interface::data() // diff --git a/tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp b/tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp index d742c9cb895..c818dd54948 100644 --- a/tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp +++ b/tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp @@ -43,7 +43,7 @@ constexpr void check_array() { static_assert(_Compile_time_max_size == 9); // Computing cartesian product for small arrays does not require big range_size_t - using A1 = all_t; + using A1 = all_t; static_assert(sizeof(cpv_size_t) <= sizeof(size_t)); static_assert(sizeof(cpv_size_t) <= sizeof(size_t)); static_assert(sizeof(cpv_size_t) <= sizeof(size_t)); @@ -54,7 +54,7 @@ constexpr void check_array() { static_assert(sizeof(cpv_difference_t) <= sizeof(ptrdiff_t)); // Computing cartesian product for big arrays requires bigger types - using A2 = all_t; + using A2 = all_t; static_assert(sizeof(cpv_size_t) > sizeof(size_t)); static_assert(sizeof(cpv_difference_t) > sizeof(ptrdiff_t)); } @@ -175,11 +175,7 @@ constexpr void check_single_view() { enum class CheckConstAdaptor : bool { no, yes }; -#ifdef __clang__ // TRANSITION, LLVM-104189 -template