diff --git a/.clang-format b/.clang-format index a7c98218459..23379778ba9 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/20.1.0/tools/clang/docs/ClangFormatStyleOptions.html +# https://releases.llvm.org/22.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. @@ -16,10 +16,10 @@ --- # Language: Cpp BasedOnStyle: LLVM +# AlignAfterOpenBracket: true +AlignAfterOpenBracket: false # AccessModifierOffset: -2 AccessModifierOffset: -4 -# AlignAfterOpenBracket: Align -AlignAfterOpenBracket: DontAlign # AlignArrayOfStructures: None # AlignConsecutiveAssignments: # Enabled: false @@ -90,6 +90,7 @@ AlignEscapedNewlines: Left # AlignOperands: Align AlignOperands: AlignAfterOperator # AlignTrailingComments: +# AlignPPAndNotPP: true # Kind: Always # OverEmptyLines: 0 AlignTrailingComments: @@ -98,6 +99,7 @@ AlignTrailingComments: # AllowAllParametersOfDeclarationOnNextLine: true # AllowBreakBeforeNoexceptSpecifier: Never AllowBreakBeforeNoexceptSpecifier: OnlyWithParen +# AllowBreakBeforeQtProperty: false # AllowShortBlocksOnASingleLine: Never # AllowShortCaseExpressionOnASingleLine: true # AllowShortCaseLabelsOnASingleLine: false @@ -114,8 +116,10 @@ AllowShortFunctionsOnASingleLine: Empty # AttributeMacros: # - __capability # BinPackArguments: true +# BinPackLongBracedList: true # BinPackParameters: BinPack # BitFieldColonSpacing: Both +# BracedInitializerIndentWidth: -1 # BraceWrapping: # AfterCaseLabel: false # AfterClass: false @@ -139,13 +143,24 @@ AllowShortFunctionsOnASingleLine: Empty # BreakAfterAttributes: Leave BreakAfterAttributes: Never # BreakAfterJavaFieldAnnotations: false +# BreakAfterOpenBracketBracedList: false +# BreakAfterOpenBracketFunction: false +# BreakAfterOpenBracketIf: false +# BreakAfterOpenBracketLoop: false +# BreakAfterOpenBracketSwitch: false # BreakAfterReturnType: None # BreakArrays: true # BreakBeforeBinaryOperators: None BreakBeforeBinaryOperators: NonAssignment +# BreakBeforeCloseBracketBracedList: false +# BreakBeforeCloseBracketFunction: false +# BreakBeforeCloseBracketIf: false +# BreakBeforeCloseBracketLoop: false +# BreakBeforeCloseBracketSwitch: false # BreakBeforeConceptDeclarations: Always # BreakBeforeBraces: Attach # BreakBeforeInlineASMColon: OnlyMultiline +# BreakBeforeTemplateCloser: false # BreakBeforeTernaryOperators: true # BreakBinaryOperations: Never # BreakConstructorInitializers: BeforeColon @@ -160,11 +175,12 @@ ColumnLimit: 120 # CompactNamespaces: false # ConstructorInitializerIndentWidth: 4 # ContinuationIndentWidth: 4 -# Cpp11BracedListStyle: true +# Cpp11BracedListStyle: AlignFirstComment # DerivePointerAlignment: false # DisableFormat: false # EmptyLineAfterAccessModifier: Never # EmptyLineBeforeAccessModifier: LogicalBlock +# EnumTrailingComma: Leave # ExperimentalAutoDetectBinPacking: false # FixNamespaceComments: true # ForEachMacros: @@ -189,6 +205,8 @@ IncludeBlocks: Regroup # SortPriority: 0 # CaseSensitive: false IncludeCategories: + - Regex: '^$' + Priority: 5 - Regex: '^<(yvals|yvals_core)\.h>$' Priority: 10 - Regex: '^<__msvc_.*\.hpp>$' @@ -228,10 +246,16 @@ InsertNewlineAtEOF: true # InsertTrailingCommas: None # IntegerLiteralSeparator: # Binary: 0 -# BinaryMinDigits: 0 +# BinaryMinDigitsInsert: 0 +# BinaryMaxDigitsRemove: 0 # Decimal: 0 -# DecimalMinDigits: 0 +# DecimalMinDigitsInsert: 0 +# DecimalMaxDigitsRemove: 0 # Hex: 0 +# HexMinDigitsInsert: 0 +# HexMaxDigitsRemove: 0 +# BinaryMinDigits: 0 +# DecimalMinDigits: 0 # HexMinDigits: 0 # JavaScriptQuotes: Leave # JavaScriptWrapImports: true @@ -253,11 +277,17 @@ LineEnding: CRLF MaxEmptyLinesToKeep: 2 # NamespaceIndentation: None NamespaceIndentation: All +# NumericLiteralCase: +# ExponentLetter: Leave +# HexDigit: Leave +# Prefix: Leave +# Suffix: Leave # ObjCBinPackProtocolList: Auto # ObjCBlockIndentWidth: 2 # ObjCBreakBeforeNestedBlockParam: true # ObjCSpaceAfterProperty: false # ObjCSpaceBeforeProtocolList: true +# OneLineFormatOffRegex: '' # PackConstructorInitializers: BinPack # PenaltyBreakAssignment: 2 # PenaltyBreakBeforeFirstCallParameter: 19 @@ -287,12 +317,16 @@ RemoveSemicolon: true # SeparateDefinitionBlocks: Leave # ShortNamespaceLines: 1 # SkipMacroDefinitionBody: false -# SortIncludes: CaseSensitive +# SortIncludes: +# Enabled: true +# IgnoreCase: false +# IgnoreExtension: false # SortJavaStaticImport: Before # SortUsingDeclarations: LexicographicNumeric # SpaceAfterCStyleCast: false SpaceAfterCStyleCast: true # SpaceAfterLogicalNot: false +# SpaceAfterOperatorKeyword: false # SpaceAfterTemplateKeyword: true # SpaceAroundPointerQualifiers: Default # SpaceBeforeAssignmentOperators: true @@ -308,6 +342,7 @@ SpaceAfterCStyleCast: true # AfterFunctionDefinitionName: false # AfterFunctionDeclarationName: false # AfterIfMacros: true +# AfterNot: false # AfterOverloadedOperator: false # AfterPlacementOperator: true # AfterRequiresInClause: false @@ -318,7 +353,7 @@ SpaceBeforeParensOptions: AfterRequiresInClause: true # SpaceBeforeRangeBasedForLoopColon: true # SpaceBeforeSquareBrackets: false -# SpaceInEmptyBlock: false +# SpaceInEmptyBraces: Never # SpacesBeforeTrailingComments: 1 # SpacesInAngles: Never # SpacesInContainerLiterals: true diff --git a/CMakeLists.txt b/CMakeLists.txt index a73166f4be3..7ab31b3841c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -cmake_minimum_required(VERSION 4.2.3) +cmake_minimum_required(VERSION 4.3.1) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) project(msvc_standard_libraries LANGUAGES CXX) -if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.52.36307.1") - message(FATAL_ERROR "The STL must be built with MSVC Compiler 19.52.36307.1 or later. Follow the README instructions.") +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.52.36405.1") + message(FATAL_ERROR "The STL must be built with MSVC Compiler 19.52.36405.1 or later. Follow the README instructions.") endif() include(CheckCXXSourceCompiles) diff --git a/README.md b/README.md index db1f77e02ab..264412104ad 100644 --- a/README.md +++ b/README.md @@ -149,9 +149,9 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem - "C++ CMake tools for Windows" - "MSVC AddressSanitizer" - "Windows 11 SDK (10.0.28000)" or later - - "C++ Clang tools for Windows (20.1.8 - x64/x86)" + - "C++ Clang tools for Windows (22.1.3 - x64/x86)" - *Optional, see Note 2 below:* "MSVC Build Tools for ARM64/ARM64EC (Preview)" -* Install [Python][] 3.14.4 or later. +* Install [Python][] 3.14.5 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. diff --git a/azure-devops/config.yml b/azure-devops/config.yml index f4439852936..3687e79ebe0 100644 --- a/azure-devops/config.yml +++ b/azure-devops/config.yml @@ -5,13 +5,13 @@ variables: - name: x64SlowPoolName - value: 'Stl-2026-04-17T0531-x64-Fasv6-Pool' + value: 'Stl-2026-05-21T0342-x64-Fasv6-Pool' readonly: true - name: x64FastPoolName - value: 'Stl-2026-04-17T0531-x64-Fasv7-Pool' + value: 'Stl-2026-05-21T0342-x64-Fasv7-Pool' readonly: true - name: arm64PoolName - value: 'Stl-2026-04-17T0531-arm64-Dpsv6-Pool' + value: 'Stl-2026-05-21T0342-arm64-Dpsv6-Pool' readonly: true - name: poolDemands value: 'EnableSpotVM -equals false' diff --git a/azure-devops/create-1es-hosted-pool.ps1 b/azure-devops/create-1es-hosted-pool.ps1 index aa1ffe229e5..ba07c5aa5cc 100644 --- a/azure-devops/create-1es-hosted-pool.ps1 +++ b/azure-devops/create-1es-hosted-pool.ps1 @@ -49,7 +49,7 @@ if ($VMSku -ieq 'Fasv6') { $AvailableLocations = @('eastus2', 'northeurope', 'uksouth') } -$AvailableLocationIdx = 8 # Increment for each new set of pools, to cycle through the available locations. +$AvailableLocationIdx = 9 # Increment for each new set of pools, to cycle through the available locations. $Location = $AvailableLocations[$AvailableLocationIdx % $AvailableLocations.Length] if ($Arch -ieq 'x64') { diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index a4a059a30e7..9122db44804 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -58,17 +58,17 @@ foreach ($workload in $VisualStudioWorkloads) { # https://github.com/PowerShell/PowerShell/releases/latest if ($Provisioning_x64) { - $PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.0/PowerShell-7.6.0-win-x64.msi' + $PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.1/PowerShell-7.6.1-win-x64.msi' } else { - $PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.0/PowerShell-7.6.0-win-arm64.msi' + $PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.1/PowerShell-7.6.1-win-arm64.msi' } $PowerShellArgs = @('/quiet', '/norestart') # https://www.python.org if ($Provisioning_x64) { - $PythonUrl = 'https://www.python.org/ftp/python/3.14.4/python-3.14.4-amd64.exe' + $PythonUrl = 'https://www.python.org/ftp/python/3.14.5/python-3.14.5-amd64.exe' } else { - $PythonUrl = 'https://www.python.org/ftp/python/3.14.4/python-3.14.4-arm64.exe' + $PythonUrl = 'https://www.python.org/ftp/python/3.14.5/python-3.14.5-arm64.exe' } $PythonArgs = @('/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'CompileAll=1', 'Include_doc=0') diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 3e0e593201d..a6d3a722103 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -cmake_minimum_required(VERSION 4.2.3) +cmake_minimum_required(VERSION 4.3.1) project(msvc_standard_libraries_benchmarks LANGUAGES CXX) if(DEFINED STL_BINARY_DIR) diff --git a/benchmarks/src/adjacent_difference.cpp b/benchmarks/src/adjacent_difference.cpp index 9d38daf6cde..2011e064943 100644 --- a/benchmarks/src/adjacent_difference.cpp +++ b/benchmarks/src/adjacent_difference.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/adjacent_find.cpp b/benchmarks/src/adjacent_find.cpp index 4d436d35f9f..dfe8654bd2a 100644 --- a/benchmarks/src/adjacent_find.cpp +++ b/benchmarks/src/adjacent_find.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/any_swap.cpp b/benchmarks/src/any_swap.cpp index 4d2ec21744d..0c524bbaba4 100644 --- a/benchmarks/src/any_swap.cpp +++ b/benchmarks/src/any_swap.cpp @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include + #include #include -#include #include using trivial = std::array; diff --git a/benchmarks/src/bitset_from_string.cpp b/benchmarks/src/bitset_from_string.cpp index 26703ecd803..bb7701402a5 100644 --- a/benchmarks/src/bitset_from_string.cpp +++ b/benchmarks/src/bitset_from_string.cpp @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include + #include #include -#include #include #include #include diff --git a/benchmarks/src/bitset_to_string.cpp b/benchmarks/src/bitset_to_string.cpp index 43a54c2b1d1..7eab5e391eb 100644 --- a/benchmarks/src/bitset_to_string.cpp +++ b/benchmarks/src/bitset_to_string.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/charconv_floats.cpp b/benchmarks/src/charconv_floats.cpp index 7da1eb87fd0..caf1dba62d0 100644 --- a/benchmarks/src/charconv_floats.cpp +++ b/benchmarks/src/charconv_floats.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include #include diff --git a/benchmarks/src/efficient_nonlocking_print.cpp b/benchmarks/src/efficient_nonlocking_print.cpp index 1a6381f8436..8fb13d25bca 100644 --- a/benchmarks/src/efficient_nonlocking_print.cpp +++ b/benchmarks/src/efficient_nonlocking_print.cpp @@ -5,6 +5,7 @@ // --benchmark_out=efficient_nonlocking_print.log --benchmark_out_format=console #include + #include #include #include diff --git a/benchmarks/src/filesystem.cpp b/benchmarks/src/filesystem.cpp index 120aa107ca9..b265cec57a1 100644 --- a/benchmarks/src/filesystem.cpp +++ b/benchmarks/src/filesystem.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include diff --git a/benchmarks/src/fill.cpp b/benchmarks/src/fill.cpp index 232a7841d3c..bb88d52b734 100644 --- a/benchmarks/src/fill.cpp +++ b/benchmarks/src/fill.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include diff --git a/benchmarks/src/find_and_count.cpp b/benchmarks/src/find_and_count.cpp index e4735adf029..651228e3a94 100644 --- a/benchmarks/src/find_and_count.cpp +++ b/benchmarks/src/find_and_count.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/find_first_of.cpp b/benchmarks/src/find_first_of.cpp index 649c7934713..5d3f51dfae3 100644 --- a/benchmarks/src/find_first_of.cpp +++ b/benchmarks/src/find_first_of.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/flat_meow_assign.cpp b/benchmarks/src/flat_meow_assign.cpp index 980da7521ed..9d2189c584a 100644 --- a/benchmarks/src/flat_meow_assign.cpp +++ b/benchmarks/src/flat_meow_assign.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include #include diff --git a/benchmarks/src/has_single_bit.cpp b/benchmarks/src/has_single_bit.cpp index 3e8255b5343..af9af72ab01 100644 --- a/benchmarks/src/has_single_bit.cpp +++ b/benchmarks/src/has_single_bit.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include diff --git a/benchmarks/src/includes.cpp b/benchmarks/src/includes.cpp index 3967af2d212..d68bbf8ce43 100644 --- a/benchmarks/src/includes.cpp +++ b/benchmarks/src/includes.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/integer_to_string.cpp b/benchmarks/src/integer_to_string.cpp index eeedde01f7b..70adb9f2d26 100644 --- a/benchmarks/src/integer_to_string.cpp +++ b/benchmarks/src/integer_to_string.cpp @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include + #include #include -#include #include #include #include diff --git a/benchmarks/src/iota.cpp b/benchmarks/src/iota.cpp index 0cf9162bc8d..ed0c1836013 100644 --- a/benchmarks/src/iota.cpp +++ b/benchmarks/src/iota.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include #include diff --git a/benchmarks/src/is_sorted_until.cpp b/benchmarks/src/is_sorted_until.cpp index 66b60d897d6..12ecf870a52 100644 --- a/benchmarks/src/is_sorted_until.cpp +++ b/benchmarks/src/is_sorted_until.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/locale_classic.cpp b/benchmarks/src/locale_classic.cpp index aa4a739a27e..30ae1d3a44c 100644 --- a/benchmarks/src/locale_classic.cpp +++ b/benchmarks/src/locale_classic.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include using namespace std; diff --git a/benchmarks/src/minmax_element.cpp b/benchmarks/src/minmax_element.cpp index 3ade85d7ea8..a62a75741cb 100644 --- a/benchmarks/src/minmax_element.cpp +++ b/benchmarks/src/minmax_element.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/mismatch.cpp b/benchmarks/src/mismatch.cpp index 0fbcd587fa1..76701ddb222 100644 --- a/benchmarks/src/mismatch.cpp +++ b/benchmarks/src/mismatch.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/move_only_function.cpp b/benchmarks/src/move_only_function.cpp index c5f108d25c8..91a63b1e374 100644 --- a/benchmarks/src/move_only_function.cpp +++ b/benchmarks/src/move_only_function.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include diff --git a/benchmarks/src/nth_element.cpp b/benchmarks/src/nth_element.cpp index 7c6cc99affb..80aef54ddcf 100644 --- a/benchmarks/src/nth_element.cpp +++ b/benchmarks/src/nth_element.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/path_lexically_normal.cpp b/benchmarks/src/path_lexically_normal.cpp index 24b308ab6c5..02d4f2017f3 100644 --- a/benchmarks/src/path_lexically_normal.cpp +++ b/benchmarks/src/path_lexically_normal.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include diff --git a/benchmarks/src/priority_queue_push_range.cpp b/benchmarks/src/priority_queue_push_range.cpp index c8d14957f80..5e629ea7a6c 100644 --- a/benchmarks/src/priority_queue_push_range.cpp +++ b/benchmarks/src/priority_queue_push_range.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/random_integer_generation.cpp b/benchmarks/src/random_integer_generation.cpp index dcc441fa7a4..adedb43760e 100644 --- a/benchmarks/src/random_integer_generation.cpp +++ b/benchmarks/src/random_integer_generation.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include diff --git a/benchmarks/src/ranges_div_ceil.cpp b/benchmarks/src/ranges_div_ceil.cpp index 2d6a927e8c1..adfde0404dc 100644 --- a/benchmarks/src/ranges_div_ceil.cpp +++ b/benchmarks/src/ranges_div_ceil.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include #include diff --git a/benchmarks/src/regex_match.cpp b/benchmarks/src/regex_match.cpp index 56fa702721e..a599afd9055 100644 --- a/benchmarks/src/regex_match.cpp +++ b/benchmarks/src/regex_match.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include #include diff --git a/benchmarks/src/regex_search.cpp b/benchmarks/src/regex_search.cpp index 013a101712b..b8f38c421cb 100644 --- a/benchmarks/src/regex_search.cpp +++ b/benchmarks/src/regex_search.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include diff --git a/benchmarks/src/remove.cpp b/benchmarks/src/remove.cpp index 61a7b772918..bc4dfa00c0a 100644 --- a/benchmarks/src/remove.cpp +++ b/benchmarks/src/remove.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include diff --git a/benchmarks/src/replace.cpp b/benchmarks/src/replace.cpp index 28ab1c12ddb..7934b1eb91d 100644 --- a/benchmarks/src/replace.cpp +++ b/benchmarks/src/replace.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include diff --git a/benchmarks/src/reverse.cpp b/benchmarks/src/reverse.cpp index b0e0e6cefe0..706e405e263 100644 --- a/benchmarks/src/reverse.cpp +++ b/benchmarks/src/reverse.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include diff --git a/benchmarks/src/rotate.cpp b/benchmarks/src/rotate.cpp index 8852956b47e..5fd2e36b72b 100644 --- a/benchmarks/src/rotate.cpp +++ b/benchmarks/src/rotate.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include diff --git a/benchmarks/src/sample.cpp b/benchmarks/src/sample.cpp index c4afd351daf..021a02600b1 100644 --- a/benchmarks/src/sample.cpp +++ b/benchmarks/src/sample.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/search.cpp b/benchmarks/src/search.cpp index fe4296b9398..ffaf737bd26 100644 --- a/benchmarks/src/search.cpp +++ b/benchmarks/src/search.cpp @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include + #include #include -#include #include #include #include diff --git a/benchmarks/src/search_n.cpp b/benchmarks/src/search_n.cpp index ee65c6d79a5..bd2de090aae 100644 --- a/benchmarks/src/search_n.cpp +++ b/benchmarks/src/search_n.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/shuffle.cpp b/benchmarks/src/shuffle.cpp index 97fee454e42..32b7d5365dd 100644 --- a/benchmarks/src/shuffle.cpp +++ b/benchmarks/src/shuffle.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/std_copy.cpp b/benchmarks/src/std_copy.cpp index eba6cbc2314..b47c5be14e8 100644 --- a/benchmarks/src/std_copy.cpp +++ b/benchmarks/src/std_copy.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/sv_equal.cpp b/benchmarks/src/sv_equal.cpp index 67e09846ccc..eb2e69cc793 100644 --- a/benchmarks/src/sv_equal.cpp +++ b/benchmarks/src/sv_equal.cpp @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include + #include #include -#include #include #include #include diff --git a/benchmarks/src/swap_ranges.cpp b/benchmarks/src/swap_ranges.cpp index 19d3906e232..a7a5720415c 100644 --- a/benchmarks/src/swap_ranges.cpp +++ b/benchmarks/src/swap_ranges.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/uninitialized_copy.cpp b/benchmarks/src/uninitialized_copy.cpp index 06e18dbe716..a6eda2c04b0 100644 --- a/benchmarks/src/uninitialized_copy.cpp +++ b/benchmarks/src/uninitialized_copy.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include + #include #include #include diff --git a/benchmarks/src/unique.cpp b/benchmarks/src/unique.cpp index 4baef63aa76..d07f6f0cf89 100644 --- a/benchmarks/src/unique.cpp +++ b/benchmarks/src/unique.cpp @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include + +#include #include #include #include diff --git a/benchmarks/src/vector_bool_copy.cpp b/benchmarks/src/vector_bool_copy.cpp index 9c7bb5827d1..7676d0a62f5 100644 --- a/benchmarks/src/vector_bool_copy.cpp +++ b/benchmarks/src/vector_bool_copy.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -// + #include #include #include diff --git a/benchmarks/src/vector_bool_copy_n.cpp b/benchmarks/src/vector_bool_copy_n.cpp index 2ade38c90f4..3b666a1b345 100644 --- a/benchmarks/src/vector_bool_copy_n.cpp +++ b/benchmarks/src/vector_bool_copy_n.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -// + #include #include #include diff --git a/benchmarks/src/vector_bool_count.cpp b/benchmarks/src/vector_bool_count.cpp index 65ad7fb9b91..01b97a0fb91 100644 --- a/benchmarks/src/vector_bool_count.cpp +++ b/benchmarks/src/vector_bool_count.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -// + #include #include #include diff --git a/benchmarks/src/vector_bool_meow_of.cpp b/benchmarks/src/vector_bool_meow_of.cpp index dd5c87011a6..3a1df559fbf 100644 --- a/benchmarks/src/vector_bool_meow_of.cpp +++ b/benchmarks/src/vector_bool_meow_of.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -// + #include #include #include diff --git a/benchmarks/src/vector_bool_move.cpp b/benchmarks/src/vector_bool_move.cpp index a8c3e693616..b6d8b0113ce 100644 --- a/benchmarks/src/vector_bool_move.cpp +++ b/benchmarks/src/vector_bool_move.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -// + #include #include #include diff --git a/benchmarks/src/vector_bool_transform.cpp b/benchmarks/src/vector_bool_transform.cpp index 781b688a1c3..443dc0f0adb 100644 --- a/benchmarks/src/vector_bool_transform.cpp +++ b/benchmarks/src/vector_bool_transform.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -// + #include #include #include diff --git a/stl/inc/__msvc_iter_core.hpp b/stl/inc/__msvc_iter_core.hpp index d79d5db7777..439e8bf0615 100644 --- a/stl/inc/__msvc_iter_core.hpp +++ b/stl/inc/__msvc_iter_core.hpp @@ -263,7 +263,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_print.hpp b/stl/inc/__msvc_print.hpp index 4a86e364bf7..5f6d36cd098 100644 --- a/stl/inc/__msvc_print.hpp +++ b/stl/inc/__msvc_print.hpp @@ -48,15 +48,15 @@ struct __std_unicode_console_retrieval_result { __std_win_error _Error; }; -_NODISCARD _Success_(return._Error == __std_win_error::_Success) __std_unicode_console_retrieval_result - __stdcall __std_get_unicode_console_handle_from_file_stream(_In_ FILE* _Stream) noexcept; +_NODISCARD _Success_(return._Error == __std_win_error::_Success) __std_unicode_console_retrieval_result __stdcall + __std_get_unicode_console_handle_from_file_stream(_In_ FILE* _Stream) noexcept; -_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_print_to_unicode_console(_In_ __std_unicode_console_handle _Console_handle, - _In_reads_(_Str_size) const char* _Str, _In_ size_t _Str_size) noexcept; +_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error __stdcall __std_print_to_unicode_console( + _In_ __std_unicode_console_handle _Console_handle, _In_reads_(_Str_size) const char* _Str, + _In_ size_t _Str_size) noexcept; -_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_print_newline_only_to_unicode_console(_In_ __std_unicode_console_handle _Console_handle) noexcept; +_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error __stdcall + __std_print_newline_only_to_unicode_console(_In_ __std_unicode_console_handle _Console_handle) noexcept; } // extern "C" diff --git a/stl/inc/__msvc_ranges_to.hpp b/stl/inc/__msvc_ranges_to.hpp index c2313b212d2..fa14c67ff18 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: @@ -1047,7 +1047,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Rng&& _Range, _Fn _Fun) 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 ad74c69f8e3..a3dafcdf83a 100644 --- a/stl/inc/__msvc_ranges_tuple_formatter.hpp +++ b/stl/inc/__msvc_ranges_tuple_formatter.hpp @@ -271,7 +271,7 @@ class _NO_SPECIALIZATIONS_CITING("N5014 [format.arg]/2") basic_format_arg { } }; -#if defined(__clang__) || defined(__CUDACC__) // TRANSITION, LLVM-81774, DevCom-10863472 (still needed by CUDA 13.2) +#ifdef __CUDACC__ // TRANSITION, DevCom-10863472 (still needed by CUDA 13.2) basic_format_arg() noexcept : _Active_state(_Basic_format_arg_type::_None), _No_state() {} #else // ^^^ workaround / no workaround vvv basic_format_arg() noexcept = default; diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 582f7d627cc..73e3b0d1380 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -1940,7 +1940,7 @@ namespace ranges { _STD _Seek_wrapped(_First, _ULast); const auto _Count = _RANGES _Idl_distance<_It1>(_UFirst, _ULast); auto _UOutput = _STD _Copy_backward_unchecked( - _STD move(_UFirst), _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), -_Count)); + _STD move(_UFirst), _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), -_Count)); _STD _Seek_wrapped(_Output, _STD move(_UOutput)); return {_STD move(_First), _STD move(_Output)}; } @@ -1951,7 +1951,7 @@ namespace ranges { auto _ULast = _RANGES _Get_final_iterator_unwrapped(_Range); const auto _Count = _RANGES _Idl_distance(_Range); auto _UOutput = _STD _Copy_backward_unchecked( - _Ubegin(_Range), _ULast, _STD _Get_unwrapped_n(_STD move(_Output), -_Count)); + _Ubegin(_Range), _ULast, _STD _Get_unwrapped_n(_STD move(_Output), -_Count)); _STD _Seek_wrapped(_Output, _STD move(_UOutput)); return {_RANGES _Rewrap_iterator(_Range, _STD move(_ULast)), _STD move(_Output)}; } @@ -2075,7 +2075,7 @@ namespace ranges { auto _ULast = _RANGES _Unwrap_sent<_It>(_STD move(_Last)); const auto _Count = _RANGES _Idl_distance<_It>(_UFirst, _ULast); auto _UResult = _RANGES _Move_unchecked( - _STD move(_UFirst), _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), _Count)); + _STD move(_UFirst), _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), _Count)); _STD _Seek_wrapped(_First, _STD move(_UResult.in)); _STD _Seek_wrapped(_Output, _STD move(_UResult.out)); @@ -2128,7 +2128,7 @@ namespace ranges { _STD _Seek_wrapped(_First, _ULast); const auto _Count = _RANGES _Idl_distance<_It1>(_UFirst, _ULast); auto _UOutput = _RANGES _Move_backward_common( - _STD move(_UFirst), _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), -_Count)); + _STD move(_UFirst), _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), -_Count)); _STD _Seek_wrapped(_Output, _STD move(_UOutput)); return {_STD move(_First), _STD move(_Output)}; } @@ -2139,7 +2139,7 @@ namespace ranges { auto _ULast = _RANGES _Get_final_iterator_unwrapped(_Range); const auto _Count = _RANGES _Idl_distance(_Range); auto _UOutput = _RANGES _Move_backward_common( - _Ubegin(_Range), _ULast, _STD _Get_unwrapped_n(_STD move(_Output), -_Count)); + _Ubegin(_Range), _ULast, _STD _Get_unwrapped_n(_STD move(_Output), -_Count)); _STD _Seek_wrapped(_Output, _STD move(_UOutput)); return {_RANGES _Rewrap_iterator(_Range, _STD move(_ULast)), _STD move(_Output)}; } @@ -3951,7 +3951,7 @@ _NODISCARD _CONSTEXPR20 _FwdIt1 find_first_of( if (!_STD _Is_constant_evaluated() && _ULast1 - _UFirst1 >= _Threshold_find_first_of) { const auto _First1_ptr = _STD _To_address(_UFirst1); const auto _Result = _STD _Find_first_of_vectorized( - _First1_ptr, _STD _To_address(_ULast1), _STD _To_address(_UFirst2), _STD _To_address(_ULast2)); + _First1_ptr, _STD _To_address(_ULast1), _STD _To_address(_UFirst2), _STD _To_address(_ULast2)); if constexpr (is_pointer_v) { _UFirst1 = _Result; @@ -4691,7 +4691,7 @@ namespace ranges { auto _ULast = _RANGES _Unwrap_sent<_It>(_STD move(_Last)); const auto _Count = _RANGES _Idl_distance<_It>(_UFirst, _ULast); auto _UResult = _Replace_copy_common(_STD move(_UFirst), _STD move(_ULast), - _STD _Get_unwrapped_n(_STD move(_Output), _Count), _Oldval, _Newval, _STD _Pass_fn(_Proj)); + _STD _Get_unwrapped_n(_STD move(_Output), _Count), _Oldval, _Newval, _STD _Pass_fn(_Proj)); _STD _Seek_wrapped(_First, _STD move(_UResult.in)); _STD _Seek_wrapped(_Output, _STD move(_UResult.out)); @@ -4706,7 +4706,7 @@ namespace ranges { const auto _Count = _RANGES _Idl_distance(_Range); auto _First = _RANGES begin(_Range); auto _UResult = _Replace_copy_common(_RANGES _Unwrap_range_iter<_Rng>(_STD move(_First)), _Uend(_Range), - _STD _Get_unwrapped_n(_STD move(_Output), _Count), _Oldval, _Newval, _STD _Pass_fn(_Proj)); + _STD _Get_unwrapped_n(_STD move(_Output), _Count), _Oldval, _Newval, _STD _Pass_fn(_Proj)); _STD _Seek_wrapped(_First, _STD move(_UResult.in)); _STD _Seek_wrapped(_Output, _STD move(_UResult.out)); @@ -6110,7 +6110,7 @@ namespace ranges { auto _ULast = _RANGES _Unwrap_sent<_It>(_STD move(_Last)); const auto _Count = _RANGES _Idl_distance<_It>(_UFirst, _ULast); auto _UResult = _Rotate_copy_common(_STD move(_UFirst), _RANGES _Unwrap_iter<_Se>(_STD move(_Mid)), - _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), _Count)); + _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), _Count)); _STD _Seek_wrapped(_First, _STD move(_UResult.in)); _STD _Seek_wrapped(_Output, _STD move(_UResult.out)); @@ -6125,7 +6125,7 @@ namespace ranges { _STD _Adl_verify_range(_Mid, _RANGES end(_Range)); const auto _Count = _RANGES _Idl_distance(_Range); auto _UResult = _Rotate_copy_common(_Ubegin(_Range), _RANGES _Unwrap_range_iter<_Rng>(_STD move(_Mid)), - _Uend(_Range), _STD _Get_unwrapped_n(_STD move(_Output), _Count)); + _Uend(_Range), _STD _Get_unwrapped_n(_STD move(_Output), _Count)); _STD _Seek_wrapped(_Output, _STD move(_UResult.out)); return {_RANGES _Rewrap_iterator(_Range, _STD move(_UResult.in)), _STD move(_Output)}; } @@ -7906,7 +7906,7 @@ namespace ranges { auto _UFirst = _RANGES _Unwrap_iter<_Se>(_STD move(_First)); const auto _Count = _RANGES distance(_UFirst, _RANGES _Unwrap_sent<_It>(_STD move(_Last))); _UFirst = _RANGES _Lower_bound_unchecked( - _STD move(_UFirst), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); + _STD move(_UFirst), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); _STD _Seek_wrapped(_First, _STD move(_UFirst)); return _First; } @@ -7917,7 +7917,7 @@ namespace ranges { _Rng&& _Range, const _Ty& _Val, _Pr _Pred = {}, _Pj _Proj = {}) { const auto _Count = _RANGES distance(_Range); auto _UResult = _RANGES _Lower_bound_unchecked( - _Ubegin(_Range), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); + _Ubegin(_Range), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); return _RANGES _Rewrap_iterator(_Range, _STD move(_UResult)); } }; @@ -7956,7 +7956,7 @@ namespace ranges { auto _UFirst = _RANGES _Unwrap_iter<_Se>(_STD move(_First)); const auto _Count = _RANGES distance(_UFirst, _RANGES _Unwrap_sent<_It>(_STD move(_Last))); _UFirst = _RANGES _Upper_bound_unchecked( - _STD move(_UFirst), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); + _STD move(_UFirst), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); _STD _Seek_wrapped(_First, _STD move(_UFirst)); return _First; } @@ -7967,7 +7967,7 @@ namespace ranges { _Rng&& _Range, const _Ty& _Val, _Pr _Pred = {}, _Pj _Proj = {}) { const auto _Count = _RANGES distance(_Range); auto _UResult = _RANGES _Upper_bound_unchecked( - _Ubegin(_Range), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); + _Ubegin(_Range), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); return _RANGES _Rewrap_iterator(_Range, _STD move(_UResult)); } }; @@ -8110,7 +8110,7 @@ namespace ranges { const auto _ULast = _RANGES _Unwrap_sent<_It>(_STD move(_Last)); const auto _Count = _RANGES distance(_UFirst, _ULast); _UFirst = _RANGES _Lower_bound_unchecked( - _STD move(_UFirst), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); + _STD move(_UFirst), _Count, _Val, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj)); return _UFirst != _ULast && !_STD invoke(_Pred, _Val, _STD invoke(_Proj, *_UFirst)); } @@ -8240,8 +8240,8 @@ namespace ranges { const auto _Count2 = _RANGES _Idl_distance<_It2>(_UFirst2, _ULast2); const auto _Count = _STD _Idl_dist_add(_Count1, _Count2); auto _UResult = _Merge_unchecked(_STD move(_UFirst1), _STD move(_ULast1), _STD move(_UFirst2), - _STD move(_ULast2), _STD _Get_unwrapped_n(_STD move(_Output), _Count), _STD _Pass_fn(_Pred), - _STD _Pass_fn(_Proj1), _STD _Pass_fn(_Proj2)); + _STD move(_ULast2), _STD _Get_unwrapped_n(_STD move(_Output), _Count), _STD _Pass_fn(_Pred), + _STD _Pass_fn(_Proj1), _STD _Pass_fn(_Proj2)); _STD _Seek_wrapped(_First1, _STD move(_UResult.in1)); _STD _Seek_wrapped(_First2, _STD move(_UResult.in2)); _STD _Seek_wrapped(_Output, _STD move(_UResult.out)); @@ -8259,9 +8259,9 @@ namespace ranges { auto _First1 = _RANGES begin(_Range1); auto _First2 = _RANGES begin(_Range2); auto _UResult = _Merge_unchecked(_RANGES _Unwrap_range_iter<_Rng1>(_STD move(_First1)), _Uend(_Range1), - _RANGES _Unwrap_range_iter<_Rng2>(_STD move(_First2)), _Uend(_Range2), - _STD _Get_unwrapped_n(_STD move(_Output), _Count), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj1), - _STD _Pass_fn(_Proj2)); + _RANGES _Unwrap_range_iter<_Rng2>(_STD move(_First2)), _Uend(_Range2), + _STD _Get_unwrapped_n(_STD move(_Output), _Count), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj1), + _STD _Pass_fn(_Proj2)); _STD _Seek_wrapped(_First1, _STD move(_UResult.in1)); _STD _Seek_wrapped(_First2, _STD move(_UResult.in2)); _STD _Seek_wrapped(_Output, _STD move(_UResult.out)); diff --git a/stl/inc/atomic b/stl/inc/atomic index 20f3a76236f..384ebd32702 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -993,12 +993,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics void store(const _TVal _Value) noexcept { // store with sequential consistency const auto _Mem = _STD _Atomic_address_as(_Storage); const long long _As_bytes = _STD _Bit_cast(_Value); -#if defined(__clang__) && defined(_M_IX86) // TRANSITION, LLVM-126516 - static_assert(_M_IX86_FP != 0, "8 byte atomic store is not supported on clang-cl with /arch:IA32"); - __atomic_store_n(_Mem, _As_bytes, __ATOMIC_SEQ_CST); -#else // ^^^ workaround / no workaround vvv _ATOMIC_STORE_64_SEQ_CST(_Mem, _As_bytes); -#endif // ^^^ no workaround ^^^ } void store(const _TVal _Value, const memory_order _Order) noexcept { // store with given memory order @@ -1008,17 +1003,9 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics _Check_store_memory_order(_Order); if (_Order == memory_order_relaxed) { -#if defined(__clang__) && defined(_M_IX86) // TRANSITION, LLVM-126516 - __atomic_store_n(_Mem, _As_bytes, __ATOMIC_RELAXED); -#else // ^^^ workaround / no workaround vvv __iso_volatile_store64(_Mem, _As_bytes); -#endif // ^^^ no workaround ^^^ } else if (_Order == memory_order_release) { -#if defined(__clang__) && defined(_M_IX86) // TRANSITION, LLVM-126516 - __atomic_store_n(_Mem, _As_bytes, __ATOMIC_RELEASE); -#else // ^^^ workaround / no workaround vvv __STORE_RELEASE(64, _Mem, _As_bytes); -#endif // ^^^ no workaround ^^^ } else { store(_Value); } @@ -1031,12 +1018,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics #if _STD_ATOMIC_USE_ARM64_LDAR_STLR == 1 _ATOMIC_LOAD_ARM64(_As_bytes, 64, _Mem, _Order) #else // ^^^ _STD_ATOMIC_USE_ARM64_LDAR_STLR == 1 / _STD_ATOMIC_USE_ARM64_LDAR_STLR != 1 vvv -#if defined(__clang__) && defined(_M_IX86) // TRANSITION, LLVM-126516 - static_assert(_M_IX86_FP != 0, "8 byte atomic load is not supported on clang-cl with /arch:IA32"); - _As_bytes = __atomic_load_n(_Mem, __ATOMIC_RELAXED); -#else // ^^^ workaround / no workaround vvv _As_bytes = __iso_volatile_load64(_Mem); -#endif // ^^^ no workaround ^^^ _ATOMIC_POST_LOAD_BARRIER_AS_NEEDED(_Order) #endif // ^^^ _STD_ATOMIC_USE_ARM64_LDAR_STLR != 1 ^^^ return reinterpret_cast<_TVal&>(_As_bytes); diff --git a/stl/inc/chrono b/stl/inc/chrono index 1dfd8d6a3b6..c06254455d6 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -1575,11 +1575,10 @@ namespace chrono { } template - constexpr bool _Duration_underflows_with = !treat_as_floating_point_v - && _From::period::den / _STD _Gcd(_From::period::den, _To::period::den) - > INTMAX_MAX - / (_To::period::num - / _STD _Gcd(_From::period::num, _To::period::num)); + constexpr bool _Duration_underflows_with = + !treat_as_floating_point_v + && _From::period::den / _STD _Gcd(_From::period::den, _To::period::den) + > INTMAX_MAX / (_To::period::num / _STD _Gcd(_From::period::num, _To::period::num)); template _NODISCARD constexpr _To _Duration_cast_underflow_to_zero(const _From& _Dur) { @@ -3344,8 +3343,8 @@ namespace chrono { // (c) Offset to desired week. const int _Jan1_wday = _Jan1_weekday(_Year); const int _Yday = 1 + _Prev_weekday(_Starting_wday, _Jan1_wday) // (a) - + _Prev_weekday(*_Weekday, _Starting_wday) // (b) - + 7 * (_Week - 1); // (c) + + _Prev_weekday(*_Weekday, _Starting_wday) // (b) + + 7 * (_Week - 1); // (c) return _Update(_Day_of_year, _Yday) && !_Out_of_range(_Day_of_year, 1, _Days_in_year(_Year)) && _Yday_to_month_day(*_Day_of_year, _Year); } @@ -3479,9 +3478,7 @@ namespace chrono { // and calendar computations are relatively expensive. // Most time-of-day fields are deferred until we know if we're parsing a time_point. - if (_Out_of_range(_Hour_12, 1, 12) // - || _Out_of_range(_Weekday, 0, 6) // - || _Out_of_range(_Day, 1, 31) // + if (_Out_of_range(_Hour_12, 1, 12) || _Out_of_range(_Weekday, 0, 6) || _Out_of_range(_Day, 1, 31) || _Out_of_range(_Month, 1, 12)) { return false; } diff --git a/stl/inc/complex b/stl/inc/complex index 29f64e559af..3a1958fdb1d 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -167,8 +167,7 @@ namespace _Float_multi_prec { #ifdef __clang__ [[__gnu__::__target__("fma")]] #endif // defined(__clang__) - _NODISCARD inline double - _Sqr_error_x86_x64_fma(const double _Xval, const double _Prod0) noexcept { + _NODISCARD inline double _Sqr_error_x86_x64_fma(const double _Xval, const double _Prod0) noexcept { const __m128d _Mx = _mm_set_sd(_Xval); const __m128d _Mprod0 = _mm_set_sd(_Prod0); const __m128d _Mresult = _mm_fmsub_sd(_Mx, _Mx, _Mprod0); diff --git a/stl/inc/concepts b/stl/inc/concepts index 1c9674b2eae..1486abc509d 100644 --- a/stl/inc/concepts +++ b/stl/inc/concepts @@ -79,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. @@ -111,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 { @@ -160,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 @@ -176,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 @@ -242,7 +242,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 82551c1b627..a9cd2420530 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -976,8 +976,8 @@ public: } _NODISCARD size_type max_size() const noexcept { - return (_STD min) (static_cast(_STD _Max_limit()), // - _Alty_traits::max_size(_Getal())); + constexpr auto _Diff_max = static_cast(_STD _Max_limit()); + return (_STD min) (_Diff_max, _Alty_traits::max_size(_Getal())); } void resize(_CRT_GUARDOVERFLOW size_type _Newsize) { diff --git a/stl/inc/exception b/stl/inc/exception index b7bac0003b9..7804935aeb0 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -21,8 +21,8 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #if _HAS_DEPRECATED_UNCAUGHT_EXCEPTION -_EXPORT_STD extern "C++" _CXX17_DEPRECATE_UNCAUGHT_EXCEPTION _NODISCARD _CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL - uncaught_exception() noexcept; +_EXPORT_STD extern "C++" _CXX17_DEPRECATE_UNCAUGHT_EXCEPTION _NODISCARD _CRTIMP2_PURE bool + __CLRCALL_PURE_OR_CDECL uncaught_exception() noexcept; #endif // _HAS_DEPRECATED_UNCAUGHT_EXCEPTION _EXPORT_STD extern "C++" _NODISCARD _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL uncaught_exceptions() noexcept; diff --git a/stl/inc/execution b/stl/inc/execution index b3ef4f0cf9b..b45860b0310 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -3867,7 +3867,7 @@ struct _Static_partitioned_set_subtraction { const auto _Prev_chunk_sum = _Prev_chunk_lookback_data->_Sum._Ref(); auto _Chunk_specific_dest = _Dest + static_cast<_Iter_diff_t<_RanIt3>>(_Prev_chunk_sum); const auto _Num_results = _Set_oper_per_chunk._Update_dest(_Range1_chunk_first, _Range1_chunk_last, - _Range2_chunk_first, _Range2_chunk_last, _Chunk_specific_dest, _Pred); + _Range2_chunk_first, _Range2_chunk_last, _Chunk_specific_dest, _Pred); _Chunk_lookback_data->_Sum._Ref() = static_cast<_Diff>(_Num_results + _Prev_chunk_sum); _Chunk_lookback_data->_Store_available_state(_Sum_available); @@ -3880,7 +3880,7 @@ struct _Static_partitioned_set_subtraction { // Determine the indices of elements that should be in the result from this chunk. const auto _Num_results = _Set_oper_per_chunk._Mark_indices(_Range1_chunk_first, _Range1_chunk_last, - _Range2_chunk_first, _Range2_chunk_last, _Index_chunk_first, _Pred); + _Range2_chunk_first, _Range2_chunk_last, _Index_chunk_first, _Pred); _Chunk_lookback_data->_Local._Ref() = _Num_results; _Chunk_lookback_data->_Store_available_state(_Local_available); @@ -4376,7 +4376,7 @@ _NODISCARD _Ty transform_reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last // keep processing remaining chunks to comply with N4950 [intro.progress]/14 auto _Chunk = _Operation._Basis._Get_chunk(_Stolen_key); _Val = _STD transform_reduce(_Chunk._First, _Chunk._Last, _STD move(_Val), - _STD _Pass_fn(_Reduce_op), _STD _Pass_fn(_Transform_op)); + _STD _Pass_fn(_Reduce_op), _STD _Pass_fn(_Transform_op)); } } // join with _Work_ptr threads diff --git a/stl/inc/expected b/stl/inc/expected index 43cb75a31b3..7087c359141 100644 --- a/stl/inc/expected +++ b/stl/inc/expected @@ -316,13 +316,13 @@ public: template requires is_constructible_v<_Err, const _UErr&> - constexpr explicit(!is_convertible_v) expected(const unexpected<_UErr>& _Other) // + constexpr explicit(!is_convertible_v) expected(const unexpected<_UErr>& _Other) noexcept(is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened : _Unexpected(_Other._Unexpected), _Has_value(false) {} template requires is_constructible_v<_Err, _UErr> - constexpr explicit(!is_convertible_v<_UErr, _Err>) expected(unexpected<_UErr>&& _Other) // + constexpr explicit(!is_convertible_v<_UErr, _Err>) expected(unexpected<_UErr>&& _Other) noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened : _Unexpected(_STD move(_Other._Unexpected)), _Has_value(false) {} diff --git a/stl/inc/filesystem b/stl/inc/filesystem index 2af683199ee..69874884006 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -1688,8 +1688,8 @@ namespace filesystem { // the return value of `relative_path()` is lifetime-extended if necessary. const bool _Both_unc_paths = _Is_drive_prefix_with_slash_slash_question(_Text) && _Is_drive_prefix_with_slash_slash_question(_Base_raw._Text); - const path& _This = _Both_unc_paths ? relative_path() : *this; - const path& _Base = _Both_unc_paths ? _Base_raw.relative_path() : _Base_raw; + const path& _This = _Both_unc_paths ? relative_path() : *this; + const path& _Base = _Both_unc_paths ? _Base_raw.relative_path() : _Base_raw; path _Result; diff --git a/stl/inc/flat_map b/stl/inc/flat_map index ff769f612a3..fa30f1f3d38 100644 --- a/stl/inc/flat_map +++ b/stl/inc/flat_map @@ -281,7 +281,7 @@ class _Flat_map_base { private: using _Sorted_t = conditional_t<_IsUnique, sorted_unique_t, sorted_equivalent_t>; using _Derived = conditional_t<_IsUnique, flat_map<_Key, _Mapped, _Compare, _KeyContainer, _MappedContainer>, - flat_multimap<_Key, _Mapped, _Compare, _KeyContainer, _MappedContainer>>; + flat_multimap<_Key, _Mapped, _Compare, _KeyContainer, _MappedContainer>>; static constexpr const char* _Msg_not_sorted_maybe_unique = _IsUnique ? "Keys were not sorted-unique! (N5032 [flat.map.overview]/10)" @@ -1275,13 +1275,21 @@ public: } template _NODISCARD mapped_type& at(const _OtherKey& _Key_val) +#ifdef __clang__ // TRANSITION, LLVM-198663 + requires _Transparent<_Compare> +#else // ^^^ workaround / no workaround vvv requires _Transparent +#endif // ^^^ no workaround ^^^ { return _At(_Key_val); } template _NODISCARD const mapped_type& at(const _OtherKey& _Key_val) const +#ifdef __clang__ // TRANSITION, LLVM-198663 + requires _Transparent<_Compare> +#else // ^^^ workaround / no workaround vvv requires _Transparent +#endif // ^^^ no workaround ^^^ { return _At(_Key_val); } diff --git a/stl/inc/format b/stl/inc/format index a0d47967c93..67fa7afa27e 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -2115,8 +2115,7 @@ _NODISCARD _OutputIt _Write_integral( if (_Separators > 0) { return _Write_separated_integer(_Buffer_start, _End, _Groups, - _STD use_facet>(_Locale._Get()).thousands_sep(), // - _Separators, _STD move(_Out)); + _STD use_facet>(_Locale._Get()).thousands_sep(), _Separators, _STD move(_Out)); } return _Widen_and_copy<_CharT>(_Buffer_start, _End, _STD move(_Out)); }; diff --git a/stl/inc/forward_list b/stl/inc/forward_list index 26028413ebd..dc0ae54556d 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())); + constexpr auto _Diff_max = static_cast(_STD _Max_limit()); + return (_STD min) (_Diff_max, _Alnode_traits::max_size(_Getal())); } _NODISCARD_EMPTY_MEMBER bool empty() const noexcept { diff --git a/stl/inc/functional b/stl/inc/functional index 00d75668eaf..b2eacf60f63 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -154,7 +154,7 @@ struct bit_not { template <> struct divides { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) / _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) / _STD forward<_Ty2>(_Right); } @@ -165,7 +165,7 @@ struct divides { template <> struct modulus { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) % _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) % _STD forward<_Ty2>(_Right); } @@ -188,7 +188,7 @@ struct negate { template <> struct logical_and { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) && _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) && _STD forward<_Ty2>(_Right); } @@ -199,7 +199,7 @@ struct logical_and { template <> struct logical_or { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) || _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) || _STD forward<_Ty2>(_Right); } @@ -220,7 +220,7 @@ struct logical_not { template <> struct bit_and { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right); } @@ -231,7 +231,7 @@ struct bit_and { template <> struct bit_or { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right); } @@ -242,7 +242,7 @@ struct bit_or { template <> struct bit_xor { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right); } @@ -262,7 +262,7 @@ struct bit_not { struct _Bit_xnor { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(~(_STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right))) { return ~(_STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right)); } @@ -272,7 +272,7 @@ struct _Bit_xnor { struct _Bit_imply { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(~_STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right)) { return ~_STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right); } @@ -282,7 +282,7 @@ struct _Bit_imply { struct _Bit_cimply { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) | ~_STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) | ~_STD forward<_Ty2>(_Right); } @@ -292,7 +292,7 @@ struct _Bit_cimply { struct _Bit_nimply { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) & ~_STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) & ~_STD forward<_Ty2>(_Right); } @@ -302,7 +302,7 @@ struct _Bit_nimply { struct _Bit_cnimply { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const -> decltype(~_STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right)) { return ~_STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right); } @@ -697,8 +697,8 @@ public: template _CONSTEXPR20 auto operator()(_Types&&... _Args) const - noexcept(noexcept(_STD invoke(_Pm, _STD forward<_Types>(_Args)...))) // - -> decltype(_STD invoke(_Pm, _STD forward<_Types>(_Args)...)) { + noexcept(noexcept(_STD invoke(_Pm, _STD forward<_Types>(_Args)...))) + -> decltype(_STD invoke(_Pm, _STD forward<_Types>(_Args)...)) { return _STD invoke(_Pm, _STD forward<_Types>(_Args)...); } }; @@ -776,28 +776,28 @@ public: #else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv template auto operator()(_Types&&... _Args) & noexcept( - noexcept(!_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...))) // + noexcept(!_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { return !_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...); } template auto operator()(_Types&&... _Args) const& noexcept( - noexcept(!_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...))) // + noexcept(!_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { return !_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...); } template auto operator()(_Types&&... _Args) && noexcept( - noexcept(!_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...))) // + noexcept(!_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { return !_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...); } template auto operator()(_Types&&... _Args) const&& noexcept( - noexcept(!_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...))) // + noexcept(!_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { return !_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...); } @@ -2382,8 +2382,8 @@ struct _Select_fixer<_Cv_TiD, false, false, _Jx> { // placeholder fixer template constexpr auto _Fix_arg(_Cv_TiD& _Tid, _Untuple&& _Ut) - noexcept(noexcept(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)))) // - -> decltype(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut))) { // translate an argument for bind + noexcept(noexcept(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)))) + -> decltype(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut))) { // translate an argument for bind return _Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)); } diff --git a/stl/inc/list b/stl/inc/list index b1bd37d0a7f..0fa804f408a 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())); + constexpr auto _Diff_max = static_cast(_STD _Max_limit()); + return (_STD min) (_Diff_max, _Alnode_traits::max_size(_Getal())); } _NODISCARD_EMPTY_MEMBER bool empty() const noexcept { diff --git a/stl/inc/memory b/stl/inc/memory index b39ac4fb8e9..02a1772eab8 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -530,7 +530,7 @@ namespace ranges { struct _Construct_at_fn { template requires (!is_unbounded_array_v<_Ty>) && 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 constexpr _Ty* operator()(_Ty* _Location, _Types&&... _Args) noexcept( noexcept(::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ { @@ -3070,8 +3070,8 @@ _NODISCARD shared_ptr<_Ty> _Allocate_shared_unbounded_array( // make a shared_ptr to an unbounded array static_assert(is_unbounded_array_v<_Ty>); using _Refc = conditional_t<_IsForOverwrite, // - _Ref_count_unbounded_array_alloc_for_overwrite, _Alloc>, - _Ref_count_unbounded_array_alloc, _Alloc>>; + _Ref_count_unbounded_array_alloc_for_overwrite, _Alloc>, + _Ref_count_unbounded_array_alloc, _Alloc>>; constexpr size_t _Align = alignof(_Refc); using _Storage = _Alignas_storage_unit<_Align>; _Rebind_alloc_t<_Alloc, _Storage> _Rebound(_Al); diff --git a/stl/inc/random b/stl/inc/random index c329072d719..78260d357cf 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -155,8 +155,8 @@ public: template void generate(_RanIt _First, _RanIt _Last) const { // generate randomized interval from seeds - static_assert(_Is_any_of_v::value_type>, // - unsigned int, unsigned long, unsigned long long>, + using _Valty = _Iter_value_t<_RanIt>; + static_assert(_Is_any_of_v, unsigned int, unsigned long, unsigned long long>, "N4971 [rand.util.seedseq]/7 requires the value type of the iterator to be an unsigned type that is at " "least 32-bit."); @@ -172,7 +172,7 @@ public: const size_t _Mx = _Nx <= _Sx ? _Sx + 1 : _Nx; size_t _Kx; - _Iter_value_t<_RanIt> _Mask(_Iter_value_t<_RanIt>(1) << 31); + _Valty _Mask(_Valty(1) << 31); _Mask <<= 1; // build 32-bit mask safely _Mask -= 1; diff --git a/stl/inc/ranges b/stl/inc/ranges index 83c13e9cb70..07b5d1e511d 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -647,7 +647,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)); @@ -734,8 +734,8 @@ namespace ranges { return *this; } - constexpr _Ioterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_Wi> // - && noexcept(--_Current)) /* strengthened */ + constexpr _Ioterator operator--(int) + noexcept(is_nothrow_copy_constructible_v<_Wi> && noexcept(--_Current)) /* strengthened */ requires _Decrementable<_Wi> { auto _Tmp = *this; @@ -1044,7 +1044,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Ty&& _Val) 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)); } @@ -1052,7 +1052,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Ty1&& _Start, _Ty2&& _Bound) 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)); } @@ -1544,7 +1544,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 constexpr auto operator()(_Rng&& _Range, _Pr&& _Pred) 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)); } @@ -2300,7 +2300,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Rng&& _Range, _Pr _Pred) 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)); } @@ -2625,7 +2625,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Rng&& _Range, _Pr _Pred) 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)); } @@ -3055,7 +3055,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Rng&& _Range) 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)}; } @@ -4026,7 +4026,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Rng&& _Range, _Pat&& _Pattern) 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)); } @@ -4067,7 +4067,7 @@ namespace ranges { _Iterator() = default; - constexpr _Iterator(split_view& _Parent_, iterator_t<_Vw> _Current_, subrange> _Next_) // + constexpr _Iterator(split_view& _Parent_, iterator_t<_Vw> _Current_, subrange> _Next_) noexcept(is_nothrow_move_constructible_v>) // strengthened : _Parent{_STD addressof(_Parent_)}, _Current{_STD move(_Current_)}, _Next{_STD move(_Next_)} {} @@ -4211,7 +4211,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Rng&& _Range, _Pat&& _Pattern) 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)); } @@ -4494,10 +4494,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: @@ -4637,7 +4637,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: @@ -4785,7 +4785,7 @@ namespace ranges { } _NODISCARD constexpr decltype(auto) operator*() const - noexcept(is_nothrow_move_constructible_v>> // + noexcept(is_nothrow_move_constructible_v>> && noexcept(_STD get<_Index>(*_Current))) /* strengthened */ { using _ElemTy = remove_cv_t>>; return static_cast<_ElemTy>(_STD get<_Index>(*_Current)); @@ -4868,7 +4868,7 @@ namespace ranges { } _NODISCARD constexpr decltype(auto) operator[](const difference_type _Idx) const - noexcept(is_nothrow_move_constructible_v>> // + noexcept(is_nothrow_move_constructible_v>> && noexcept(_STD get<_Index>(*(_Current + _Idx)))) /* strengthened */ requires random_access_range<_Base> { @@ -5114,7 +5114,7 @@ namespace ranges { template _NODISCARD static constexpr auto operator()(_Rng&& _Range) 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)}; } @@ -5156,8 +5156,8 @@ namespace ranges { public: using iterator_category = input_iterator_tag; using iterator_concept = conditional_t, random_access_iterator_tag, - conditional_t, bidirectional_iterator_tag, - conditional_t, forward_iterator_tag, input_iterator_tag>>>; + conditional_t, bidirectional_iterator_tag, + conditional_t, forward_iterator_tag, input_iterator_tag>>>; using difference_type = range_difference_t<_Base_t>; using value_type = tuple>; @@ -5365,14 +5365,14 @@ namespace ranges { }; template - static constexpr bool _Is_end_nothrow_v = is_nothrow_move_constructible_v> // - && noexcept(_RANGES end(_STD declval<_Rng&>())); + static constexpr bool _Is_end_nothrow_v = + is_nothrow_move_constructible_v> && noexcept(_RANGES end(_STD declval<_Rng&>())); template requires common_range<_Rng> && sized_range<_Rng> - static constexpr bool _Is_end_nothrow_v<_Rng> = is_nothrow_move_constructible_v> // - && noexcept(_RANGES end(_STD declval<_Rng&>())) // - && noexcept(_RANGES distance(_STD declval<_Rng&>())); + static constexpr bool _Is_end_nothrow_v<_Rng> = + is_nothrow_move_constructible_v> && noexcept(_RANGES end(_STD declval<_Rng&>())) + && noexcept(_RANGES distance(_STD declval<_Rng&>())); public: constexpr enumerate_view() @@ -5755,9 +5755,8 @@ namespace ranges { range_difference_t<_Base> _Count = 0; range_difference_t<_Base> _Missing = 0; - constexpr _Iterator(_ParentTy* _Parent, _Base_iterator _Current_, - range_difference_t<_Base> _Missing_ = 0) // - noexcept(noexcept(_RANGES end(_Parent->_Range)) && is_nothrow_move_constructible_v<_Base_iterator> // + constexpr _Iterator(_ParentTy* _Parent, _Base_iterator _Current_, range_difference_t<_Base> _Missing_ = 0) + noexcept(noexcept(_RANGES end(_Parent->_Range)) && is_nothrow_move_constructible_v<_Base_iterator> && is_nothrow_move_constructible_v<_Base_sentinel>) /* strengthened */ : _Current(_STD move(_Current_)), _End(_RANGES end(_Parent->_Range)), _Count(_Parent->_Count), _Missing(_Missing_) {} @@ -5765,7 +5764,7 @@ namespace ranges { public: using iterator_category = input_iterator_tag; using iterator_concept = conditional_t, random_access_iterator_tag, - conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; + conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; using value_type = decltype(views::take(subrange(_Current, _End), _Count)); using difference_type = range_difference_t<_Base>; @@ -6131,7 +6130,7 @@ namespace ranges { requires (!_Slide_caches_first<_Base>) : _Current(_STD move(_Current_)), _Count(_Count_) {} - constexpr _Iterator(_Base_iterator _Current_, _Base_iterator _Last_, range_difference_t<_Base> _Count_) // + constexpr _Iterator(_Base_iterator _Current_, _Base_iterator _Last_, range_difference_t<_Base> _Count_) noexcept(is_nothrow_move_constructible_v<_Base_iterator>) /* strengthened */ requires _Slide_caches_first<_Base> : _Iter_base<_Base>(_STD move(_Last_)), _Current(_STD move(_Current_)), _Count(_Count_) {} @@ -6141,7 +6140,7 @@ namespace ranges { using difference_type = range_difference_t<_Base>; using iterator_category = input_iterator_tag; using iterator_concept = conditional_t, random_access_iterator_tag, - conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; + conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; _Iterator() = default; @@ -6164,8 +6163,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator++(int) noexcept(is_nothrow_copy_constructible_v<_Base_iterator> // - && noexcept(++_Current)) /* strengthened */ { + constexpr _Iterator operator++(int) + noexcept(is_nothrow_copy_constructible_v<_Base_iterator> && noexcept(++_Current)) /* strengthened */ { auto _Tmp = *this; ++*this; return _Tmp; @@ -6182,8 +6181,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_Base_iterator> // - && noexcept(--_Current)) /* strengthened */ + constexpr _Iterator operator--(int) + noexcept(is_nothrow_copy_constructible_v<_Base_iterator> && noexcept(--_Current)) /* strengthened */ requires bidirectional_range<_Base> { auto _Tmp = *this; @@ -6712,8 +6711,8 @@ namespace ranges { range_difference_t<_Base> _Missing = 0; constexpr _Iterator(_ParentTy* _Parent, _Base_iterator _Current_, - range_difference_t<_Base> _Missing_ = 0) // - noexcept(noexcept(_RANGES end(_Parent->_Range)) && is_nothrow_move_constructible_v<_Base_iterator> // + range_difference_t<_Base> _Missing_ = 0) + noexcept(noexcept(_RANGES end(_Parent->_Range)) && is_nothrow_move_constructible_v<_Base_iterator> && is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened : _Current(_STD move(_Current_)), _End(_RANGES end(_Parent->_Range)), _Stride(_Parent->_Stride), _Missing(_Missing_) {} @@ -6903,7 +6902,7 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) // + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) // strengthened requires sized_sentinel_for<_Base_iterator, _Base_iterator> { @@ -7119,10 +7118,9 @@ namespace ranges { noexcept((noexcept(static_cast<_ResultType>( _STD declval() - _STD declval())) && ...)) { - constexpr bool _Is_noexcept = - (noexcept(static_cast<_ResultType>( // - _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) { @@ -7637,7 +7635,7 @@ namespace ranges { public: using iterator_concept = _Ziperator<_IsConst>::iterator_concept; using value_type = remove_cvref_t&, - range_reference_t<_Maybe_const<_IsConst, _ViewTypes>>...>>; + range_reference_t<_Maybe_const<_IsConst, _ViewTypes>>...>>; using difference_type = range_difference_t<_Base_t>; _Iterator() = default; @@ -7661,8 +7659,8 @@ namespace ranges { ++*this; } - constexpr _Iterator operator++(int) noexcept(is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(++*this)) // strengthened + constexpr _Iterator operator++(int) + noexcept(is_nothrow_copy_constructible_v<_Iterator> && noexcept(++*this)) // strengthened requires forward_range<_Base_t> { auto _Temp = *this; @@ -7677,8 +7675,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(--*this)) // strengthened + constexpr _Iterator operator--(int) + noexcept(is_nothrow_copy_constructible_v<_Iterator> && noexcept(--*this)) // strengthened requires bidirectional_range<_Base_t> { auto _Temp = *this; @@ -8035,7 +8033,7 @@ namespace ranges { public: using iterator_category = input_iterator_tag; using iterator_concept = conditional_t, random_access_iterator_tag, - conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; + conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; using value_type = _Repeated_tuple, _Nx>; using difference_type = range_difference_t<_Base>; @@ -8433,7 +8431,7 @@ namespace ranges { using iterator_category = decltype(_Get_iterator_category()); using iterator_concept = _Inner_iterator<_Const>::iterator_concept; using value_type = remove_cvref_t< - _Invoke_result_with_repeated_type<_Maybe_const<_Const, _Fn>&, range_reference_t<_Base>, _Nx>>; + _Invoke_result_with_repeated_type<_Maybe_const<_Const, _Fn>&, range_reference_t<_Base>, _Nx>>; using difference_type = range_difference_t<_Base>; _Iterator() = default; @@ -8564,7 +8562,7 @@ namespace ranges { return _Iterator{*_It._Parent, _It._Inner - _Off}; } - _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) // + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) noexcept(noexcept(_Left._Inner - _Right._Inner)) // strengthened requires sized_sentinel_for<_Inner_iterator<_Const>, _Inner_iterator<_Const>> { @@ -8827,7 +8825,7 @@ namespace ranges { using value_type = tuple>, range_value_t<_Maybe_const<_Const, _Rest>>...>; using reference = tuple>, - range_reference_t<_Maybe_const<_Const, _Rest>>...>; + range_reference_t<_Maybe_const<_Const, _Rest>>...>; using difference_type = _Difference_type<_Const>; private: diff --git a/stl/inc/string b/stl/inc/string index 51661e2ad8f..118f976a8c1 100644 --- a/stl/inc/string +++ b/stl/inc/string @@ -7,11 +7,12 @@ #define _STRING_ #include #if _STL_COMPILER_PREPROCESSOR -#include // The include below is to workaround many projects that assumed // includes it. We workaround it instead of fixing all the upstream // projects because is inexpensive. See VSO-663136. -#include + +#include // TRANSITION, see note +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/tuple b/stl/inc/tuple index 90544cb17fb..c560c46fb18 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -920,8 +920,7 @@ public: #if _HAS_CXX20 template _NODISCARD constexpr common_comparison_category_t<_Synth_three_way_result<_This, _First>, - _Synth_three_way_result<_Rest, _Other>...> - _Three_way_compare(const tuple<_First, _Other...>& _Right) const { + _Synth_three_way_result<_Rest, _Other>...> _Three_way_compare(const tuple<_First, _Other...>& _Right) const { if (auto _Result = _Synth_three_way{}(_Myfirst._Val, _Right._Myfirst._Val); _Result != 0) { return _Result; } @@ -962,7 +961,7 @@ public: } template <_Tuple_like_non_tuple _Other> - _NODISCARD friend constexpr auto operator<=>(const tuple& _Left, const _Other& _Right) // + _NODISCARD friend constexpr auto operator<=>(const tuple& _Left, const _Other& _Right) -> _Three_way_comparison_result_with_tuple_like_t { return _Left._Three_way_compare_with_tuple_like(_Right, make_index_sequence<1 + sizeof...(_Rest)>{}); } diff --git a/stl/inc/type_traits b/stl/inc/type_traits index a3fab26175e..743cd6966d0 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -127,11 +127,20 @@ struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS add_rvalue_reference { _EXPORT_STD template using add_rvalue_reference_t = typename _Add_reference<_Ty>::_Rvalue; +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-volatile" +#endif // defined(__clang__) + _EXPORT_STD template add_rvalue_reference_t<_Ty> declval() noexcept { static_assert(false, "Calling declval is ill-formed, see N4950 [declval]/2."); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // defined(__clang__) + _EXPORT_STD template struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS remove_extent { // remove array extent using type = _Ty; @@ -749,44 +758,21 @@ _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool has_unique_object_representati #if _HAS_CXX23 #ifdef __cpp_lib_reference_from_temporary // TRANSITION -#ifdef __clang__ // TRANSITION, LLVM-114344 -template -struct _Adjust_ref_binding_source { - using type = _Ty; -}; -template - requires is_scalar_v<_Ty> || is_void_v<_Ty> -struct _Adjust_ref_binding_source<_Ty> { - using type = remove_cv_t<_Ty>; -}; -template - requires is_function_v<_Ty> && requires { typename void_t<_Ty&>; } -struct _Adjust_ref_binding_source<_Ty> { - using type = _Ty&; -}; - -template -using _Adjust_ref_binding_source_t = _Adjust_ref_binding_source<_Ty>::type; -#else // ^^^ workaround / no workaround vvv -template -using _Adjust_ref_binding_source_t = _Ty; -#endif // ^^^ no workaround ^^^ - _EXPORT_STD template struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS reference_constructs_from_temporary - : bool_constant<__reference_constructs_from_temporary(_Ty, _Adjust_ref_binding_source_t<_Uty>)> {}; + : bool_constant<__reference_constructs_from_temporary(_Ty, _Uty)> {}; _EXPORT_STD template _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool reference_constructs_from_temporary_v = - __reference_constructs_from_temporary(_Ty, _Adjust_ref_binding_source_t<_Uty>); + __reference_constructs_from_temporary(_Ty, _Uty); _EXPORT_STD template struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS reference_converts_from_temporary - : bool_constant<__reference_converts_from_temporary(_Ty, _Adjust_ref_binding_source_t<_Uty>)> {}; + : bool_constant<__reference_converts_from_temporary(_Ty, _Uty)> {}; _EXPORT_STD template _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool reference_converts_from_temporary_v = - __reference_converts_from_temporary(_Ty, _Adjust_ref_binding_source_t<_Uty>); + __reference_converts_from_temporary(_Ty, _Uty); #endif // ^^^ no workaround ^^^ #endif // _HAS_CXX23 @@ -1454,9 +1440,18 @@ struct _Common_type3>, _Ty1, _Ty2, _Rest...> template struct common_type<_Ty1, _Ty2, _Rest...> : _Common_type3 {}; +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-volatile" +#endif // defined(__clang__) + template _Ty _Returns_exactly() noexcept; // not defined +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // defined(__clang__) + #if _HAS_CXX20 _EXPORT_STD template class, template class> struct basic_common_reference {}; // specializations allowed by N5014 [meta.trans.other]/7 @@ -1703,8 +1698,8 @@ struct _Invoker_functor { template static constexpr auto _Call(_Callable&& _Obj, _Types&&... _Args) - noexcept(noexcept(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...))) // - -> decltype(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...)) { + noexcept(noexcept(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...))) + -> decltype(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...)) { return static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...); } }; @@ -1714,8 +1709,8 @@ struct _Invoker_pmf_object { template static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) - noexcept(noexcept((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...))) // - -> decltype((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + noexcept(noexcept((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...))) + -> decltype((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return (static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1725,8 +1720,8 @@ struct _Invoker_pmf_refwrap { template static constexpr auto _Call(_Decayed _Pmf, _Refwrap _Rw, _Types2&&... _Args2) - noexcept(noexcept((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...))) // - -> decltype((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + noexcept(noexcept((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...))) + -> decltype((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return (_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1736,8 +1731,8 @@ struct _Invoker_pmf_pointer { template static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) - noexcept(noexcept(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...))) // - -> decltype(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + noexcept(noexcept(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...))) + -> decltype(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return ((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1804,20 +1799,21 @@ constexpr auto invoke(_Callable&& _Obj) noexcept(noexcept(static_cast<_Callable& _EXPORT_STD template constexpr auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, _Types2&&... _Args2) noexcept(noexcept(_Invoker1<_Callable, _Ty1>::_Call( - static_cast<_Callable&&>(_Obj), static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...))) // - -> decltype(_Invoker1<_Callable, _Ty1>::_Call( - static_cast<_Callable&&>(_Obj), static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...)) { - if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Functor) { + static_cast<_Callable&&>(_Obj), static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...))) + -> decltype(_Invoker1<_Callable, _Ty1>::_Call( + static_cast<_Callable&&>(_Obj), static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...)) { + constexpr auto _Strat = _Invoker1<_Callable, _Ty1>::_Strategy; + if constexpr (_Strat == _Invoker_strategy::_Functor) { return static_cast<_Callable&&>(_Obj)(static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...); - } else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmf_object) { + } else if constexpr (_Strat == _Invoker_strategy::_Pmf_object) { return (static_cast<_Ty1&&>(_Arg1).*_Obj)(static_cast<_Types2&&>(_Args2)...); - } else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmf_refwrap) { + } else if constexpr (_Strat == _Invoker_strategy::_Pmf_refwrap) { return (_Arg1.get().*_Obj)(static_cast<_Types2&&>(_Args2)...); - } else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmf_pointer) { + } else if constexpr (_Strat == _Invoker_strategy::_Pmf_pointer) { return ((*static_cast<_Ty1&&>(_Arg1)).*_Obj)(static_cast<_Types2&&>(_Args2)...); - } else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_object) { + } else if constexpr (_Strat == _Invoker_strategy::_Pmd_object) { return static_cast<_Ty1&&>(_Arg1).*_Obj; - } else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_refwrap) { + } else if constexpr (_Strat == _Invoker_strategy::_Pmd_refwrap) { #if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1956799 return _Arg1.get().*_Obj; #else // ^^^ no workaround / workaround vvv @@ -1825,7 +1821,7 @@ constexpr auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, _Types2&&... _Args2) return _Ref.*_Obj; #endif // ^^^ workaround ^^^ } else { - _STL_INTERNAL_STATIC_ASSERT(_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_pointer); + _STL_INTERNAL_STATIC_ASSERT(_Strat == _Invoker_strategy::_Pmd_pointer); return (*static_cast<_Ty1&&>(_Arg1)).*_Obj; } } @@ -2027,7 +2023,6 @@ struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_layout_compatible : bool_constant<_ _EXPORT_STD template _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_layout_compatible_v = __is_layout_compatible(_Ty1, _Ty2); -#ifndef __clang__ // TRANSITION, LLVM-135273 _EXPORT_STD template struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_pointer_interconvertible_base_of : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)> {}; @@ -2035,15 +2030,6 @@ struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_pointer_interconvertible_base_of _EXPORT_STD template _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_pointer_interconvertible_base_of_v = __is_pointer_interconvertible_base_of(_Base, _Derived); -#else // ^^^ no workaround / workaround vvv -_EXPORT_STD template -struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_pointer_interconvertible_base_of - : bool_constant<__is_pointer_interconvertible_base_of(remove_cv_t<_Base>, remove_cv_t<_Derived>)> {}; - -_EXPORT_STD template -_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_pointer_interconvertible_base_of_v = - __is_pointer_interconvertible_base_of(remove_cv_t<_Base>, remove_cv_t<_Derived>); -#endif // ^^^ workaround ^^^ #ifndef __clang__ // TRANSITION, LLVM-48860 _EXPORT_STD template @@ -2166,8 +2152,8 @@ private: public: template _CONSTEXPR20 auto operator()(_Types&&... _Args) const - noexcept(noexcept(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...))) // - -> decltype(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)) { + noexcept(noexcept(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...))) + -> decltype(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)) { return _STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...); } }; diff --git a/stl/inc/utility b/stl/inc/utility index 98c3268f481..29e4cd6613f 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -564,8 +564,7 @@ _NODISCARD constexpr bool operator==(const pair<_Ty1, _Ty2>& _Left, const pair<_ #if _HAS_CXX20 _EXPORT_STD template _NODISCARD constexpr common_comparison_category_t<_Synth_three_way_result<_Ty1, _Uty1>, - _Synth_three_way_result<_Ty2, _Uty2>> - operator<=>(const pair<_Ty1, _Ty2>& _Left, const pair<_Uty1, _Uty2>& _Right) { + _Synth_three_way_result<_Ty2, _Uty2>> operator<=>(const pair<_Ty1, _Ty2>& _Left, const pair<_Uty1, _Uty2>& _Right) { if (auto _Result = _Synth_three_way{}(_Left.first, _Right.first); _Result != 0) { return _Result; } diff --git a/stl/inc/variant b/stl/inc/variant index c89041f8f27..8948643a39e 100644 --- a/stl/inc/variant +++ b/stl/inc/variant @@ -1385,7 +1385,7 @@ _NODISCARD constexpr common_comparison_category_t...>, _Types...>; + common_comparison_category_t...>, _Types...>; const size_t _Left_offset = _Left.index() + 1; const size_t _Right_offset = _Right.index() + 1; const auto _Offset_order = _Left_offset <=> _Right_offset; diff --git a/stl/inc/vector b/stl/inc/vector index 4a38d29e035..5ba44ed6cb1 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -1923,8 +1923,8 @@ public: } _NODISCARD _CONSTEXPR20 size_type max_size() const noexcept { - return (_STD min) (static_cast(_STD _Max_limit()), // - _Alty_traits::max_size(_Getal())); + constexpr auto _Diff_max = static_cast(_STD _Max_limit()); + return (_STD min) (_Diff_max, _Alty_traits::max_size(_Getal())); } _NODISCARD _CONSTEXPR20 size_type capacity() const noexcept { @@ -3211,7 +3211,6 @@ public: constexpr auto _Diff_max = static_cast(_STD _Max_limit()); const size_type _Ints_max = this->_Myvec.max_size(); - // Use a const bool to avoid warning C4127 "conditional expression is constant" with Defect Report P2280R4 const bool _Would_overflow = _Ints_max > _Diff_max / _VBITS; if (_Would_overflow) { // max_size bound by difference_type limits return _Diff_max; @@ -3871,7 +3870,7 @@ _CONSTEXPR20 _OutIt _Copy_vbool(_VbIt _First, _VbIt _Last, _OutIt _Dest) { return _DestEnd; } else if (_IsSingleBlockDest) { const auto _SourceShift = _IsRightShift ? _First._Myoff - _Dest._Myoff : _Dest._Myoff - _First._Myoff; - const auto _SourceVal = _IsRightShift ? (*_VbFirst & _FirstSourceMask) >> _SourceShift // + const auto _SourceVal = _IsRightShift ? (*_VbFirst & _FirstSourceMask) >> _SourceShift : (*_VbFirst & _FirstSourceMask) << _SourceShift; const auto _DestMask = _FirstDestMask | (_DestEnd._Myoff == 0 ? 0 : _LastDestMask); diff --git a/stl/inc/xfilesystem_abi.h b/stl/inc/xfilesystem_abi.h index 0ca7a0faa84..7956cfec777 100644 --- a/stl/inc/xfilesystem_abi.h +++ b/stl/inc/xfilesystem_abi.h @@ -259,8 +259,8 @@ _NODISCARD __std_win_error __stdcall __std_fs_open_handle(_Out_ __std_fs_file_ha void __stdcall __std_fs_close_handle(__std_fs_file_handle _Handle) noexcept; -_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_fs_get_file_attributes_by_handle( +_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error __stdcall + __std_fs_get_file_attributes_by_handle( _In_ __std_fs_file_handle _Handle, _Out_ unsigned long* _File_attributes) noexcept; _NODISCARD __std_ulong_and_error __stdcall __std_fs_get_final_path_name_by_handle(_In_ __std_fs_file_handle _Handle, @@ -280,9 +280,9 @@ _NODISCARD __std_win_error __stdcall __std_fs_directory_iterator_open(_In_z_ con void __stdcall __std_fs_directory_iterator_close(_In_ __std_fs_dir_handle _Handle) noexcept; -_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_fs_get_stats(_In_z_ const wchar_t* _Path, __std_fs_stats* _Stats, _In_ __std_fs_stats_flags _Flags, - _In_ __std_fs_file_attr _Symlink_attribute_hint = __std_fs_file_attr::_Invalid) noexcept; +_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error __stdcall __std_fs_get_stats( + _In_z_ const wchar_t* _Path, __std_fs_stats* _Stats, _In_ __std_fs_stats_flags _Flags, + _In_ __std_fs_file_attr _Symlink_attribute_hint = __std_fs_file_attr::_Invalid) noexcept; _NODISCARD __std_win_error __stdcall __std_fs_directory_iterator_advance( _In_ __std_fs_dir_handle _Handle, _Out_ __std_fs_find_data* _Results) noexcept; @@ -315,12 +315,11 @@ _NODISCARD __std_win_error __stdcall __std_fs_set_last_write_time( _NODISCARD __std_win_error __stdcall __std_fs_change_permissions( _In_z_ const wchar_t* _Path, _In_ bool _Follow_symlinks, _In_ bool _Readonly) noexcept; -_NODISCARD _Success_(return._Error == __std_win_error::_Success) __std_ulong_and_error - __stdcall __std_fs_get_temp_path(_Out_writes_z_(__std_fs_temp_path_max) wchar_t* _Target) noexcept; +_NODISCARD _Success_(return._Error == __std_win_error::_Success) __std_ulong_and_error __stdcall __std_fs_get_temp_path( + _Out_writes_z_(__std_fs_temp_path_max) wchar_t* _Target) noexcept; -_NODISCARD _Success_(return._Error == __std_win_error::_Success) __std_ulong_and_error - __stdcall __std_fs_get_current_path( - _In_ unsigned long _Target_size, _Out_writes_z_(_Target_size) wchar_t* _Target) noexcept; +_NODISCARD _Success_(return._Error == __std_win_error::_Success) __std_ulong_and_error __stdcall + __std_fs_get_current_path(_In_ unsigned long _Target_size, _Out_writes_z_(_Target_size) wchar_t* _Target) noexcept; _NODISCARD __std_win_error __stdcall __std_fs_set_current_path(_In_z_ const wchar_t* _Target) noexcept; @@ -342,8 +341,8 @@ _NODISCARD __std_win_error __stdcall __std_fs_write_reparse_data_buffer( _NODISCARD bool __stdcall __std_fs_is_junction_from_reparse_data_buffer( _In_ const __std_fs_reparse_data_buffer* _Buffer) noexcept; -_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_fs_read_name_from_reparse_data_buffer( +_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error __stdcall + __std_fs_read_name_from_reparse_data_buffer( _In_ __std_fs_reparse_data_buffer* _Handle, _Out_ wchar_t** _Offset, _Out_ unsigned short* _Length) noexcept; struct __std_fs_create_directory_result { diff --git a/stl/inc/xhash b/stl/inc/xhash index 1cfd0d21afb..db6b283ef3f 100644 --- a/stl/inc/xhash +++ b/stl/inc/xhash @@ -208,8 +208,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())); + constexpr auto _Diff_max = static_cast(_STD _Max_limit()); + return (_STD min) (_Diff_max, _Aliter_traits::max_size(_Mypair._Get_first())); } _NODISCARD size_type capacity() const noexcept { @@ -291,7 +291,7 @@ public: using const_iterator = typename _Mylist::const_iterator; using _Unchecked_iterator = conditional_t, - typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator>; + typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator>; using _Unchecked_const_iterator = typename _Mylist::_Unchecked_const_iterator; using _Aliter = _Rebind_alloc_t<_Alnode, _Unchecked_iterator>; diff --git a/stl/inc/xstring b/stl/inc/xstring index b371e31d6ba..2348507ff99 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -2289,9 +2289,9 @@ public: 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()), - static_cast(_Storage_max - 1) // -1 is for null terminator and/or npos - ); + constexpr auto _Diff_max = static_cast(_STD _Max_limit()); + const auto _Effective_max = static_cast(_Storage_max - 1); // -1 is for null terminator and/or npos + return (_STD min) (_Diff_max, _Effective_max); } _CONSTEXPR20 void resize(_CRT_GUARDOVERFLOW const size_type _New_size, const _Elem _Ch = _Elem()) { diff --git a/stl/inc/xtree b/stl/inc/xtree index ba988f52a60..d643d8a7e4a 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())); + constexpr auto _Diff_max = static_cast(_STD _Max_limit()); + return (_STD min) (_Diff_max, _Alnode_traits::max_size(_Getal())); } _NODISCARD_EMPTY_MEMBER bool empty() const noexcept { diff --git a/stl/inc/xutility b/stl/inc/xutility index bc62b17f16d..488bc52d044 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -999,11 +999,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 {}; @@ -1106,10 +1106,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 @@ -1183,7 +1183,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> @@ -1324,7 +1324,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 @@ -1985,8 +1985,8 @@ public: return *this; } - _CONSTEXPR17 reverse_iterator operator++(int) noexcept(is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(--current)) /* strengthened */ { + _CONSTEXPR17 reverse_iterator operator++(int) + noexcept(is_nothrow_copy_constructible_v<_BidIt> && noexcept(--current)) /* strengthened */ { reverse_iterator _Tmp = *this; --current; return _Tmp; @@ -1997,8 +1997,8 @@ public: return *this; } - _CONSTEXPR17 reverse_iterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(++current)) /* strengthened */ { + _CONSTEXPR17 reverse_iterator operator--(int) + noexcept(is_nothrow_copy_constructible_v<_BidIt> && noexcept(++current)) /* strengthened */ { reverse_iterator _Tmp = *this; ++current; return _Tmp; @@ -3101,7 +3101,7 @@ namespace ranges { template > _NODISCARD static constexpr auto operator()(_Ty&& _Val) 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)); } @@ -3131,7 +3131,7 @@ namespace ranges { template > _NODISCARD static constexpr auto operator()(_Ty&& _Val) 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)); } @@ -3299,7 +3299,7 @@ namespace ranges { template > _NODISCARD static constexpr auto operator()(_Ty&& _Val) 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)); } @@ -3329,7 +3329,7 @@ namespace ranges { template > _NODISCARD static constexpr auto operator()(_Ty&& _Val) 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)); } @@ -3542,9 +3542,8 @@ namespace ranges { struct _Cdata_fn { #if _HAS_CXX23 template <_Should_range_access _Ty> - requires requires(_Ty& _Val) { // - _RANGES _As_const_pointer(_RANGES data(_RANGES _Possibly_const_range(_Val))); - } + requires requires( + _Ty& _Val) { _RANGES _As_const_pointer(_RANGES data(_RANGES _Possibly_const_range(_Val))); } _NODISCARD static constexpr auto operator()(_Ty&& _Val) noexcept(noexcept(_RANGES data(_RANGES _Possibly_const_range(_Val)))) { return _RANGES _As_const_pointer(_RANGES data(_RANGES _Possibly_const_range(_Val))); @@ -3553,7 +3552,7 @@ namespace ranges { template > _NODISCARD static constexpr auto operator()(_Ty&& _Val) 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)); } @@ -4485,8 +4484,8 @@ public: return *this; } - _CONSTEXPR17 auto operator++(int) noexcept(is_nothrow_copy_constructible_v<_Iter> // - && noexcept(++_Current)) /* strengthened */ { + _CONSTEXPR17 auto operator++(int) + noexcept(is_nothrow_copy_constructible_v<_Iter> && noexcept(++_Current)) /* strengthened */ { #if _HAS_CXX20 if constexpr (forward_iterator<_Iter>) { #endif // _HAS_CXX20 @@ -4505,21 +4504,21 @@ public: return *this; } - _CONSTEXPR17 move_iterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_Iter> // - && noexcept(--_Current)) /* strengthened */ { + _CONSTEXPR17 move_iterator operator--(int) + noexcept(is_nothrow_copy_constructible_v<_Iter> && noexcept(--_Current)) /* strengthened */ { move_iterator _Tmp = *this; --_Current; return _Tmp; } template - _NODISCARD auto operator==(_Default_sentinel _Sentinel) const noexcept // + _NODISCARD auto operator==(_Default_sentinel _Sentinel) const noexcept -> decltype(_STD declval() == _Sentinel) { return _Current == _Sentinel; } template - _NODISCARD auto operator!=(_Default_sentinel _Sentinel) const noexcept // + _NODISCARD auto operator!=(_Default_sentinel _Sentinel) const noexcept -> decltype(_STD declval() != _Sentinel) { return _Current != _Sentinel; } @@ -5285,7 +5284,7 @@ namespace ranges { auto _ULast = _RANGES _Unwrap_sent<_It>(_STD move(_Last)); const auto _Count = _RANGES _Idl_distance<_It>(_UFirst, _ULast); auto _UResult = _RANGES _Copy_unchecked( - _STD move(_UFirst), _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), _Count)); + _STD move(_UFirst), _STD move(_ULast), _STD _Get_unwrapped_n(_STD move(_Output), _Count)); _STD _Seek_wrapped(_First, _STD move(_UResult.in)); _STD _Seek_wrapped(_Output, _STD move(_UResult.out)); return {_STD move(_First), _STD move(_Output)}; @@ -7201,7 +7200,7 @@ namespace ranges { const auto _Count1 = _RANGES distance(_Range1); const auto _Count2 = _RANGES distance(_Range2); auto _UResult = _Search_sized(_Ubegin(_Range1), _Uend(_Range1), _Count1, _Ubegin(_Range2), - _Uend(_Range2), _Count2, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj1), _STD _Pass_fn(_Proj2)); + _Uend(_Range2), _Count2, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj1), _STD _Pass_fn(_Proj2)); return _RANGES _Rewrap_subrange>(_Range1, _STD move(_UResult)); } else { auto _UResult = _Search_unsized(_Ubegin(_Range1), _Uend(_Range1), _Ubegin(_Range2), _Uend(_Range2), diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index d247d00a913..29ced7d13a8 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -915,8 +915,8 @@ _EMIT_STL_ERROR(STL1002, "Unexpected compiler version, expected CUDA 13.2 or new #elif defined(__EDG__) // not attempting to detect __EDG_VERSION__ being less than expected #elif defined(__clang__) -#if __clang_major__ < 20 -_EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 20 or newer."); +#if __clang_major__ < 22 +_EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 22 or newer."); #endif // ^^^ old Clang ^^^ #elif defined(_MSC_VER) #if _MSC_VER < 1950 // Coarse-grained, not inspecting _MSC_FULL_VER diff --git a/stl/src/excptptr.cpp b/stl/src/excptptr.cpp index c94180de2ce..ca601c5b5f6 100644 --- a/stl/src/excptptr.cpp +++ b/stl/src/excptptr.cpp @@ -27,10 +27,10 @@ #include // Pre-V4 managed exception code -#define MANAGED_EXCEPTION_CODE 0XE0434F4D +#define MANAGED_EXCEPTION_CODE 0xE0434F4D // V4 and later managed exception code -#define MANAGED_EXCEPTION_CODE_V4 0XE0434352 +#define MANAGED_EXCEPTION_CODE_V4 0xE0434352 extern "C" _CRTIMP2 void* __cdecl __AdjustPointer(void*, const PMD&); // defined in frame.cpp diff --git a/stl/src/filesystem.cpp b/stl/src/filesystem.cpp index ec0e4fabf1f..a59fc42a45c 100644 --- a/stl/src/filesystem.cpp +++ b/stl/src/filesystem.cpp @@ -129,8 +129,8 @@ namespace { return _Last_error; } - [[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall _Set_delete_flag(_In_ __std_fs_file_handle _Handle) { + [[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error __stdcall _Set_delete_flag( + _In_ __std_fs_file_handle _Handle) { // See minwinbase.h and WinBase.h. FILE_DISPOSITION_INFO_EX _Info_ex{FILE_DISPOSITION_FLAG_DELETE | FILE_DISPOSITION_FLAG_POSIX_SEMANTICS}; @@ -187,8 +187,8 @@ void __stdcall __std_fs_close_handle(const __std_fs_file_handle _Handle) noexcep } } -[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_fs_get_file_attributes_by_handle( +[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error __stdcall + __std_fs_get_file_attributes_by_handle( _In_ const __std_fs_file_handle _Handle, _Out_ unsigned long* const _File_attributes) noexcept { // read the attributes from _Handle and store it in _File_attributes const HANDLE _As_plain_handle = reinterpret_cast(_Handle); @@ -413,8 +413,8 @@ struct __std_fs_file_id { // typedef struct _FILE_ID_INFO { }; // } FILE_ID_INFO, ...; // TRANSITION, ABI: preserved for binary compatibility -[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_fs_get_file_id(_Out_ __std_fs_file_id* const _Id, _In_z_ const wchar_t* const _Path) noexcept { +[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error __stdcall __std_fs_get_file_id( + _Out_ __std_fs_file_id* const _Id, _In_z_ const wchar_t* const _Path) noexcept { __std_win_error _Last_error; const _STD _Fs_file _Handle( _Path, __std_access_rights::_File_read_attributes, __std_fs_file_flags::_Backup_semantics, &_Last_error); @@ -507,8 +507,8 @@ struct __std_fs_file_id { // typedef struct _FILE_ID_INFO { return _Buffer->_Reparse_tag == IO_REPARSE_TAG_MOUNT_POINT; } -[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_fs_read_name_from_reparse_data_buffer(_In_ __std_fs_reparse_data_buffer* const _Buffer, +[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error __stdcall + __std_fs_read_name_from_reparse_data_buffer(_In_ __std_fs_reparse_data_buffer* const _Buffer, _Out_ wchar_t** const _Offset, _Out_ unsigned short* const _Length) noexcept { if (_Buffer->_Reparse_tag == IO_REPARSE_TAG_SYMLINK) { auto& _Symlink_buffer = _Buffer->_Symbolic_link_reparse_buffer; @@ -809,8 +809,8 @@ namespace { } } // unnamed namespace -[[nodiscard]] _Success_(return._Error == __std_win_error::_Success) __std_ulong_and_error - __stdcall __std_fs_get_temp_path(_Out_writes_z_(__std_fs_temp_path_max) wchar_t* const _Target) noexcept { +[[nodiscard]] _Success_(return._Error == __std_win_error::_Success) __std_ulong_and_error __stdcall + __std_fs_get_temp_path(_Out_writes_z_(__std_fs_temp_path_max) wchar_t* const _Target) noexcept { // calls GetTempPath2W if available (Win11+), else calls GetTempPathW // If getting the path failed, returns 0 size; otherwise, returns the size of the // expected directory. If the path could be resolved to an existing directory, @@ -839,9 +839,9 @@ namespace { return {_Size, __std_win_error::_Success}; } -[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_fs_get_stats(_In_z_ const wchar_t* const _Path, __std_fs_stats* const _Stats, - _In_ __std_fs_stats_flags _Flags, _In_ const __std_fs_file_attr _Symlink_attribute_hint) noexcept { +[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error __stdcall __std_fs_get_stats( + _In_z_ const wchar_t* const _Path, __std_fs_stats* const _Stats, _In_ __std_fs_stats_flags _Flags, + _In_ const __std_fs_file_attr _Symlink_attribute_hint) noexcept { const bool _Follow_symlinks = _STD _Bitmask_includes_any(_Flags, __std_fs_stats_flags::_Follow_symlinks); _Flags &= ~__std_fs_stats_flags::_Follow_symlinks; if (_Follow_symlinks && _STD _Bitmask_includes_any(_Flags, __std_fs_stats_flags::_Reparse_tag)) { @@ -1014,8 +1014,8 @@ namespace { return {false, _Last_error}; } -[[nodiscard]] _Success_(return._Error == __std_win_error::_Success) __std_ulong_and_error - __stdcall __std_fs_get_current_path( +[[nodiscard]] _Success_(return._Error == __std_win_error::_Success) __std_ulong_and_error __stdcall + __std_fs_get_current_path( _In_ const unsigned long _Target_size, _Out_writes_z_(_Target_size) wchar_t* const _Target) noexcept { // If getting the path failed, GetCurrentDirectoryW returns 0; otherwise, returns the size of the expected // directory. diff --git a/stl/src/print.cpp b/stl/src/print.cpp index de8b8336316..da711fc163a 100644 --- a/stl/src/print.cpp +++ b/stl/src/print.cpp @@ -14,8 +14,8 @@ extern "C" { -[[nodiscard]] _Success_(return._Error == __std_win_error::_Success) __std_unicode_console_retrieval_result - __stdcall __std_get_unicode_console_handle_from_file_stream(_In_ FILE* const _Stream) noexcept { +[[nodiscard]] _Success_(return._Error == __std_win_error::_Success) __std_unicode_console_retrieval_result __stdcall + __std_get_unicode_console_handle_from_file_stream(_In_ FILE* const _Stream) noexcept { if (_Stream == nullptr) { return __std_unicode_console_retrieval_result{._Error = __std_win_error::_Invalid_parameter}; } @@ -255,9 +255,9 @@ namespace { extern "C" { -[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_print_to_unicode_console(_In_ const __std_unicode_console_handle _Console_handle, - _In_reads_(_Str_size) const char* const _Str, _In_ const size_t _Str_size) noexcept { +[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error __stdcall __std_print_to_unicode_console( + _In_ const __std_unicode_console_handle _Console_handle, _In_reads_(_Str_size) const char* const _Str, + _In_ const size_t _Str_size) noexcept { if (_Console_handle == __std_unicode_console_handle::_Invalid || _Str == nullptr) { return __std_win_error::_Invalid_parameter; } @@ -297,9 +297,8 @@ extern "C" { } } -[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error - __stdcall __std_print_newline_only_to_unicode_console( - _In_ const __std_unicode_console_handle _Console_handle) noexcept { +[[nodiscard]] _Success_(return == __std_win_error::_Success) __std_win_error __stdcall + __std_print_newline_only_to_unicode_console(_In_ const __std_unicode_console_handle _Console_handle) noexcept { if (_Console_handle == __std_unicode_console_handle::_Invalid) { return __std_win_error::_Invalid_parameter; } diff --git a/stl/src/tzdb.cpp b/stl/src/tzdb.cpp index 785306a8dcb..d3f2fe68726 100644 --- a/stl/src/tzdb.cpp +++ b/stl/src/tzdb.cpp @@ -371,14 +371,14 @@ extern "C" { _Info->_Num_time_zones = static_cast(_Num_time_zones); // value-init to ensure __std_tzdb_delete_time_zones() cleanup is valid - if (const auto _Names = new (_STD nothrow) const char* [_Info->_Num_time_zones] {}) { + if (const auto _Names = new (_STD nothrow) const char*[_Info->_Num_time_zones]{}) { _Info->_Names = _Names; } else { return nullptr; } // value-init to ensure __std_tzdb_delete_time_zones() cleanup is valid - if (const auto _Links = new (_STD nothrow) const char* [_Info->_Num_time_zones] {}) { + if (const auto _Links = new (_STD nothrow) const char*[_Info->_Num_time_zones]{}) { _Info->_Links = _Links; } else { return nullptr; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8877685a995..277282305e7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -find_package(Python "3.14.4" REQUIRED COMPONENTS Interpreter) +find_package(Python "3.14.5" REQUIRED COMPONENTS Interpreter) set(STL_BUILD_ROOT "${PROJECT_BINARY_DIR}/out") set(STL_SOURCE_DIR "${PROJECT_SOURCE_DIR}") diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index bba3bed8a15..e04452406c5 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -60,10 +60,6 @@ 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 - # LLVM-171438: [Clang] __builtin_common_type is overly permissive # These tests are improperly working around this Clang bug by detecting Clang and asserting buggy results, # but only libc++ with Clang is affected; MSVC's STL with Clang is unaffected. @@ -382,8 +378,9 @@ std/utilities/variant/variant.relops/three_way.pass.cpp:0 FAIL std/utilities/variant/variant.relops/three_way.pass.cpp:1 FAIL # VSO-2188243 constexpr ICE in C1XX adapt::to_prvalue -std/algorithms/robust_re_difference_type.compile.pass.cpp:0 FAIL -std/algorithms/robust_re_difference_type.compile.pass.cpp:1 FAIL +# SKIPPED as this is passing for some architectures. +std/algorithms/robust_re_difference_type.compile.pass.cpp:0 SKIPPED +std/algorithms/robust_re_difference_type.compile.pass.cpp:1 SKIPPED # DevCom-10439137 VSO-1869865: Discarded id-expression causes unnecessary reading std/containers/sequences/array/array.cons/initialization.pass.cpp:0 FAIL diff --git a/tests/std/include/range_algorithm_support.hpp b/tests/std/include/range_algorithm_support.hpp index 96b44d2616a..f4995c4ab01 100644 --- a/tests/std/include/range_algorithm_support.hpp +++ b/tests/std/include/range_algorithm_support.hpp @@ -683,7 +683,7 @@ namespace test { } using unwrap = std::conditional_t, Element*, - iterator>; + iterator>; using unwrapping_ignorant = iterator; [[nodiscard]] constexpr auto _Unwrapped() const& noexcept @@ -756,7 +756,7 @@ template > { using pointer = ::test::iterator; + ::test::ProxyRef::no, Wrapped>; using element_type = Element; using difference_type = ptrdiff_t; diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/testdll.cpp b/tests/std/tests/Dev09_056375_locale_cleanup/testdll.cpp index dd3ef599709..6d3e0f3096d 100644 --- a/tests/std/tests/Dev09_056375_locale_cleanup/testdll.cpp +++ b/tests/std/tests/Dev09_056375_locale_cleanup/testdll.cpp @@ -15,8 +15,7 @@ extern "C" { __declspec(dllexport) #endif - void - DllTest() { + void DllTest() { assert(isspace(' ', locale())); assert(isspace(L' ', locale())); assert(!isspace('Z', locale())); diff --git a/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp b/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp index 4eeea842fd0..e9ec2fdb614 100644 --- a/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp +++ b/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp @@ -25,9 +25,11 @@ using namespace std; template struct tagged_bool_like { bool val_; + template constexpr operator bool() const noexcept { return val_; } + explicit operator bool() const = delete; }; template @@ -142,39 +144,38 @@ struct validating_iterator_provider::iterator { } template , int> = 0> - friend constexpr auto operator==(iterator i, OtherIter j) noexcept // + friend constexpr auto operator==(iterator i, OtherIter j) noexcept -> decltype(pointer{} == typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() == j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator!=(iterator i, OtherIter j) noexcept // + friend constexpr auto operator!=(iterator i, OtherIter j) noexcept -> decltype(pointer{} != typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() != j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator<(iterator i, OtherIter j) noexcept // + friend constexpr auto operator<(iterator i, OtherIter j) noexcept -> decltype(pointer{} < typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() < j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator>(iterator i, OtherIter j) noexcept // + friend constexpr auto operator>(iterator i, OtherIter j) noexcept -> decltype(pointer{} > typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() > j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator<=(iterator i, OtherIter j) noexcept // + friend constexpr auto operator<=(iterator i, OtherIter j) noexcept -> decltype(pointer{} <= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() <= j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator>=(iterator i, OtherIter j) noexcept // + friend constexpr auto operator>=(iterator i, OtherIter j) noexcept -> decltype(pointer{} >= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() >= j.operator->() ? placeholder_addr : nullptr; } - template // - && is_validating_iterator // + template && is_validating_iterator && is_convertible_v, int> = 0> constexpr operator OtherIter() const noexcept { 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 e23498bba14..fc4871d7f44 100644 --- a/tests/std/tests/GH_001541_case_sensitive_boolalpha/test.cpp +++ b/tests/std/tests/GH_001541_case_sensitive_boolalpha/test.cpp @@ -16,12 +16,12 @@ struct TestCase { }; constexpr TestCase test_cases[] = { - {"0", ios_base::fmtflags{}, Parse::Success, false}, // - {"1", ios_base::fmtflags{}, Parse::Success, true}, // + {"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}, // + {"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 diff --git a/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp b/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp index 3df4b027253..015182aaf1f 100644 --- a/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp +++ b/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp @@ -41,7 +41,7 @@ struct tagged_less { template struct tagged_zero_equality { template - constexpr auto operator()(T&& t) const // + constexpr auto operator()(T&& t) const -> decltype(std::forward(t) == std::remove_cv_t>{}) { return std::forward(t) == std::remove_cv_t>{}; } diff --git a/tests/std/tests/GH_002030_asan_annotate_string/env.lst b/tests/std/tests/GH_002030_asan_annotate_string/env.lst index 9ea027b4346..f36affe6561 100644 --- a/tests/std/tests/GH_002030_asan_annotate_string/env.lst +++ b/tests/std/tests/GH_002030_asan_annotate_string/env.lst @@ -51,8 +51,3 @@ PM_CL="/D_ANNOTATE_STRING /EHsc /MTd /std:c++latest /permissive" PM_CL="/D_ANNOTATE_STRING /EHsc /MTd /std:c++latest /permissive- /analyze:only /analyze:autolog-" PM_CL="/D_ANNOTATE_STRING /EHsc /MTd /std:c++latest /permissive- /fp:strict" PM_CL="/D_ANNOTATE_STRING /EHsc /MTd /std:c++latest /permissive-" -# TRANSITION, we don't use /ALTERNATENAME for Clang (see GH-5224) so we cannot test /D_ANNOTATE_STRING without -fsanitize=address -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++14" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++17" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict" diff --git a/tests/std/tests/GH_002030_asan_annotate_vector/env.lst b/tests/std/tests/GH_002030_asan_annotate_vector/env.lst index e644474d29a..6236fa6d759 100644 --- a/tests/std/tests/GH_002030_asan_annotate_vector/env.lst +++ b/tests/std/tests/GH_002030_asan_annotate_vector/env.lst @@ -48,8 +48,3 @@ PM_CL="/D_ANNOTATE_VECTOR /EHsc /MTd /std:c++latest /permissive" PM_CL="/D_ANNOTATE_VECTOR /EHsc /MTd /std:c++latest /permissive- /analyze:only /analyze:autolog-" PM_CL="/D_ANNOTATE_VECTOR /EHsc /MTd /std:c++latest /permissive- /fp:strict" PM_CL="/D_ANNOTATE_VECTOR /EHsc /MTd /std:c++latest /permissive-" -# TRANSITION, we don't use /ALTERNATENAME for Clang (see GH-5224) so we cannot test /D_ANNOTATE_VECTOR without -fsanitize=address -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++14" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++17" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict" diff --git a/tests/std/tests/GH_004657_expected_constraints_permissive/test.compile.pass.cpp b/tests/std/tests/GH_004657_expected_constraints_permissive/test.compile.pass.cpp index 89d03bdcb04..022a2593365 100644 --- a/tests/std/tests/GH_004657_expected_constraints_permissive/test.compile.pass.cpp +++ b/tests/std/tests/GH_004657_expected_constraints_permissive/test.compile.pass.cpp @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include // provides several explicit template instantiation definitions that might break constraints checking // and hence cause errors in /permissive modes. -#include + +#include +#include // required for test, see note #include #include diff --git a/tests/std/tests/GH_005974_asan_annotate_optional/env.lst b/tests/std/tests/GH_005974_asan_annotate_optional/env.lst index d2131f19577..58b39fe198d 100644 --- a/tests/std/tests/GH_005974_asan_annotate_optional/env.lst +++ b/tests/std/tests/GH_005974_asan_annotate_optional/env.lst @@ -49,8 +49,3 @@ PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MTd /std:c++latest /permissive" PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MTd /std:c++latest /permissive- /analyze:only /analyze:autolog-" PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MTd /std:c++latest /permissive- /fp:strict" PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MTd /std:c++latest /permissive-" -# TRANSITION, we don't use /ALTERNATENAME for Clang (see GH-5224) so we cannot test /D_ANNOTATE_OPTIONAL without -fsanitize=address -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++latest /permissive-" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++17" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-" -PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict" diff --git a/tests/std/tests/LWG2381_num_get_floating_point/test.cpp b/tests/std/tests/LWG2381_num_get_floating_point/test.cpp index 7f0615f97e2..e741d850f26 100644 --- a/tests/std/tests/LWG2381_num_get_floating_point/test.cpp +++ b/tests/std/tests/LWG2381_num_get_floating_point/test.cpp @@ -27,10 +27,9 @@ #if _HAS_CXX17 #include -#include "../P0067R5_charconv/test.hpp" -// ^^^ needs to be included first ^^^ #include "../P0067R5_charconv/double_from_chars_test_cases.hpp" #include "../P0067R5_charconv/float_from_chars_test_cases.hpp" +#include "../P0067R5_charconv/test.hpp" #endif // _HAS_CXX17 using namespace std; diff --git a/tests/std/tests/P0009R18_mdspan_layout_stride/test.cpp b/tests/std/tests/P0009R18_mdspan_layout_stride/test.cpp index 2814081a696..f5be96ab800 100644 --- a/tests/std/tests/P0009R18_mdspan_layout_stride/test.cpp +++ b/tests/std/tests/P0009R18_mdspan_layout_stride/test.cpp @@ -346,7 +346,9 @@ constexpr void check_construction_from_other_mappings() { { // Check invalid construction using Mapping = layout_stride::mapping>; +#ifndef __clang__ // TRANSITION, LLVM-198716 static_assert(!is_constructible_v>>); +#endif // ^^^ no workaround ^^^ static_assert(!is_constructible_v>>); static_assert(!is_constructible_v>>); static_assert(!is_constructible_v>>); diff --git a/tests/std/tests/P0067R5_charconv/double_from_chars_test_cases.hpp b/tests/std/tests/P0067R5_charconv/double_from_chars_test_cases.hpp index 84bda79f4d1..5e2d6577b3e 100644 --- a/tests/std/tests/P0067R5_charconv/double_from_chars_test_cases.hpp +++ b/tests/std/tests/P0067R5_charconv/double_from_chars_test_cases.hpp @@ -7,6 +7,9 @@ #include #include #include + +#include "test.hpp" + using namespace std; inline constexpr DoubleFromCharsTestCase double_from_chars_test_cases[] = { diff --git a/tests/std/tests/P0067R5_charconv/float_from_chars_test_cases.hpp b/tests/std/tests/P0067R5_charconv/float_from_chars_test_cases.hpp index 5bd6f23f881..7475e1a2fab 100644 --- a/tests/std/tests/P0067R5_charconv/float_from_chars_test_cases.hpp +++ b/tests/std/tests/P0067R5_charconv/float_from_chars_test_cases.hpp @@ -7,6 +7,9 @@ #include #include #include + +#include "test.hpp" + using namespace std; inline constexpr FloatFromCharsTestCase float_from_chars_test_cases[] = { diff --git a/tests/std/tests/P0218R1_filesystem/test.cpp b/tests/std/tests/P0218R1_filesystem/test.cpp index edd4b60ce03..a1511ea1805 100644 --- a/tests/std/tests/P0218R1_filesystem/test.cpp +++ b/tests/std/tests/P0218R1_filesystem/test.cpp @@ -259,10 +259,12 @@ constexpr decomposition_test_case decompTestCases[] = { {LR"(\\\..)"sv, L""sv, LR"(\\\)"sv, L".."sv, LR"(\\\)"sv, L".."sv, false}, {LR"(\\\.\)"sv, L""sv, LR"(\\\)"sv, LR"(.\)"sv, LR"(\\\.)"sv, L""sv, false}, {LR"(\\\..\)"sv, L""sv, LR"(\\\)"sv, LR"(..\)"sv, LR"(\\\..)"sv, L""sv, false}, - {L"/"sv, L""sv, L"/"sv, L""sv, L"/"sv, L""sv, false}, {L"//"sv, L""sv, L"//"sv, L""sv, L"//"sv, L""sv, false}, + {L"/"sv, L""sv, L"/"sv, L""sv, L"/"sv, L""sv, false}, + {L"//"sv, L""sv, L"//"sv, L""sv, L"//"sv, L""sv, false}, {L"///"sv, L""sv, L"///"sv, L""sv, L"///"sv, L""sv, false}, {LR"(\/)"sv, L""sv, LR"(\/)"sv, L""sv, LR"(\/)"sv, L""sv, false}, - {L"/c"sv, L""sv, L"/"sv, L"c"sv, L"/"sv, L"c"sv, false}, {L"/c:"sv, L""sv, L"/"sv, L"c:"sv, L"/"sv, L"c:"sv, false}, + {L"/c"sv, L""sv, L"/"sv, L"c"sv, L"/"sv, L"c"sv, false}, + {L"/c:"sv, L""sv, L"/"sv, L"c:"sv, L"/"sv, L"c:"sv, false}, {L".."sv, L""sv, L""sv, L".."sv, L""sv, L".."sv, false}, {LR"(\.)"sv, L""sv, LR"(\)"sv, L"."sv, LR"(\)"sv, L"."sv, false}, {L"/."sv, L""sv, L"/"sv, L"."sv, L"/"sv, L"."sv, false}, diff --git a/tests/std/tests/P0355R7_calendars_and_time_zones_time_point_and_durations/test.cpp b/tests/std/tests/P0355R7_calendars_and_time_zones_time_point_and_durations/test.cpp index 26402e94600..3b6e1339c07 100644 --- a/tests/std/tests/P0355R7_calendars_and_time_zones_time_point_and_durations/test.cpp +++ b/tests/std/tests/P0355R7_calendars_and_time_zones_time_point_and_durations/test.cpp @@ -9,27 +9,22 @@ using namespace std; using namespace std::chrono; -#define DURATION_TEST(TYPE, BITS, ...) \ - static_assert( \ - is_integral_v && is_signed_v, "chrono::" #TYPE "::rep is not a signed integral type."); \ - static_assert( \ - numeric_limits::digits >= BITS, "chrono::" #TYPE "::rep is not at least " #BITS " bits."); \ - static_assert(is_same_v, "chrono::" #TYPE "::period is not " #__VA_ARGS__ "."); +#define DURATION_TEST(TYPE, BITS, ...) \ + static_assert(is_integral_v); \ + static_assert(is_signed_v); \ + static_assert(numeric_limits::digits >= BITS); \ + static_assert(is_same_v); DURATION_TEST(days, 25, ratio_multiply, hours::period>) DURATION_TEST(weeks, 22, ratio_multiply, days::period>) DURATION_TEST(months, 20, ratio_divide>) DURATION_TEST(years, 17, ratio_multiply, days::period>) -static_assert(is_same_v>, // - "sys_seconds is not time_point."); -static_assert(is_same_v>, // - "sys_days is not time_point."); +static_assert(is_same_v>); +static_assert(is_same_v>); -static_assert(is_same_v>, // - "local_seconds is not time_point."); -static_assert(is_same_v>, // - "local_days is not time_point."); +static_assert(is_same_v>); +static_assert(is_same_v>); constexpr bool test() { steady_clock::time_point tp1; diff --git a/tests/std/tests/P0645R10_text_formatting_args/test.cpp b/tests/std/tests/P0645R10_text_formatting_args/test.cpp index 39fcd5edb51..2c02e298e3d 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_legacy_text_encoding/test.cpp b/tests/std/tests/P0645R10_text_formatting_legacy_text_encoding/test.cpp index a0db9c92b76..94df8944707 100644 --- a/tests/std/tests/P0645R10_text_formatting_legacy_text_encoding/test.cpp +++ b/tests/std/tests/P0645R10_text_formatting_legacy_text_encoding/test.cpp @@ -40,7 +40,7 @@ void test_multibyte_format_strings() { void test_parse_align() { const auto parse_align_fn = _Parse_align>; - test_parse_helper(parse_align_fn, "\x93\xfaX"sv, false, 3, {.expected_alignment = _Fmt_align::_Right, .expected_fill = "\x96\x7b"sv}); diff --git a/tests/std/tests/P0896R4_ranges_alg_find_first_of/test.cpp b/tests/std/tests/P0896R4_ranges_alg_find_first_of/test.cpp index 02e891e71bd..efa19737cad 100644 --- a/tests/std/tests/P0896R4_ranges_alg_find_first_of/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_find_first_of/test.cpp @@ -74,7 +74,7 @@ int main() { constexpr bool run_tests() { // The algorithm is oblivious to anything except maybe proxies so take the bare minimum input/forward range using in_test_range = test::range; + test::Common::no, test::CanCompare::no, test::ProxyRef::yes>; using fwd_test_range = test::range; diff --git a/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy/test.cpp b/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy/test.cpp index 0c05bcbc0cf..fb707534e15 100644 --- a/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy/test.cpp @@ -271,7 +271,7 @@ struct memcpy_test { template using test_input = test::range; + test::CanCompare::no, IsProxy>; using test_output = test::range; diff --git a/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy_n/test.cpp b/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy_n/test.cpp index a21e074f572..92d00374795 100644 --- a/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy_n/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy_n/test.cpp @@ -235,7 +235,7 @@ struct memcpy_test { template using test_input = test::range; + test::CanCompare::no, IsProxy>; using test_output = test::range; diff --git a/tests/std/tests/P0896R4_ranges_alg_uninitialized_move/test.cpp b/tests/std/tests/P0896R4_ranges_alg_uninitialized_move/test.cpp index 8c9e27af3b1..dc5b5b6af74 100644 --- a/tests/std/tests/P0896R4_ranges_alg_uninitialized_move/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_uninitialized_move/test.cpp @@ -261,7 +261,7 @@ struct memcpy_test { template using test_input = test::range; + test::CanCompare::no, IsProxy>; using test_output = test::range; diff --git a/tests/std/tests/P0896R4_ranges_alg_uninitialized_move_n/test.cpp b/tests/std/tests/P0896R4_ranges_alg_uninitialized_move_n/test.cpp index 5878d39727d..e0bd3f4ba43 100644 --- a/tests/std/tests/P0896R4_ranges_alg_uninitialized_move_n/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_uninitialized_move_n/test.cpp @@ -236,7 +236,7 @@ struct memcpy_test { template using test_input = test::range; + test::CanCompare::no, IsProxy>; using test_output = test::range; diff --git a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp index 9cfe4a89a75..048d6d00dfb 100644 --- a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp +++ b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp @@ -1110,7 +1110,7 @@ namespace iterator_cust_move_test { return i + 1; } static_assert(same_as, int (&)(int)>); - static_assert(ranges::iter_move(&f)(42) == 43); + static_assert(ranges::iter_move (&f)(42) == 43); static_assert(noexcept(ranges::iter_move(&f))); struct ref_is_lvalue { diff --git a/tests/std/tests/P0896R4_views_common/test.cpp b/tests/std/tests/P0896R4_views_common/test.cpp index 5bcdfa7409d..a1d9c4dd4ac 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_filter/test.cpp b/tests/std/tests/P0896R4_views_filter/test.cpp index c9cf6a63d04..9a366ed1131 100644 --- a/tests/std/tests/P0896R4_views_filter/test.cpp +++ b/tests/std/tests/P0896R4_views_filter/test.cpp @@ -370,10 +370,10 @@ struct arrowed_iterator { friend bool operator==(arrowed_iterator, arrowed_iterator); }; -static_assert(CanArrow>{} // - | views::filter(is_even))>>); -static_assert(!CanArrow>{} // - | views::filter(is_even))>>); +static_assert(CanArrow< + ranges::iterator_t>{} | views::filter(is_even))>>); +static_assert(!CanArrow< + ranges::iterator_t>{} | views::filter(is_even))>>); int main() { // Validate views diff --git a/tests/std/tests/P0896R4_views_lazy_split/test.cpp b/tests/std/tests/P0896R4_views_lazy_split/test.cpp index 916b2bd8a74..09b77dff2d8 100644 --- a/tests/std/tests/P0896R4_views_lazy_split/test.cpp +++ b/tests/std/tests/P0896R4_views_lazy_split/test.cpp @@ -267,8 +267,8 @@ struct instantiator { "This"sv, "is"sv, "a"sv, "test,"sv, "this"sv, "is"sv, "only"sv, "a"sv, "test."sv}; static constexpr string_view expected_range[] = {"Th"sv, " "sv, " a test, th"sv, " "sv, " only a test."sv}; static constexpr string_view expected_empty[] = {"T"sv, "h"sv, "i"sv, "s"sv, " "sv, "i"sv, "s"sv, " "sv, "a"sv, - " "sv, "t"sv, "e"sv, "s"sv, "t"sv, ","sv, " "sv, "t"sv, "h"sv, "i"sv, "s"sv, " "sv, "i"sv, "s"sv, " "sv, // - "o"sv, "n"sv, "l"sv, "y"sv, " "sv, "a"sv, " "sv, "t"sv, "e"sv, "s"sv, "t"sv, "."sv}; + " "sv, "t"sv, "e"sv, "s"sv, "t"sv, ","sv, " "sv, "t"sv, "h"sv, "i"sv, "s"sv, " "sv, "i"sv, "s"sv, " "sv, // + "o"sv, "n"sv, "l"sv, "y"sv, " "sv, "a"sv, " "sv, "t"sv, "e"sv, "s"sv, "t"sv, "."sv}; static constexpr string_view expected_trailing[] = {"test"sv, ""sv}; static constexpr string_view expected_lwg3505[] = {"x"sv, "x"sv, "x"sv}; diff --git a/tests/std/tests/P0896R4_views_split/test.cpp b/tests/std/tests/P0896R4_views_split/test.cpp index 2534520a7e9..1ad382b778f 100644 --- a/tests/std/tests/P0896R4_views_split/test.cpp +++ b/tests/std/tests/P0896R4_views_split/test.cpp @@ -209,8 +209,8 @@ struct instantiator { "This"sv, "is"sv, "a"sv, "test,"sv, "this"sv, "is"sv, "only"sv, "a"sv, "test."sv}; static constexpr string_view expected_range[] = {"Th"sv, " "sv, " a test, th"sv, " "sv, " only a test."sv}; static constexpr string_view expected_empty[] = {"T"sv, "h"sv, "i"sv, "s"sv, " "sv, "i"sv, "s"sv, " "sv, "a"sv, - " "sv, "t"sv, "e"sv, "s"sv, "t"sv, ","sv, " "sv, "t"sv, "h"sv, "i"sv, "s"sv, " "sv, "i"sv, "s"sv, " "sv, // - "o"sv, "n"sv, "l"sv, "y"sv, " "sv, "a"sv, " "sv, "t"sv, "e"sv, "s"sv, "t"sv, "."sv}; + " "sv, "t"sv, "e"sv, "s"sv, "t"sv, ","sv, " "sv, "t"sv, "h"sv, "i"sv, "s"sv, " "sv, "i"sv, "s"sv, " "sv, // + "o"sv, "n"sv, "l"sv, "y"sv, " "sv, "a"sv, " "sv, "t"sv, "e"sv, "s"sv, "t"sv, "."sv}; static constexpr string_view expected_trailing[] = {"test"sv, ""sv}; static constexpr string_view expected_lwg3505[] = {"x"sv, "x"sv, "x"sv}; diff --git a/tests/std/tests/P0896R4_views_transform_death/test.cpp b/tests/std/tests/P0896R4_views_transform_death/test.cpp index 7eb908f1723..18453cc0756 100644 --- a/tests/std/tests/P0896R4_views_transform_death/test.cpp +++ b/tests/std/tests/P0896R4_views_transform_death/test.cpp @@ -287,16 +287,16 @@ void test_iter_move_value_initialized_iterator() { } void test_sentinel_compare_value_initialized() { - auto r = ranges::subrange{counted_iterator{some_ints, ranges::distance(some_ints)}, default_sentinel} - | views::transform(lambda); + auto r = ranges::subrange{counted_iterator{some_ints, ranges::distance(some_ints)}, default_sentinel} + | views::transform(lambda); using R = decltype(r); static_assert(!ranges::common_range); (void) (ranges::iterator_t{} == r.end()); } void test_sentinel_difference_value_initialized() { - auto r = ranges::subrange{counted_iterator{some_ints, ranges::distance(some_ints)}, default_sentinel} - | views::transform(lambda); + auto r = ranges::subrange{counted_iterator{some_ints, ranges::distance(some_ints)}, default_sentinel} + | views::transform(lambda); using R = decltype(r); static_assert(!ranges::common_range); static_assert(sized_sentinel_for, ranges::iterator_t>); @@ -304,8 +304,8 @@ void test_sentinel_difference_value_initialized() { } void test_flipped_sentinel_difference_value_initialized() { - auto r = ranges::subrange{counted_iterator{some_ints, ranges::distance(some_ints)}, default_sentinel} - | views::transform(lambda); + auto r = ranges::subrange{counted_iterator{some_ints, ranges::distance(some_ints)}, default_sentinel} + | views::transform(lambda); using R = decltype(r); static_assert(!ranges::common_range); static_assert(sized_sentinel_for, ranges::iterator_t>); diff --git a/tests/std/tests/P0898R3_concepts/test.cpp b/tests/std/tests/P0898R3_concepts/test.cpp index d42c401779e..7e5e02cf6ec 100644 --- a/tests/std/tests/P0898R3_concepts/test.cpp +++ b/tests/std/tests/P0898R3_concepts/test.cpp @@ -3320,7 +3320,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 01df89ff66b..f026dffafe9 100644 --- a/tests/std/tests/P0912R5_coroutine/test.cpp +++ b/tests/std/tests/P0912R5_coroutine/test.cpp @@ -1,10 +1,6 @@ // 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 @@ -192,5 +188,3 @@ int main() { test_noop_handle(); } - -#endif // ^^^ no workaround ^^^ diff --git a/tests/std/tests/P0980R1_constexpr_strings/test.cpp b/tests/std/tests/P0980R1_constexpr_strings/test.cpp index cc3004253ab..faba6104cf3 100644 --- a/tests/std/tests/P0980R1_constexpr_strings/test.cpp +++ b/tests/std/tests/P0980R1_constexpr_strings/test.cpp @@ -634,7 +634,7 @@ constexpr bool test_interface() { str insert_initializer_list = get_literal_input(); const auto it_ilist = insert_initializer_list.insert(insert_initializer_list.begin() + 6, - {CharType{'c'}, CharType{'u'}, CharType{'t'}, CharType{'e'}, CharType{' '}}); + {CharType{'c'}, CharType{'u'}, CharType{'t'}, CharType{'e'}, CharType{' '}}); assert(it_ilist == insert_initializer_list.begin() + 6); assert(ranges::equal(insert_initializer_list, "Hello cute fluffy kittens"sv)); diff --git a/tests/std/tests/P1206R7_ranges_to_mappish/test.cpp b/tests/std/tests/P1206R7_ranges_to_mappish/test.cpp index 7c15710ded9..92df6550caa 100644 --- a/tests/std/tests/P1206R7_ranges_to_mappish/test.cpp +++ b/tests/std/tests/P1206R7_ranges_to_mappish/test.cpp @@ -45,7 +45,7 @@ struct myalloc { struct mappish_instantiator { static constexpr std::pair some_pairs[] = {{0, "0"}, {1, "1a"}, {1, "1b"}, {1, "1c"}, - {2, "2"}, {3, "3"}, {4, "4"}, {5, "5a"}, {5, "5b"}, {6, "6"}, {7, "7"}}; + {2, "2"}, {3, "3"}, {4, "4"}, {5, "5a"}, {5, "5b"}, {6, "6"}, {7, "7"}}; static constexpr std::pair unique_pairs[] = { {0, "0"}, {1, "1a"}, {2, "2"}, {3, "3"}, {4, "4"}, {5, "5a"}, {6, "6"}, {7, "7"}}; diff --git a/tests/std/tests/P1206R7_vector_insert_range/test.cpp b/tests/std/tests/P1206R7_vector_insert_range/test.cpp index dade729e130..50c9e8ed8b4 100644 --- a/tests/std/tests/P1206R7_vector_insert_range/test.cpp +++ b/tests/std/tests/P1206R7_vector_insert_range/test.cpp @@ -63,7 +63,7 @@ static constexpr int other_ints[80] = { // static constexpr bool other_short_result[] = {true, false, true, true, true, true, true, true, true, true, true, true, true}; // result of inserting other_ints at offset 1 in a sequence of 5 trues static constexpr bool other_long_result[] = {true, false, true, true, true, true, true, true, true, true, true, true, - true, true, true, true, true, true, true}; // ditto, in a sequence of 11 trues + true, true, true, true, true, true, true}; // ditto, in a sequence of 11 trues struct vector_boo_instantiator { template diff --git a/tests/std/tests/P1208R6_source_location/test.cpp b/tests/std/tests/P1208R6_source_location/test.cpp index 548bddba7a5..af80a15efcb 100644 --- a/tests/std/tests/P1208R6_source_location/test.cpp +++ b/tests/std/tests/P1208R6_source_location/test.cpp @@ -190,7 +190,7 @@ constexpr void lambda_test() { assert(fun2 == "operator()"sv); #endif // ^^^ Other ^^^ #elif defined(__clang__) // ^^^ basic / detailed Clang vvv - assert(fun2 == "auto " THISCALL_OR_CDECL " lambda_test()::(anonymous class)::operator()(void) const"sv); + assert(fun2 == "auto " THISCALL_OR_CDECL " lambda_test()::(lambda)::operator()(void) const"sv); #elif defined(__EDG__) // ^^^ detailed Clang / detailed EDG vvv assert(fun2 == "__cdecl lambda [](void)->auto::operator()(void)->auto"sv); #else // ^^^ detailed EDG / detailed C1XX vvv diff --git a/tests/std/tests/P2255R2_reference_constructs_from_temporary/test.compile.pass.cpp b/tests/std/tests/P2255R2_reference_constructs_from_temporary/test.compile.pass.cpp index 019949dd525..43ea41abf2f 100644 --- a/tests/std/tests/P2255R2_reference_constructs_from_temporary/test.compile.pass.cpp +++ b/tests/std/tests/P2255R2_reference_constructs_from_temporary/test.compile.pass.cpp @@ -158,7 +158,9 @@ void test_one_cvref_to_object() { void test_object_types() { test_one_cvref_to_object(); +#ifndef __clang__ // TRANSITION, LLVM-198580 test_one_cvref_to_object(); +#endif // ^^^ no workaround ^^^ test_one_cvref_to_object>(); test_one_cvref_to_object>(); test_one_cvref_to_object>(); diff --git a/tests/std/tests/P2255R2_reference_converts_from_temporary/test.compile.pass.cpp b/tests/std/tests/P2255R2_reference_converts_from_temporary/test.compile.pass.cpp index d18f37e6820..334abe0b893 100644 --- a/tests/std/tests/P2255R2_reference_converts_from_temporary/test.compile.pass.cpp +++ b/tests/std/tests/P2255R2_reference_converts_from_temporary/test.compile.pass.cpp @@ -158,7 +158,9 @@ void test_one_cvref_to_object() { void test_object_types() { test_one_cvref_to_object(); +#ifndef __clang__ // TRANSITION, LLVM-198580 test_one_cvref_to_object(); +#endif // ^^^ no workaround ^^^ test_one_cvref_to_object>(); test_one_cvref_to_object>(); test_one_cvref_to_object>(); diff --git a/tests/std/tests/P2278R4_views_as_const/test.cpp b/tests/std/tests/P2278R4_views_as_const/test.cpp index 6b1e68830a5..4282653b5de 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 (fixed in Clang 21) and VSO-1901430 +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, GH-6295 (Clang, not yet investigated) and VSO-1901430 (EDG) { // 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 (fixed in Clang 21) and VSO-1901430 +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, GH-6295 (Clang, not yet investigated) and VSO-1901430 (EDG) { // 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 c38d0251d09..62b997b22a2 100644 --- a/tests/std/tests/P2321R2_views_zip/test.cpp +++ b/tests/std/tests/P2321R2_views_zip/test.cpp @@ -700,7 +700,7 @@ class instantiator_impl : private range_type_solver { using differing_size_member_range_type = range_type; using differing_is_common_range_type = range_type; + (IsCommon == test::Common::yes ? test::Common::no : test::Common::yes), Diff>; using differing_iterator_sentinel_diff_range_type = range_type; diff --git a/tests/std/tests/P2321R2_views_zip_transform/test.cpp b/tests/std/tests/P2321R2_views_zip_transform/test.cpp index e29f45c3078..b5f7accb907 100644 --- a/tests/std/tests/P2321R2_views_zip_transform/test.cpp +++ b/tests/std/tests/P2321R2_views_zip_transform/test.cpp @@ -335,7 +335,7 @@ constexpr bool test_one(TransformType_&& transformer, const TransformedElementsC if constexpr (CanZipTransform) { using ExpectedZipTransformType = ZipTransformType; constexpr bool is_noexcept = is_nothrow_move_constructible_v> - && is_nothrow_constructible_v&&...>; + && is_nothrow_constructible_v&&...>; static_assert( same_as(transformer), test_ranges...)), @@ -693,9 +693,9 @@ class instantiator_impl : private range_type_solver { range_type, forward_iterator_tag, input_iterator_tag>, const int, IsSized, IsCommon, Diff>; using differing_size_member_range_type = range_type; + (IsSized == test::Sized::yes ? test::Sized::no : test::Sized::yes), IsCommon, Diff>; using differing_is_common_range_type = range_type; + (IsCommon == test::Common::yes ? test::Common::no : test::Common::yes), Diff>; using differing_iterator_sentinel_diff_range_type = range_type; diff --git a/tests/std/tests/P2374R4_views_cartesian_product/test.cpp b/tests/std/tests/P2374R4_views_cartesian_product/test.cpp index 7212fd87e2e..b751501fd96 100644 --- a/tests/std/tests/P2374R4_views_cartesian_product/test.cpp +++ b/tests/std/tests/P2374R4_views_cartesian_product/test.cpp @@ -475,7 +475,7 @@ constexpr bool test_one(Expected&& expected_range, First&& first, Rest&&... rest if constexpr ((random_access_range && ... && random_access_range>) ) { // Check 3way comparisons using Cat = common_comparison_category_t>, - compare_three_way_result_t>>...>; + compare_three_way_result_t>>...>; auto i2 = r.begin(); same_as auto cmp1 = i <=> i2; assert(cmp1 == Cat::equivalent); @@ -967,7 +967,7 @@ int main() { { // ... move-only using test::Common, test::Sized; - test_one(expected_result_3, // + test_one(expected_result_3, move_only_view{get<0>(some_ranges)}, move_only_view{get<1>(some_ranges)}, move_only_view{get<2>(some_ranges)}, @@ -977,11 +977,11 @@ int main() { move_only_view{get<1>(some_ranges)}, move_only_view{get<2>(some_ranges)}, move_only_view{get<3>(some_ranges)}); - test_one(expected_result_2, // + test_one(expected_result_2, move_only_view{get<0>(some_ranges)}, move_only_view{get<1>(some_ranges)}, move_only_view{get<2>(some_ranges)}); - test_one(expected_result_2, // + test_one(expected_result_2, move_only_view{get<0>(some_ranges)}, move_only_view{get<1>(some_ranges)}, move_only_view{get<2>(some_ranges)}); diff --git a/tests/std/tests/P2502R2_generator/test.cpp b/tests/std/tests/P2502R2_generator/test.cpp index 0d525a80493..bb24e0f3bf0 100644 --- a/tests/std/tests/P2502R2_generator/test.cpp +++ b/tests/std/tests/P2502R2_generator/test.cpp @@ -1,10 +1,6 @@ // 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 @@ -418,5 +414,3 @@ int main() { dynamic_allocator_test(); pmr_generator_test(); } - -#endif // ^^^ no workaround ^^^ diff --git a/tests/std/tests/P2502R2_generator_death/test.cpp b/tests/std/tests/P2502R2_generator_death/test.cpp index e2922746819..6db8f1cf030 100644 --- a/tests/std/tests/P2502R2_generator_death/test.cpp +++ b/tests/std/tests/P2502R2_generator_death/test.cpp @@ -1,10 +1,6 @@ // 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 @@ -52,5 +48,3 @@ int main(int argc, char** argv) { return exec.run(argc, argv); } - -#endif // ^^^ no workaround ^^^ diff --git a/tests/std/tests/P2502R2_generator_iterator/test.cpp b/tests/std/tests/P2502R2_generator_iterator/test.cpp index e097bec6bb4..da4afe22dcb 100644 --- a/tests/std/tests/P2502R2_generator_iterator/test.cpp +++ b/tests/std/tests/P2502R2_generator_iterator/test.cpp @@ -1,10 +1,6 @@ // 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 @@ -172,5 +168,3 @@ int main() { test_with_type(); test_with_type(); } - -#endif // ^^^ no workaround ^^^ diff --git a/tests/std/tests/P2502R2_generator_promise/test.cpp b/tests/std/tests/P2502R2_generator_promise/test.cpp index 4c04550cf27..2513ff08472 100644 --- a/tests/std/tests/P2502R2_generator_promise/test.cpp +++ b/tests/std/tests/P2502R2_generator_promise/test.cpp @@ -1,10 +1,6 @@ // 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 @@ -249,5 +245,3 @@ int main() { test_with_type*, true>(); #endif // ^^^ no workaround ^^^ } - -#endif // ^^^ no workaround ^^^ diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index e6135a7ad6d..be0ceebb120 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -154,7 +154,7 @@ static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, LLVM-160610, VSO-2941370 (EDG) +#ifndef __EDG__ // TRANSITION, VSO-2941370 (EDG) static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); #endif // ^^^ no workaround ^^^ diff --git a/tests/std/tests/VSO_0102478_moving_allocators/test.cpp b/tests/std/tests/VSO_0102478_moving_allocators/test.cpp index c11a47b51b0..c39a294fc09 100644 --- a/tests/std/tests/VSO_0102478_moving_allocators/test.cpp +++ b/tests/std/tests/VSO_0102478_moving_allocators/test.cpp @@ -78,7 +78,7 @@ constexpr array expected_moves_table{{ }}; constexpr array expected_copies_table{{ - {"*", "*", 0}, // + {"*", "*", 0}, {"deque", "*", 1}, // deque always causes an additional copy due to creating the proxy allocator }}; #else // _ITERATOR_DEBUG_LEVEL == 0 diff --git a/tests/std/tests/VSO_0180466_algorithm_overhauls/test.cpp b/tests/std/tests/VSO_0180466_algorithm_overhauls/test.cpp index 4a8ce66f58d..cd34364fd0a 100644 --- a/tests/std/tests/VSO_0180466_algorithm_overhauls/test.cpp +++ b/tests/std/tests/VSO_0180466_algorithm_overhauls/test.cpp @@ -6,9 +6,7 @@ #pragma warning(disable : 4389) // signed/unsigned mismatch in arithmetic #ifdef __clang__ -#if __clang_major__ >= 21 // TRANSITION, unconditionally silence this warning when Clang 21 is available #pragma clang diagnostic ignored "-Wcharacter-conversion" -#endif // __clang_major__ >= 21 #pragma clang diagnostic ignored "-Wsign-compare" #endif // __clang__ diff --git a/tests/std/tests/VSO_0644691_utf_8_codecvt/test.cpp b/tests/std/tests/VSO_0644691_utf_8_codecvt/test.cpp index 9054e330f0a..31123fbd45c 100644 --- a/tests/std/tests/VSO_0644691_utf_8_codecvt/test.cpp +++ b/tests/std/tests/VSO_0644691_utf_8_codecvt/test.cpp @@ -32,7 +32,7 @@ const encoding_test_char utf_test_cases[] = { {"\xED\x9F\xBF", L"\uD7FF"}, // U+D7FF unencoded from the Hangul Jamo Extended-B block, // last character before UTF-16 illegal region {"\xED\xA0\x80", nullptr}, // U+D800 beginning of surrogate range - {nullptr, L"\xD800"}, // + {nullptr, L"\xD800"}, {"\xED\xBF\xBF", nullptr}, // U+DFFF end of surrogate range {nullptr, L"\xDFFF"}, {"\xEE\x80\x80", L"\uE000"}, // U+E000 unencoded from the private use area, first codepoint after surrogate range diff --git a/tests/tr1/tests/limits/test.cpp b/tests/tr1/tests/limits/test.cpp index 08e98d73468..e3dd1ddc6ac 100644 --- a/tests/tr1/tests/limits/test.cpp +++ b/tests/tr1/tests/limits/test.cpp @@ -26,7 +26,7 @@ struct Mytype { // wrap an int void test_main() { // test basic workings of limits definitions static const STD float_denorm_style fds[] = {STD denorm_indeterminate, STD denorm_absent, STD denorm_present}; static const STD float_round_style frs[] = {STD round_indeterminate, STD round_toward_zero, STD round_to_nearest, - STD round_toward_infinity, STD round_toward_neg_infinity}; + STD round_toward_infinity, STD round_toward_neg_infinity}; int i, j, ok; for (ok = 1, i = sizeof(fds) / sizeof(fds[0]); 0 < i;) { diff --git a/tests/utils/stl/test/tests.py b/tests/utils/stl/test/tests.py index 9180107d00a..697f3f26233 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -236,6 +236,7 @@ def _handleEnvlst(self, litConfig): if ('clang'.casefold() in os.path.basename(cxx).casefold()): self._addCustomFeature('clang') self._addCustomFeature('gcc-style-warnings') + self._addCustomFeature('character-conversion-warnings') if (targetArch == 'x64'.casefold()): self.compileFlags.append('-m64') diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 46b85cf616f..ea3df31f0d6 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -cmake_minimum_required(VERSION 4.2.3) +cmake_minimum_required(VERSION 4.3.1) project(msvc_standard_libraries_tools LANGUAGES CXX) add_subdirectory(format) diff --git a/tools/format/CMakeLists.txt b/tools/format/CMakeLists.txt index 8e2ed27a9ba..44f64e4b545 100644 --- a/tools/format/CMakeLists.txt +++ b/tools/format/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -cmake_minimum_required(VERSION 4.2.3) +cmake_minimum_required(VERSION 4.3.1) project(msvc_standard_libraries_format NONE) find_program(CLANG_FORMAT @@ -18,7 +18,7 @@ execute_process( ) if(clang_format_version MATCHES "clang-format version ([0-9]+\.[0-9]+\.[0-9]+)") - set(expected_version "20.1.8") + set(expected_version "22.1.3") if(CMAKE_MATCH_1 VERSION_LESS expected_version) message(FATAL_ERROR "Found clang-format: ${CLANG_FORMAT} (\"${CMAKE_MATCH_1}\", older than expected version \"${expected_version}\")") elseif(CMAKE_MATCH_1 VERSION_EQUAL expected_version) diff --git a/tools/validate/CMakeLists.txt b/tools/validate/CMakeLists.txt index 7232bcdba3c..7039a2f073f 100644 --- a/tools/validate/CMakeLists.txt +++ b/tools/validate/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -cmake_minimum_required(VERSION 4.2.3) +cmake_minimum_required(VERSION 4.3.1) project(msvc_standard_libraries_validate LANGUAGES CXX) add_executable(validate-binary validate.cpp)