Toolset update: VS 2022 17.1 Preview 4, ARM64EC (#2496)

This commit is contained in:
Stephan T. Lavavej 2022-01-25 22:33:39 -08:00 коммит произвёл GitHub
Родитель f575e7becd
Коммит fcd5cf555f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 118 добавлений и 109 удалений

Просмотреть файл

@ -140,7 +140,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem
# How To Build With The Visual Studio IDE # How To Build With The Visual Studio IDE
1. Install Visual Studio 2022 17.1 Preview 2 or later. 1. Install Visual Studio 2022 17.1 Preview 4 or later.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer. * We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja. This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.21 or later, and [Ninja][] 1.10.2 or later. * Otherwise, install [CMake][] 3.21 or later, and [Ninja][] 1.10.2 or later.
@ -155,7 +155,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem
# How To Build With A Native Tools Command Prompt # How To Build With A Native Tools Command Prompt
1. Install Visual Studio 2022 17.1 Preview 2 or later. 1. Install Visual Studio 2022 17.1 Preview 4 or later.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer. * We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja. This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.21 or later, and [Ninja][] 1.10.2 or later. * Otherwise, install [CMake][] 3.21 or later, and [Ninja][] 1.10.2 or later.

Просмотреть файл

@ -21,45 +21,18 @@ $ErrorActionPreference = 'Stop'
$Env:SuppressAzurePowerShellBreakingChangeWarnings = 'true' $Env:SuppressAzurePowerShellBreakingChangeWarnings = 'true'
$Location = 'westus2' $Location = 'westus2'
$Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd') $Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd-THHmm')
$VMSize = 'Standard_D32ads_v5' $VMSize = 'Standard_D32ads_v5'
$ProtoVMName = 'PROTOTYPE' $ProtoVMName = 'PROTOTYPE'
$LiveVMPrefix = 'BUILD' $LiveVMPrefix = 'BUILD'
$ImagePublisher = 'MicrosoftWindowsDesktop' $ImagePublisher = 'MicrosoftWindowsServer'
$ImageOffer = 'windows-11' $ImageOffer = 'WindowsServer'
$ImageSku = 'win11-21h2-ent' $ImageSku = '2022-datacenter-g2'
$ProgressActivity = 'Creating Scale Set' $ProgressActivity = 'Creating Scale Set'
$TotalProgress = 14 $TotalProgress = 14
$CurrentProgress = 1 $CurrentProgress = 1
<#
.SYNOPSIS
Returns whether there's a name collision in the resource group.
.DESCRIPTION
Find-ResourceGroupNameCollision takes a list of resources, and checks if $Test
collides names with any of the resources.
.PARAMETER Test
The name to test.
.PARAMETER Resources
The list of resources.
#>
function Find-ResourceGroupNameCollision {
[CmdletBinding()]
Param([string]$Test, $Resources)
foreach ($resource in $Resources) {
if ($resource.ResourceGroupName -eq $Test) {
return $true
}
}
return $false
}
<# <#
.SYNOPSIS .SYNOPSIS
Attempts to find a name that does not collide with any resources in the resource group. Attempts to find a name that does not collide with any resources in the resource group.
@ -76,10 +49,10 @@ function Find-ResourceGroupName {
[CmdletBinding()] [CmdletBinding()]
Param([string] $Prefix) Param([string] $Prefix)
$resources = Get-AzResourceGroup $existingNames = (Get-AzResourceGroup).ResourceGroupName
$result = $Prefix $result = $Prefix
$suffix = 0 $suffix = 0
while (Find-ResourceGroupNameCollision -Test $result -Resources $resources) { while ($result -in $existingNames) {
$suffix++ $suffix++
$result = "$Prefix-$suffix" $result = "$Prefix-$suffix"
} }
@ -170,7 +143,8 @@ Write-Progress `
-Status 'Setting the subscription context' ` -Status 'Setting the subscription context' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++) -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$IgnoredAzureContext = Set-AzContext -SubscriptionName CPP_STL_GitHub Set-AzContext -SubscriptionName CPP_STL_GitHub | Out-Null
az account set --subscription CPP_STL_GitHub
#################################################################################################### ####################################################################################################
Write-Progress ` Write-Progress `
@ -180,7 +154,7 @@ Write-Progress `
$ResourceGroupName = Find-ResourceGroupName $Prefix $ResourceGroupName = Find-ResourceGroupName $Prefix
$AdminPW = New-Password $AdminPW = New-Password
$IgnoredResourceGroup = New-AzResourceGroup -Name $ResourceGroupName -Location $Location New-AzResourceGroup -Name $ResourceGroupName -Location $Location | Out-Null
$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force $AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ('AdminUser', $AdminPWSecure) $Credential = New-Object System.Management.Automation.PSCredential ('AdminUser', $AdminPWSecure)
@ -196,19 +170,31 @@ $allowHttp = New-AzNetworkSecurityRuleConfig `
-Access Allow ` -Access Allow `
-Protocol Tcp ` -Protocol Tcp `
-Direction Outbound ` -Direction Outbound `
-Priority 1008 ` -Priority 1000 `
-SourceAddressPrefix * ` -SourceAddressPrefix * `
-SourcePortRange * ` -SourcePortRange * `
-DestinationAddressPrefix * ` -DestinationAddressPrefix * `
-DestinationPortRange @(80, 443) -DestinationPortRange @(80, 443)
$allowQuic = New-AzNetworkSecurityRuleConfig `
-Name AllowQUIC `
-Description 'Allow QUIC' `
-Access Allow `
-Protocol Udp `
-Direction Outbound `
-Priority 1010 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange 443
$allowDns = New-AzNetworkSecurityRuleConfig ` $allowDns = New-AzNetworkSecurityRuleConfig `
-Name AllowDNS ` -Name AllowDNS `
-Description 'Allow DNS' ` -Description 'Allow DNS' `
-Access Allow ` -Access Allow `
-Protocol * ` -Protocol * `
-Direction Outbound ` -Direction Outbound `
-Priority 1009 ` -Priority 1020 `
-SourceAddressPrefix * ` -SourceAddressPrefix * `
-SourcePortRange * ` -SourcePortRange * `
-DestinationAddressPrefix * ` -DestinationAddressPrefix * `
@ -220,7 +206,7 @@ $denyEverythingElse = New-AzNetworkSecurityRuleConfig `
-Access Deny ` -Access Deny `
-Protocol * ` -Protocol * `
-Direction Outbound ` -Direction Outbound `
-Priority 1010 ` -Priority 2000 `
-SourceAddressPrefix * ` -SourceAddressPrefix * `
-SourcePortRange * ` -SourcePortRange * `
-DestinationAddressPrefix * ` -DestinationAddressPrefix * `
@ -231,7 +217,7 @@ $NetworkSecurityGroup = New-AzNetworkSecurityGroup `
-Name $NetworkSecurityGroupName ` -Name $NetworkSecurityGroupName `
-ResourceGroupName $ResourceGroupName ` -ResourceGroupName $ResourceGroupName `
-Location $Location ` -Location $Location `
-SecurityRules @($allowHttp, $allowDns, $denyEverythingElse) -SecurityRules @($allowHttp, $allowQuic, $allowDns, $denyEverythingElse)
$SubnetName = $ResourceGroupName + '-Subnet' $SubnetName = $ResourceGroupName + '-Subnet'
$Subnet = New-AzVirtualNetworkSubnetConfig ` $Subnet = New-AzVirtualNetworkSubnetConfig `
@ -277,10 +263,10 @@ $VM = Set-AzVMSourceImage `
-Version latest -Version latest
$VM = Set-AzVMBootDiagnostic -VM $VM -Disable $VM = Set-AzVMBootDiagnostic -VM $VM -Disable
$IgnoredAzureOperationResponse = New-AzVm ` New-AzVm `
-ResourceGroupName $ResourceGroupName ` -ResourceGroupName $ResourceGroupName `
-Location $Location ` -Location $Location `
-VM $VM -VM $VM | Out-Null
#################################################################################################### ####################################################################################################
Write-Progress ` Write-Progress `
@ -303,7 +289,7 @@ Write-Progress `
-Status 'Restarting VM' ` -Status 'Restarting VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++) -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$IgnoredComputeLongRunningOperation = Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName | Out-Null
#################################################################################################### ####################################################################################################
Write-Progress ` Write-Progress `
@ -321,11 +307,11 @@ Write-Progress `
-Status 'Running provisioning script sysprep.ps1 in VM' ` -Status 'Running provisioning script sysprep.ps1 in VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++) -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$IgnoredRunCommandResult = Invoke-AzVMRunCommand ` Invoke-AzVMRunCommand `
-ResourceGroupName $ResourceGroupName ` -ResourceGroupName $ResourceGroupName `
-VMName $ProtoVMName ` -VMName $ProtoVMName `
-CommandId 'RunPowerShellScript' ` -CommandId 'RunPowerShellScript' `
-ScriptPath "$PSScriptRoot\sysprep.ps1" -ScriptPath "$PSScriptRoot\sysprep.ps1" | Out-Null
#################################################################################################### ####################################################################################################
Write-Progress ` Write-Progress `
@ -341,15 +327,15 @@ Write-Progress `
-Status 'Converting VM to Image' ` -Status 'Converting VM to Image' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++) -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$IgnoredComputeLongRunningOperation = Stop-AzVM ` Stop-AzVM `
-ResourceGroupName $ResourceGroupName ` -ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName ` -Name $ProtoVMName `
-Force -Force | Out-Null
$IgnoredComputeLongRunningOperation = Set-AzVM ` Set-AzVM `
-ResourceGroupName $ResourceGroupName ` -ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName ` -Name $ProtoVMName `
-Generalized -Generalized | Out-Null
$VM = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName $VM = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name $PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name
@ -362,11 +348,11 @@ Write-Progress `
-Status 'Deleting unused VM and disk' ` -Status 'Deleting unused VM and disk' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++) -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$IgnoredComputeLongRunningOperation = Remove-AzVM -Id $VM.ID -Force Remove-AzVM -Id $VM.ID -Force | Out-Null
$IgnoredOperationStatusResponse = Remove-AzDisk ` Remove-AzDisk `
-ResourceGroupName $ResourceGroupName ` -ResourceGroupName $ResourceGroupName `
-DiskName $PrototypeOSDiskName ` -DiskName $PrototypeOSDiskName `
-Force -Force | Out-Null
#################################################################################################### ####################################################################################################
Write-Progress ` Write-Progress `
@ -420,11 +406,34 @@ Write-Progress `
-Status 'Enabling VMSS diagnostic logs' ` -Status 'Enabling VMSS diagnostic logs' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++) -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$StorageAccountName = 'stlvmssdiaglogssa'
$ExpirationDate = (Get-Date -AsUTC).AddYears(1).ToString('yyyy-MM-ddTHH:mmZ')
$StorageAccountSASToken = $(az storage account generate-sas `
--account-name $StorageAccountName `
--expiry $ExpirationDate `
--permissions acuw `
--resource-types co `
--services bt `
--https-only `
--output tsv `
2> $null)
$DiagnosticsDefaultConfig = $(az vmss diagnostics get-default-config --is-windows-os 2> $null). `
Replace('__DIAGNOSTIC_STORAGE_ACCOUNT__', $StorageAccountName). `
Replace('__VM_OR_VMSS_RESOURCE_ID__', $Vmss.Id)
Out-File -FilePath "$PSScriptRoot\vmss-config.json" -InputObject $DiagnosticsDefaultConfig
$DiagnosticsProtectedSettings = "{'storageAccountName': '$StorageAccountName', "
$DiagnosticsProtectedSettings += "'storageAccountSasToken': '?$StorageAccountSASToken'}"
az vmss diagnostics set ` az vmss diagnostics set `
--resource-group $ResourceGroupName ` --resource-group $ResourceGroupName `
--vmss-name $VmssName ` --vmss-name $VmssName `
--settings "$PSScriptRoot\vmss-config.json" ` --settings "$PSScriptRoot\vmss-config.json" `
--protected-settings "$PSScriptRoot\vmss-protected.json" ` --protected-settings "$DiagnosticsProtectedSettings" `
--output none --output none
#################################################################################################### ####################################################################################################

Просмотреть файл

@ -133,6 +133,7 @@ $Workloads = @(
'Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre', 'Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre',
'Microsoft.VisualStudio.Component.VC.Tools.ARM', 'Microsoft.VisualStudio.Component.VC.Tools.ARM',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64', 'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64EC',
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
# TRANSITION, LLVM-51128 (Clang 12 targeting ARM64 is incompatible with WinSDK 10.0.20348.0) # TRANSITION, LLVM-51128 (Clang 12 targeting ARM64 is incompatible with WinSDK 10.0.20348.0)
'Microsoft.VisualStudio.Component.Windows10SDK.19041' 'Microsoft.VisualStudio.Component.Windows10SDK.19041'
@ -141,7 +142,7 @@ $Workloads = @(
$ReleaseInPath = 'Preview' $ReleaseInPath = 'Preview'
$Sku = 'Enterprise' $Sku = 'Enterprise'
$VisualStudioBootstrapperUrl = 'https://aka.ms/vs/17/pre/vs_enterprise.exe' $VisualStudioBootstrapperUrl = 'https://aka.ms/vs/17/pre/vs_enterprise.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.10.1/python-3.10.1-amd64.exe' $PythonUrl = 'https://www.python.org/ftp/python/3.10.2/python-3.10.2-amd64.exe'
$CudaUrl = ` $CudaUrl = `
'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe' 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe'

Просмотреть файл

@ -7,7 +7,7 @@ variables:
tmpDir: 'D:\Temp' tmpDir: 'D:\Temp'
buildOutputLocation: 'D:\build' buildOutputLocation: 'D:\build'
pool: 'StlBuild-2022-01-13-2' pool: 'StlBuild-2022-01-25-T1318'
stages: stages:
- stage: Code_Format - stage: Code_Format

Просмотреть файл

@ -44,6 +44,7 @@
#pragma message("see https://github.com/microsoft/STL/issues/1814 for details.") #pragma message("see https://github.com/microsoft/STL/issues/1814 for details.")
#else // ^^^ !defined(__cpp_lib_format) / defined(__cpp_lib_format) vvv #else // ^^^ !defined(__cpp_lib_format) / defined(__cpp_lib_format) vvv
#include <algorithm>
#include <charconv> #include <charconv>
#include <concepts> #include <concepts>
#include <cstdint> #include <cstdint>
@ -1978,8 +1979,13 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _CharT* _Value);
template <class _CharT, class _OutputIt> template <class _CharT, class _OutputIt>
_NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, basic_string_view<_CharT> _Value); _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, basic_string_view<_CharT> _Value);
#pragma warning(push) template <class _CharT>
#pragma warning(disable : 4365) // 'argument': conversion from 'char' to 'const wchar_t', signed/unsigned mismatch struct _Widen_char {
_NODISCARD _CharT operator()(const char _Ch) const noexcept {
return static_cast<_CharT>(_Ch);
}
};
// clang-format off // clang-format off
template <class _CharT, class _OutputIt, class _Arithmetic> template <class _CharT, class _OutputIt, class _Arithmetic>
requires (is_arithmetic_v<_Arithmetic> && !_CharT_or_bool<_Arithmetic, _CharT>) requires (is_arithmetic_v<_Arithmetic> && !_CharT_or_bool<_Arithmetic, _CharT>)
@ -1989,9 +1995,8 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _Arithmetic _Value) {
char _Buffer[_Format_min_buffer_length]; char _Buffer[_Format_min_buffer_length];
const auto [_End, _Ec] = _STD to_chars(_Buffer, _STD end(_Buffer), _Value); const auto [_End, _Ec] = _STD to_chars(_Buffer, _STD end(_Buffer), _Value);
_STL_ASSERT(_Ec == errc{}, "to_chars failed"); _STL_ASSERT(_Ec == errc{}, "to_chars failed");
return _RANGES _Copy_unchecked(_Buffer, _End, _STD move(_Out)).out; return _RANGES transform(_Buffer, _End, _STD move(_Out), _Widen_char<_CharT>{}).out;
} }
#pragma warning(pop)
template <class _CharT, class _OutputIt> template <class _CharT, class _OutputIt>
_NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const bool _Value) { _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const bool _Value) {
@ -2008,8 +2013,6 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _CharT _Value) {
return _Out; return _Out;
} }
#pragma warning(push)
#pragma warning(disable : 4365) // 'argument': conversion from 'char' to 'const wchar_t', signed/unsigned mismatch
template <class _CharT, class _OutputIt> template <class _CharT, class _OutputIt>
_NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const void* const _Value) { _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const void* const _Value) {
// TRANSITION, Reusable buffer // TRANSITION, Reusable buffer
@ -2018,9 +2021,8 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const void* const _Value) {
_STL_ASSERT(_Ec == errc{}, "to_chars failed"); _STL_ASSERT(_Ec == errc{}, "to_chars failed");
*_Out++ = '0'; *_Out++ = '0';
*_Out++ = 'x'; *_Out++ = 'x';
return _RANGES _Copy_unchecked(_Buffer, _End, _STD move(_Out)).out; return _RANGES transform(_Buffer, _End, _STD move(_Out), _Widen_char<_CharT>{}).out;
} }
#pragma warning(pop)
template <class _CharT, class _OutputIt> template <class _CharT, class _OutputIt>
_NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _CharT* _Value) { _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _CharT* _Value) {
@ -2172,7 +2174,7 @@ _NODISCARD _OutputIt _Write_separated_integer(const char* _First, const char* co
++_Repeats; ++_Repeats;
} }
} }
_Out = _RANGES _Copy_unchecked(_First, _Last - _Grouped, _STD move(_Out)).out; _Out = _RANGES transform(_First, _Last - _Grouped, _STD move(_Out), _Widen_char<_CharT>{}).out;
_First = _Last - _Grouped; _First = _Last - _Grouped;
for (; _Separators > 0; --_Separators) { for (; _Separators > 0; --_Separators) {
@ -2183,7 +2185,7 @@ _NODISCARD _OutputIt _Write_separated_integer(const char* _First, const char* co
} }
*_Out++ = _Separator; *_Out++ = _Separator;
_Out = _RANGES _Copy_unchecked(_First, _First + *_Group_it, _STD move(_Out)).out; _Out = _RANGES transform(_First, _First + *_Group_it, _STD move(_Out), _Widen_char<_CharT>{}).out;
_First += *_Group_it; _First += *_Group_it;
} }
_STL_INTERNAL_CHECK(_First == _Last); _STL_INTERNAL_CHECK(_First == _Last);
@ -2231,8 +2233,6 @@ template <class _CharT, class _OutputIt>
_NODISCARD _OutputIt _Fmt_write( _NODISCARD _OutputIt _Fmt_write(
_OutputIt _Out, basic_string_view<_CharT> _Value, const _Basic_format_specs<_CharT>& _Specs, _Lazy_locale); _OutputIt _Out, basic_string_view<_CharT> _Value, const _Basic_format_specs<_CharT>& _Specs, _Lazy_locale);
#pragma warning(push)
#pragma warning(disable : 4365) // 'argument': conversion from 'char' to 'const wchar_t', signed/unsigned mismatch
template <class _CharT, class _OutputIt, integral _Integral> template <class _CharT, class _OutputIt, integral _Integral>
_NODISCARD _OutputIt _Write_integral( _NODISCARD _OutputIt _Write_integral(
_OutputIt _Out, const _Integral _Value, _Basic_format_specs<_CharT> _Specs, _Lazy_locale _Locale) { _OutputIt _Out, const _Integral _Value, _Basic_format_specs<_CharT> _Specs, _Lazy_locale _Locale) {
@ -2313,9 +2313,9 @@ _NODISCARD _OutputIt _Write_integral(
#pragma warning(disable : 4296) // '<': expression is always false #pragma warning(disable : 4296) // '<': expression is always false
_Out = _Write_sign(_STD move(_Out), _Specs._Sgn, _Value < _Integral{0}); _Out = _Write_sign(_STD move(_Out), _Specs._Sgn, _Value < _Integral{0});
#pragma warning(pop) #pragma warning(pop)
_Out = _RANGES _Copy_unchecked(_Prefix.begin(), _Prefix.end(), _STD move(_Out)).out; _Out = _RANGES transform(_Prefix, _STD move(_Out), _Widen_char<_CharT>{}).out;
if (_Write_leading_zeroes && _Width < _Specs._Width) { if (_Write_leading_zeroes && _Width < _Specs._Width) {
_Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, '0'); _Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, _CharT{'0'});
} }
if (_Separators > 0) { if (_Separators > 0) {
@ -2323,7 +2323,7 @@ _NODISCARD _OutputIt _Write_integral(
_STD use_facet<numpunct<_CharT>>(_Locale._Get()).thousands_sep(), // _STD use_facet<numpunct<_CharT>>(_Locale._Get()).thousands_sep(), //
_Separators, _STD move(_Out)); _Separators, _STD move(_Out));
} }
return _RANGES _Copy_unchecked(_Buffer_start, _End, _STD move(_Out)).out; return _RANGES transform(_Buffer_start, _End, _STD move(_Out), _Widen_char<_CharT>{}).out;
}; };
if (_Write_leading_zeroes) { if (_Write_leading_zeroes) {
@ -2332,7 +2332,6 @@ _NODISCARD _OutputIt _Write_integral(
return _Write_aligned(_STD move(_Out), _Width, _Specs, _Fmt_align::_Right, _Writer); return _Write_aligned(_STD move(_Out), _Width, _Specs, _Fmt_align::_Right, _Writer);
} }
#pragma warning(pop)
// clang-format off // clang-format off
template <class _CharT, class _OutputIt, integral _Integral> template <class _CharT, class _OutputIt, integral _Integral>
@ -2382,8 +2381,6 @@ _NODISCARD _OutputIt _Fmt_write(
return _Fmt_write(_STD move(_Out), basic_string_view<_CharT>{&_Value, 1}, _Specs, _Locale); return _Fmt_write(_STD move(_Out), basic_string_view<_CharT>{&_Value, 1}, _Specs, _Locale);
} }
#pragma warning(push)
#pragma warning(disable : 4365) // 'argument': conversion from 'char' to 'const wchar_t', signed/unsigned mismatch
template <class _CharT, class _OutputIt, floating_point _Float> template <class _CharT, class _OutputIt, floating_point _Float>
_NODISCARD _OutputIt _Fmt_write( _NODISCARD _OutputIt _Fmt_write(
_OutputIt _Out, const _Float _Value, const _Basic_format_specs<_CharT>& _Specs, _Lazy_locale _Locale) { _OutputIt _Out, const _Float _Value, const _Basic_format_specs<_CharT>& _Specs, _Lazy_locale _Locale) {
@ -2569,7 +2566,7 @@ _NODISCARD _OutputIt _Fmt_write(
_Out = _Write_sign(_STD move(_Out), _Sgn, _Is_negative); _Out = _Write_sign(_STD move(_Out), _Sgn, _Is_negative);
if (_Write_leading_zeroes && _Width < _Specs._Width) { if (_Write_leading_zeroes && _Width < _Specs._Width) {
_Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, '0'); _Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, _CharT{'0'});
} }
if (_Specs._Localized) { if (_Specs._Localized) {
@ -2587,7 +2584,7 @@ _NODISCARD _OutputIt _Fmt_write(
} }
} }
_Out = _RANGES _Copy_unchecked(_Buffer_start, _Exponent_start, _STD move(_Out)).out; _Out = _RANGES transform(_Buffer_start, _Exponent_start, _STD move(_Out), _Widen_char<_CharT>{}).out;
if (_Specs._Alt && _Append_decimal) { if (_Specs._Alt && _Append_decimal) {
*_Out++ = '.'; *_Out++ = '.';
} }
@ -2596,7 +2593,7 @@ _NODISCARD _OutputIt _Fmt_write(
*_Out++ = '0'; *_Out++ = '0';
} }
return _RANGES _Copy_unchecked(_Exponent_start, _Result.ptr, _STD move(_Out)).out; return _RANGES transform(_Exponent_start, _Result.ptr, _STD move(_Out), _Widen_char<_CharT>{}).out;
}; };
if (_Write_leading_zeroes) { if (_Write_leading_zeroes) {
@ -2605,7 +2602,6 @@ _NODISCARD _OutputIt _Fmt_write(
return _Write_aligned(_STD move(_Out), _Width, _Specs, _Fmt_align::_Right, _Writer); return _Write_aligned(_STD move(_Out), _Width, _Specs, _Fmt_align::_Right, _Writer);
} }
#pragma warning(pop)
template <class _CharT, class _OutputIt> template <class _CharT, class _OutputIt>
_NODISCARD _OutputIt _Fmt_write( _NODISCARD _OutputIt _Fmt_write(
@ -3044,48 +3040,38 @@ _OutputIt format_to(_OutputIt _Out, const locale& _Loc, const _Fmt_wstring<_Type
return _STD vformat_to(_STD move(_Out), _Loc, _Fmt._Str, _STD make_wformat_args(_Args...)); return _STD vformat_to(_STD move(_Out), _Loc, _Fmt._Str, _STD make_wformat_args(_Args...));
} }
#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1433873 template <int = 0> // improves throughput, see GH-2329
#define _TEMPLATE_INT_0_NODISCARD \ _NODISCARD string vformat(const string_view _Fmt, const format_args _Args) {
template <int = 0> /* improves throughput, see GH-2329 */ \
_NODISCARD
#else // ^^^ no workaround / workaround vvv
#define _TEMPLATE_INT_0_NODISCARD _NODISCARD inline
#endif // ^^^ workaround ^^^
_TEMPLATE_INT_0_NODISCARD
string vformat(const string_view _Fmt, const format_args _Args) {
string _Str; string _Str;
_Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity());
_STD vformat_to(back_insert_iterator{_Str}, _Fmt, _Args); _STD vformat_to(back_insert_iterator{_Str}, _Fmt, _Args);
return _Str; return _Str;
} }
_TEMPLATE_INT_0_NODISCARD template <int = 0> // improves throughput, see GH-2329
wstring vformat(const wstring_view _Fmt, const wformat_args _Args) { _NODISCARD wstring vformat(const wstring_view _Fmt, const wformat_args _Args) {
wstring _Str; wstring _Str;
_Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity());
_STD vformat_to(back_insert_iterator{_Str}, _Fmt, _Args); _STD vformat_to(back_insert_iterator{_Str}, _Fmt, _Args);
return _Str; return _Str;
} }
_TEMPLATE_INT_0_NODISCARD template <int = 0> // improves throughput, see GH-2329
string vformat(const locale& _Loc, const string_view _Fmt, const format_args _Args) { _NODISCARD string vformat(const locale& _Loc, const string_view _Fmt, const format_args _Args) {
string _Str; string _Str;
_Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity());
_STD vformat_to(back_insert_iterator{_Str}, _Loc, _Fmt, _Args); _STD vformat_to(back_insert_iterator{_Str}, _Loc, _Fmt, _Args);
return _Str; return _Str;
} }
_TEMPLATE_INT_0_NODISCARD template <int = 0> // improves throughput, see GH-2329
wstring vformat(const locale& _Loc, const wstring_view _Fmt, const wformat_args _Args) { _NODISCARD wstring vformat(const locale& _Loc, const wstring_view _Fmt, const wformat_args _Args) {
wstring _Str; wstring _Str;
_Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity());
_STD vformat_to(back_insert_iterator{_Str}, _Loc, _Fmt, _Args); _STD vformat_to(back_insert_iterator{_Str}, _Loc, _Fmt, _Args);
return _Str; return _Str;
} }
#undef _TEMPLATE_INT_0_NODISCARD // TRANSITION, VSO-1433873
template <class... _Types> template <class... _Types>
_NODISCARD string format(const _Fmt_string<_Types...> _Fmt, _Types&&... _Args) { _NODISCARD string format(const _Fmt_string<_Types...> _Fmt, _Types&&... _Args) {
return _STD vformat(_Fmt._Str, _STD make_format_args(_Args...)); return _STD vformat(_Fmt._Str, _STD make_format_args(_Args...));

Просмотреть файл

@ -1532,7 +1532,7 @@ class _Move_only_function_call {
}; };
// A script to generate the specializations is at // A script to generate the specializations is at
// /tools/move_only_function_specializations/move_only_function_specializations.py // /tools/scripts/move_only_function_specializations.py
// (Avoiding C++ preprocessor for better IDE navigation and debugging experience) // (Avoiding C++ preprocessor for better IDE navigation and debugging experience)
template <class _Rx, class... _Types> template <class _Rx, class... _Types>

Просмотреть файл

@ -3331,16 +3331,6 @@ namespace ranges {
// clang-format off // clang-format off
subrange() requires default_initializable<_It> = default; subrange() requires default_initializable<_It> = default;
#if !defined(_MSVC_INTERNAL_TESTING) && !defined(__clang__) && !defined(__EDG__) // TRANSITION, VS 17.1p3
// This was originally annotated as a workaround for DevCom-1331017, but the problem it corrects continued to
// manifest after that bug was fixed. We reduced a repro to file an additional bug, but the underlying issue had
// already been fixed in the internal compiler (see GH-2326).
constexpr subrange(const subrange&) = default;
constexpr subrange(subrange&&) = default;
constexpr subrange& operator=(const subrange&) = default;
constexpr subrange& operator=(subrange&&) = default;
#endif // ^^^ workaround ^^^
template <_Convertible_to_non_slicing<_It> _It2> template <_Convertible_to_non_slicing<_It> _It2>
constexpr subrange(_It2 _First_, _Se _Last_) requires (!_Store_size) constexpr subrange(_It2 _First_, _Se _Last_) requires (!_Store_size)
: _First(_STD move(_First_)), _Last(_STD move(_Last_)) {} : _First(_STD move(_First_)), _Last(_STD move(_Last_)) {}

Просмотреть файл

@ -696,9 +696,7 @@ int run_test()
{ {
optional<B> opt; optional<B> opt;
ASSERT_NOT_NOEXCEPT(std::hash<optional<B>>()(opt)); ASSERT_NOT_NOEXCEPT(std::hash<optional<B>>()(opt));
#ifndef __EDG__ // TRANSITION, DevCom-1633478 / VSO-1460046
ASSERT_NOT_NOEXCEPT(std::hash<optional<const B>>()(opt)); ASSERT_NOT_NOEXCEPT(std::hash<optional<const B>>()(opt));
#endif // ^^^ no workaround ^^^
} }
{ {

Просмотреть файл

@ -1,6 +1,8 @@
# Copyright (c) Microsoft Corporation. # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# This script generates the partial specializations of _Move_only_function_call in <functional>.
def specialization(cv, ref, ref_inv, noex, noex_val, callable): def specialization(cv, ref, ref_inv, noex, noex_val, callable):
return f"""template <class _Rx, class... _Types> return f"""template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) {cv} {ref} {noex}> class _Move_only_function_call<_Rx(_Types...) {cv} {ref} {noex}>

Просмотреть файл

@ -0,0 +1,23 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# This script prints the output of test failures that were recorded by `stl-lit.py -o TEST_LOG_FILENAME`.
import json
import sys
if len(sys.argv) != 2:
sys.exit(f"Usage: python {sys.argv[0]} TEST_LOG_FILENAME")
test_log = json.load(open(sys.argv[1]))
for result in test_log["tests"]:
if not result["code"] in ["PASS", "UNSUPPORTED", "XFAIL"]:
print("code: {}".format(result["code"]))
# Ignore result["elapsed"].
print("name: {}".format(result["name"]))
# The JSON contains embedded CRLFs (which aren't affected by opening the file in text mode).
# If we don't replace these CRLFs with LFs here, this script will appear to be okay in the console,
# but redirecting it to a file will result in ugly double newlines.
print("output: {}".format(result["output"].replace("\r\n", "\n")))
print("==================================================")