From f6c629aa8fc1a9c83e2ba4d16bdc9f8721f4a06f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 9 Nov 2020 23:34:44 -0800 Subject: [PATCH 01/19] Work around VSO-1236041 (error LNK2019 pair piecewise_construct_t). --- stl/inc/tuple | 80 ------------------- stl/inc/utility | 77 +++++++++++++++++- .../test.cpp | 2 +- 3 files changed, 77 insertions(+), 82 deletions(-) diff --git a/stl/inc/tuple b/stl/inc/tuple index 7060e6968bd..c58a422da34 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -754,73 +754,6 @@ _CONSTEXPR20 void swap(tuple<_Types...>& _Left, tuple<_Types...>& _Right) noexce return _Left.swap(_Right); } -// CLASS _Tuple_element (find element by type) -template -struct _Tuple_element {}; // backstop _Tuple_element definition - -template -struct _Tuple_element<_This, tuple<_This, _Rest...>> { // select first element - static_assert(!_Is_any_of_v<_This, _Rest...>, "duplicate type T in get(tuple)"); - using _Ttype = tuple<_This, _Rest...>; -}; - -template -struct _Tuple_element<_Ty, tuple<_This, _Rest...>> { // recursive _Tuple_element definition - using _Ttype = typename _Tuple_element<_Ty, tuple<_Rest...>>::_Ttype; -}; - -// FUNCTION TEMPLATE get (by index) -template -_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>& get(tuple<_Types...>& _Tuple) noexcept { - using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; - return static_cast<_Ttype&>(_Tuple)._Myfirst._Val; -} - -template -_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>& get(const tuple<_Types...>& _Tuple) noexcept { - using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; - return static_cast(_Tuple)._Myfirst._Val; -} - -template -_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>&& get(tuple<_Types...>&& _Tuple) noexcept { - using _Ty = tuple_element_t<_Index, tuple<_Types...>>; - using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; - return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val); -} - -template -_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>&& get(const tuple<_Types...>&& _Tuple) noexcept { - using _Ty = tuple_element_t<_Index, tuple<_Types...>>; - using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; - return static_cast(static_cast(_Tuple)._Myfirst._Val); -} - -// FUNCTION TEMPLATE get (by type) -template -_NODISCARD constexpr _Ty& get(tuple<_Types...>& _Tuple) noexcept { - using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; - return static_cast<_Ttype&>(_Tuple)._Myfirst._Val; -} - -template -_NODISCARD constexpr const _Ty& get(const tuple<_Types...>& _Tuple) noexcept { - using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; - return static_cast(_Tuple)._Myfirst._Val; -} - -template -_NODISCARD constexpr _Ty&& get(tuple<_Types...>&& _Tuple) noexcept { - using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; - return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val); -} - -template -_NODISCARD constexpr const _Ty&& get(const tuple<_Types...>&& _Tuple) noexcept { - using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; - return static_cast(static_cast(_Tuple)._Myfirst._Val); -} - // CONSTRUCTOR TEMPLATES FOR tuple template template , int>> @@ -971,19 +904,6 @@ _NODISCARD constexpr _Ty make_from_tuple(_Tuple&& _Tpl) { // construct _Ty from } #endif // _HAS_CXX17 -// TEMPLATE CONSTRUCTOR pair::pair(tuple, tuple, sequence, sequence) -template -template -constexpr pair<_Ty1, _Ty2>::pair( - _Tuple1& _Val1, _Tuple2& _Val2, index_sequence<_Indexes1...>, index_sequence<_Indexes2...>) - : first(_STD get<_Indexes1>(_STD move(_Val1))...), second(_STD get<_Indexes2>(_STD move(_Val2))...) {} - -// TEMPLATE CONSTRUCTOR pair::pair(piecewise_construct_t, tuple, tuple) -template -template -_CONSTEXPR20 pair<_Ty1, _Ty2>::pair(piecewise_construct_t, tuple<_Types1...> _Val1, tuple<_Types2...> _Val2) - : pair(_Val1, _Val2, index_sequence_for<_Types1...>{}, index_sequence_for<_Types2...>{}) {} - // STRUCT TEMPLATE uses_allocator template struct uses_allocator, _Alloc> : true_type {}; // true_type if container allocator enabled diff --git a/stl/inc/utility b/stl/inc/utility index 53e38b608af..9bef42b4f9b 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -266,7 +266,8 @@ struct pair { // store a pair of values constexpr pair(_Tuple1& _Val1, _Tuple2& _Val2, index_sequence<_Indexes1...>, index_sequence<_Indexes2...>); template - _CONSTEXPR20 pair(piecewise_construct_t, tuple<_Types1...> _Val1, tuple<_Types2...> _Val2); + _CONSTEXPR20 pair(piecewise_construct_t, tuple<_Types1...> _Val1, tuple<_Types2...> _Val2) + : pair(_Val1, _Val2, index_sequence_for<_Types1...>{}, index_sequence_for<_Types2...>{}) {} pair& operator=(const volatile pair&) = delete; @@ -497,6 +498,73 @@ template struct _MSVC_KNOWN_SEMANTICS tuple_element<_Index, tuple<_This, _Rest...>> : tuple_element<_Index - 1, tuple<_Rest...>> {}; // recursive tuple_element definition +// FUNCTION TEMPLATE get (by index) +template +_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>& get(tuple<_Types...>& _Tuple) noexcept { + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast<_Ttype&>(_Tuple)._Myfirst._Val; +} + +template +_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>& get(const tuple<_Types...>& _Tuple) noexcept { + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast(_Tuple)._Myfirst._Val; +} + +template +_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>&& get(tuple<_Types...>&& _Tuple) noexcept { + using _Ty = tuple_element_t<_Index, tuple<_Types...>>; + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val); +} + +template +_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>&& get(const tuple<_Types...>&& _Tuple) noexcept { + using _Ty = tuple_element_t<_Index, tuple<_Types...>>; + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast(static_cast(_Tuple)._Myfirst._Val); +} + +// CLASS _Tuple_element (find element by type) +template +struct _Tuple_element {}; // backstop _Tuple_element definition + +template +struct _Tuple_element<_This, tuple<_This, _Rest...>> { // select first element + static_assert(!_Is_any_of_v<_This, _Rest...>, "duplicate type T in get(tuple)"); + using _Ttype = tuple<_This, _Rest...>; +}; + +template +struct _Tuple_element<_Ty, tuple<_This, _Rest...>> { // recursive _Tuple_element definition + using _Ttype = typename _Tuple_element<_Ty, tuple<_Rest...>>::_Ttype; +}; + +// FUNCTION TEMPLATE get (by type) +template +_NODISCARD constexpr _Ty& get(tuple<_Types...>& _Tuple) noexcept { + using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; + return static_cast<_Ttype&>(_Tuple)._Myfirst._Val; +} + +template +_NODISCARD constexpr const _Ty& get(const tuple<_Types...>& _Tuple) noexcept { + using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; + return static_cast(_Tuple)._Myfirst._Val; +} + +template +_NODISCARD constexpr _Ty&& get(tuple<_Types...>&& _Tuple) noexcept { + using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; + return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val); +} + +template +_NODISCARD constexpr const _Ty&& get(const tuple<_Types...>&& _Tuple) noexcept { + using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; + return static_cast(static_cast(_Tuple)._Myfirst._Val); +} + // TUPLE INTERFACE TO pair template struct tuple_size> : integral_constant {}; // size of pair @@ -590,6 +658,13 @@ _NODISCARD constexpr const _Ty2&& get( return _STD get<1>(_STD move(_Pr)); } +// TEMPLATE CONSTRUCTOR pair::pair(tuple, tuple, sequence, sequence) +template +template +constexpr pair<_Ty1, _Ty2>::pair( + _Tuple1& _Val1, _Tuple2& _Val2, index_sequence<_Indexes1...>, index_sequence<_Indexes2...>) + : first(_STD get<_Indexes1>(_STD move(_Val1))...), second(_STD get<_Indexes2>(_STD move(_Val2))...) {} + // FUNCTION TEMPLATE exchange template _CONSTEXPR20 _Ty exchange(_Ty& _Val, _Other&& _New_val) noexcept( diff --git a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp index 0967e4abc28..ab8f16dcc9e 100644 --- a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp +++ b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp @@ -453,7 +453,7 @@ int main() { { puts("Testing ."); -#if 0 // TRANSITION, DevCom-1160260 (partial specialization), VSO-1236041 (error LNK2019 pair piecewise_construct_t) +#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) map m{{10, 11}, {20, 22}, {30, 33}, {40, 44}, {50, 55}}; assert(m[30] == 33); #endif // ^^^ no workaround ^^^ From 30807d6173d98ddd249175e67cb11b32f15d5a1a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Nov 2020 17:32:12 -0800 Subject: [PATCH 02/19] create-vmss.ps1: Don't print credentials; we don't need them. --- azure-devops/create-vmss.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index 797e00f20c0..8afcb742164 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -391,6 +391,4 @@ New-AzVmss ` Write-Progress -Activity $ProgressActivity -Completed Write-Host "Location: $Location" Write-Host "Resource group name: $ResourceGroupName" -Write-Host "User name: AdminUser" -Write-Host "Using generated password: $AdminPW" Write-Host 'Finished!' From fba2de0707f84f1b64cac8a18edcc157ac67fb71 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Nov 2020 18:43:36 -0800 Subject: [PATCH 03/19] provision-image.ps1: Attempt to install the WDK. --- azure-devops/provision-image.ps1 | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index ea84e185ab1..d09d0e6db72 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -88,6 +88,9 @@ $Workloads = @( 'Microsoft.VisualStudio.Component.VC.CMake.Project', 'Microsoft.VisualStudio.Component.VC.CoreIde', 'Microsoft.VisualStudio.Component.VC.Llvm.Clang', + 'Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre', + 'Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre', + 'Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre', 'Microsoft.VisualStudio.Component.VC.Tools.ARM', 'Microsoft.VisualStudio.Component.VC.Tools.ARM64', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', @@ -99,6 +102,9 @@ $Sku = 'Enterprise' $VisualStudioBootstrapperUrl = 'https://aka.ms/vs/16/pre/vs_enterprise.exe' $PythonUrl = 'https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe' +# https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk +$WindowsDriverKitUrl = 'https://go.microsoft.com/fwlink/?linkid=2128854' + $CudaUrl = ` 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe' $CudaFeatures = 'nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 gpu_library_advisor_10.1 memcheck_10.1 ' + ` @@ -223,6 +229,36 @@ Function InstallPython { } } +<# +.SYNOPSIS +Installs the Windows Driver Kit. + +.DESCRIPTION +InstallWindowsDriverKit installs the Windows Driver Kit from the supplied URL. + +.PARAMETER Url +The URL of the Windows Driver Kit installer. +#> +Function InstallWindowsDriverKit { + Param( + [String]$Url + ) + + Write-Host 'Downloading the Windows Driver Kit...' + [string]$installerPath = Get-TempFilePath -Extension 'exe' + curl.exe -L -o $installerPath -s -S $Url + Write-Host 'Installing the Windows Driver Kit...' + $proc = Start-Process -FilePath $installerPath -ArgumentList ` + @('/quiet', '/features', 'OptionId.WindowsDriverKitComplete') -Wait -PassThru + $exitCode = $proc.ExitCode + if ($exitCode -eq 0) { + Write-Host 'Installation successful!' + } + else { + Write-Error "Installation failed! Exited with $exitCode." + } +} + <# .SYNOPSIS Installs NVIDIA's CUDA Toolkit. @@ -300,6 +336,7 @@ Add-MpPreference -ExclusionProcess python.exe InstallPython $PythonUrl InstallVisualStudio -Workloads $Workloads -BootstrapperUrl $VisualStudioBootstrapperUrl +InstallWindowsDriverKit $WindowsDriverKitUrl InstallCuda -Url $CudaUrl -Features $CudaFeatures Write-Host 'Updating PATH...' From ca5ddf182622ea7756de1e55901a05489acac1ba Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Nov 2020 19:01:51 -0800 Subject: [PATCH 04/19] Add Set-AzContext. --- azure-devops/create-vmss.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index 8afcb742164..1434ce0ac48 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -25,7 +25,7 @@ $LiveVMPrefix = 'BUILD' $WindowsServerSku = '2019-Datacenter' $ProgressActivity = 'Creating Scale Set' -$TotalProgress = 11 +$TotalProgress = 12 $CurrentProgress = 1 <# @@ -159,6 +159,14 @@ function Wait-Shutdown { } +#################################################################################################### +Write-Progress ` + -Activity $ProgressActivity ` + -Status 'Setting the subscription context' ` + -PercentComplete (100 / $TotalProgress * $CurrentProgress++) + +Set-AzContext -SubscriptionName CPP_STL_GitHub + #################################################################################################### Write-Progress ` -Activity $ProgressActivity ` From e524c6dcbf502d7cf952670616d84d4580f5acec Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Nov 2020 21:02:09 -0800 Subject: [PATCH 05/19] Use the 16.9p1 pool, require CMake 3.18, update README. --- CMakeLists.txt | 2 +- README.md | 8 ++++---- azure-pipelines.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5029bd03aec..a96985b708d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if (NOT DEFINED CMAKE_TOOLCHAIN_FILE AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/vcpkg set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") endif() -cmake_minimum_required(VERSION 3.17) +cmake_minimum_required(VERSION 3.18) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) project(msvc_standard_libraries LANGUAGES CXX) diff --git a/README.md b/README.md index 0a31b882771..6cfb740f8a7 100644 --- a/README.md +++ b/README.md @@ -143,10 +143,10 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem The STL uses boost-math headers to provide P0226R1 Mathematical Special Functions. We recommend using [vcpkg][] to acquire this dependency. -1. Install Visual Studio 2019 16.8 Preview 5 or later. +1. Install Visual Studio 2019 16.9 Preview 1 or later. * We recommend selecting "C++ CMake tools for Windows" in the VS Installer. This will ensure that you're using supported versions of CMake and Ninja. - * Otherwise, install [CMake][] 3.17 or later, and [Ninja][] 1.8.2 or later. + * Otherwise, install [CMake][] 3.18 or later, and [Ninja][] 1.8.2 or later. 2. Open Visual Studio, and choose the "Clone or check out code" option. Enter the URL of this repository, `https://github.com/microsoft/STL`. 3. Open a terminal in the IDE with `` Ctrl + ` `` (by default) or press on "View" in the top bar, and then "Terminal". @@ -158,10 +158,10 @@ acquire this dependency. # How To Build With A Native Tools Command Prompt -1. Install Visual Studio 2019 16.8 Preview 5 or later. +1. Install Visual Studio 2019 16.9 Preview 1 or later. * We recommend selecting "C++ CMake tools for Windows" in the VS Installer. This will ensure that you're using supported versions of CMake and Ninja. - * Otherwise, install [CMake][] 3.17 or later, and [Ninja][] 1.8.2 or later. + * Otherwise, install [CMake][] 3.18 or later, and [Ninja][] 1.8.2 or later. 2. Open a command prompt. 3. Change directories to a location where you'd like a clone of this STL repository. 4. `git clone https://github.com/microsoft/STL` diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 71a79fe47eb..8530fa6b2ef 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,7 +6,7 @@ variables: tmpDir: 'D:\Temp' -pool: 'StlBuild-2020-10-23' +pool: 'StlBuild-2020-11-10' stages: - stage: Code_Format From f615054324c9f6f574e6b860c7c7cb91db83aa9a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Nov 2020 23:27:26 -0800 Subject: [PATCH 06/19] Update libcxx/expected_results.txt. --- tests/libcxx/expected_results.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index f4855a8b0cb..86731f4c4d2 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -501,7 +501,7 @@ std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp FAIL std/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp FAIL std/utilities/memory/default.allocator/allocator.globals/eq.pass.cpp FAIL -std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp FAIL +std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp:1 FAIL std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp FAIL std/utilities/memory/specialized.algorithms/specialized.destroy/destroy.pass.cpp FAIL std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_at.pass.cpp FAIL From 9975ed72001ff4a7042d9f7b517285e75506abb2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Nov 2020 23:43:39 -0800 Subject: [PATCH 07/19] Remove workarounds for Standard Library Header Units. --- stl/inc/memory_resource | 2 +- .../test.cpp | 41 ++----------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index 3aebab8a602..bb47641ee87 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -661,7 +661,7 @@ namespace pmr { } protected: - virtual void* do_allocate(size_t _Bytes, size_t _Align) override { // TRANSITION, DevCom-1159869 + virtual void* do_allocate(const size_t _Bytes, const size_t _Align) override { // allocate from the current buffer or a new larger buffer from upstream if (!_STD align(_Align, _Bytes, _Current_buffer, _Space_available)) { _Increase_capacity(_Bytes, _Align); diff --git a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp index ab8f16dcc9e..62a53d0bdd7 100644 --- a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp +++ b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp @@ -186,18 +186,14 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1159995 (UDLs) constexpr chrono::seconds dur = 3min; -#else // ^^^ no workaround / workaround vvv - constexpr chrono::seconds dur = chrono::minutes{3}; -#endif // ^^^ workaround ^^^ assert(dur.count() == 180); static_assert(dur.count() == 180); } { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1161187 (access control), VSO-1236034 (error LNK2005: _Yarn) +#ifdef MSVC_INTERNAL_TESTING // TRANSITION, VSO-1236034 (error LNK2005: _Yarn) const string utf8_koshka_cat{"\xD0\xBA\xD0\xBE\xD1\x88\xD0\xBA\xD0\xB0_\xF0\x9F\x90\x88"}; const wstring utf16_koshka_cat{L"\x043A\x043E\x0448\x043A\x0430_\xD83D\xDC08"}; wstring_convert> conv; @@ -275,10 +271,8 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) const deque d{10, 20, 30, 40, 50}; assert(d[2] == 30); -#endif // ^^^ no workaround ^^^ } { @@ -313,10 +307,8 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) const forward_list fl{10, 20, 30, 40, 50}; assert(*next(fl.begin(), 2) == 30); -#endif // ^^^ no workaround ^^^ } { @@ -436,10 +428,8 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) const list l{10, 20, 30, 40, 50}; assert(*next(l.begin(), 2) == 30); -#endif // ^^^ no workaround ^^^ } { @@ -453,10 +443,8 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) map m{{10, 11}, {20, 22}, {30, 33}, {40, 44}, {50, 55}}; assert(m[30] == 33); -#endif // ^^^ no workaround ^^^ } { @@ -558,7 +546,6 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) queue q; q.push(10); q.push(20); @@ -587,7 +574,6 @@ int main() { assert(pq.top() == 10); pq.pop(); assert(pq.empty()); -#endif // ^^^ no workaround ^^^ } { @@ -608,8 +594,8 @@ int main() { assert(ranges::distance(views::filter(arr, [](int x) { return x == 0; })) == 4); static_assert(ranges::distance(views::filter(arr, [](int x) { return x != 0; })) == 5); #elif defined(MSVC_INTERNAL_TESTING) // TRANSITION, VSO-1237145 (trailing requires clause) - auto is_zero = [](int x) { return x == 0; }; - using FV1 = ranges::filter_view, decltype(is_zero)>; + auto is_zero = [](int x) { return x == 0; }; + using FV1 = ranges::filter_view, decltype(is_zero)>; assert(ranges::distance(FV1{arr, is_zero}) == 4); constexpr auto not_zero = [](int x) { return x != 0; }; using FV2 = ranges::filter_view, remove_const_t>; @@ -640,14 +626,12 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1162644 (deprecated warning) vector>> v; v.push_back(11); v.push_back(22); v.push_back(33); constexpr int expected[]{11, 22, 33}; assert(equal(v.begin(), v.end(), begin(expected), end(expected))); -#endif // ^^^ no workaround ^^^ } { @@ -678,14 +662,12 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) const set s{10, 20, 30, 40, 50}; assert(*next(s.begin(), 2) == 30); const multiset ms{10, 20, 20, 30, 30, 30, 40, 40, 40, 40}; const auto p = ms.equal_range(30); assert(distance(p.first, p.second) == 3); -#endif // ^^^ no workaround ^^^ } { @@ -748,7 +730,6 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) stack s; s.push(10); s.push(20); @@ -761,7 +742,6 @@ int main() { assert(s.top() == 10); s.pop(); assert(s.empty()); -#endif // ^^^ no workaround ^^^ } { @@ -802,11 +782,7 @@ int main() { } l.count_down(); // tell main() that we're done while (!token.stop_requested()) { -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1159995 (UDLs) this_thread::sleep_for(10ms); // not a timing assumption; avoids spinning furiously -#else // ^^^ no workaround / workaround vvv - this_thread::sleep_for(chrono::milliseconds{10}); // not a timing assumption -#endif // ^^^ workaround ^^^ } vec.push_back(-1000); // indicate that token.stop_requested() returned true }}; @@ -818,14 +794,7 @@ int main() { 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1, -1000}; -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) assert(equal(vec.begin(), vec.end(), begin(expected), end(expected))); -#else // ^^^ no workaround / workaround vvv - assert(vec.size() == size(expected)); - for (size_t i = 0; i < vec.size(); ++i) { - assert(vec[i] == expected[i]); - } -#endif // ^^^ workaround ^^^ } { @@ -936,22 +905,18 @@ int main() { { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) unordered_map um{{1, 1}, {2, 4}, {3, 9}, {4, 16}, {5, 25}}; for (const auto& p : um) { assert(p.first * p.first == p.second); } -#endif // ^^^ no workaround ^^^ } { puts("Testing ."); -#ifdef MSVC_INTERNAL_TESTING // TRANSITION, DevCom-1160260 (partial specialization) unordered_set us{10, 20, 30, 40, 50}; for (const auto& elem : us) { assert(elem % 10 == 0); } -#endif // ^^^ no workaround ^^^ } { From 155fa21ff45abdee11bec0b919d1645a50cc1edd Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Nov 2020 23:50:05 -0800 Subject: [PATCH 08/19] Remove __cpp_lib_coroutine 197000L workaround. --- stl/inc/yvals_core.h | 6 +----- .../test.compile.pass.cpp | 13 ++++--------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 66410d27b3f..c4be5ea8b38 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1184,12 +1184,8 @@ #define __cpp_lib_constexpr_tuple 201811L #define __cpp_lib_constexpr_utility 201811L -#ifdef __cpp_impl_coroutine // TRANSITION, Clang and EDG coroutine support -#if __cpp_impl_coroutine >= 201902L +#ifdef __cpp_impl_coroutine // TRANSITION, Clang coroutine support #define __cpp_lib_coroutine 201902L -#else // ^^^ __cpp_impl_coroutine >= 201902L ^^^ / vvv __cpp_impl_coroutine < 201902L vvv -#define __cpp_lib_coroutine 197000L // TRANSITION, VS 2019 16.8 Preview 4 -#endif // ^^^ __cpp_impl_coroutine < 201902L ^^^ #endif // __cpp_impl_coroutine #define __cpp_lib_destroying_delete 201806L diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index bfef5de1293..a513a4f5332 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -509,18 +509,13 @@ STATIC_ASSERT(__cpp_lib_constexpr_utility == 201811L); #endif #endif -#if _HAS_CXX20 && defined(__cpp_impl_coroutine) // TRANSITION, Clang and EDG coroutine support -#if __cpp_impl_coroutine >= 201902L -#define ExpectedCppLibCoroutine 201902L -#else -#define ExpectedCppLibCoroutine 197000L // TRANSITION, VS 2019 16.8 Preview 4 -#endif +#if _HAS_CXX20 && defined(__cpp_impl_coroutine) // TRANSITION, Clang coroutine support #ifndef __cpp_lib_coroutine #error __cpp_lib_coroutine is not defined -#elif __cpp_lib_coroutine != ExpectedCppLibCoroutine -#error __cpp_lib_coroutine is not ExpectedCppLibCoroutine +#elif __cpp_lib_coroutine != 201902L +#error __cpp_lib_coroutine is not 201902L #else -STATIC_ASSERT(__cpp_lib_coroutine == ExpectedCppLibCoroutine); +STATIC_ASSERT(__cpp_lib_coroutine == 201902L); #endif #else #ifdef __cpp_lib_coroutine From baaac2405aa698bbe488939724cbb53b2653b543 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Nov 2020 23:53:09 -0800 Subject: [PATCH 09/19] Remove DevCom-1159442 workarounds. --- tests/std/tests/P0896R4_views_common/test.cpp | 3 --- tests/std/tests/P0896R4_views_drop_while/test.cpp | 3 --- tests/std/tests/P0896R4_views_filter/test.cpp | 6 ------ tests/std/tests/P0896R4_views_reverse/test.cpp | 6 ------ tests/std/tests/P0896R4_views_take_while/test.cpp | 3 --- tests/std/tests/P0896R4_views_transform/test.cpp | 3 --- 6 files changed, 24 deletions(-) diff --git a/tests/std/tests/P0896R4_views_common/test.cpp b/tests/std/tests/P0896R4_views_common/test.cpp index 111c1eac49e..65aa11ba02e 100644 --- a/tests/std/tests/P0896R4_views_common/test.cpp +++ b/tests/std/tests/P0896R4_views_common/test.cpp @@ -357,9 +357,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } // Validate common_view::base() && (NB: do this last since it leaves r moved-from) -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as auto b2 = move(r).base(); static_assert(noexcept(move(r).base()) == is_nothrow_move_constructible_v); if (!is_empty) { diff --git a/tests/std/tests/P0896R4_views_drop_while/test.cpp b/tests/std/tests/P0896R4_views_drop_while/test.cpp index ab834b012a7..8fe111ed586 100644 --- a/tests/std/tests/P0896R4_views_drop_while/test.cpp +++ b/tests/std/tests/P0896R4_views_drop_while/test.cpp @@ -152,9 +152,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } // Validate deduction guide -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as auto r = drop_while_view{forward(rng), is_less_than<3>}; assert(ranges::equal(r, expected)); if constexpr (forward_range) { diff --git a/tests/std/tests/P0896R4_views_filter/test.cpp b/tests/std/tests/P0896R4_views_filter/test.cpp index 558e580cac8..48572a89c82 100644 --- a/tests/std/tests/P0896R4_views_filter/test.cpp +++ b/tests/std/tests/P0896R4_views_filter/test.cpp @@ -149,9 +149,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } // Validate deduction guide -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as auto r = filter_view{forward(rng), is_even}; assert(ranges::equal(r, expected)); if constexpr (forward_range) { @@ -263,9 +260,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } // Validate filter_view::base() && (NB: do this last since it leaves r moved-from) -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 if (forward_range) { // intentionally not if constexpr same_as auto b2 = move(r).base(); STATIC_ASSERT(noexcept(move(r).base()) == is_nothrow_move_constructible_v); diff --git a/tests/std/tests/P0896R4_views_reverse/test.cpp b/tests/std/tests/P0896R4_views_reverse/test.cpp index f1a41979340..3fdf5315a70 100644 --- a/tests/std/tests/P0896R4_views_reverse/test.cpp +++ b/tests/std/tests/P0896R4_views_reverse/test.cpp @@ -160,9 +160,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } // Validate deduction guide -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as auto r = reverse_view{forward(rng)}; assert(ranges::equal(r, expected)); @@ -294,9 +291,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } // Validate reverse_view::base() && (NB: do this last since it leaves r moved-from) -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as auto b2 = move(r).base(); static_assert(noexcept(move(r).base()) == is_nothrow_move_constructible_v); if (!is_empty) { diff --git a/tests/std/tests/P0896R4_views_take_while/test.cpp b/tests/std/tests/P0896R4_views_take_while/test.cpp index 180a6d6f30e..67bd3a8e73d 100644 --- a/tests/std/tests/P0896R4_views_take_while/test.cpp +++ b/tests/std/tests/P0896R4_views_take_while/test.cpp @@ -154,9 +154,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } // Validate deduction guide -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as auto r = take_while_view{forward(rng), is_less_than<3>}; assert(ranges::equal(r, expected)); diff --git a/tests/std/tests/P0896R4_views_transform/test.cpp b/tests/std/tests/P0896R4_views_transform/test.cpp index 4de0159d1a7..75c8e68f892 100644 --- a/tests/std/tests/P0896R4_views_transform/test.cpp +++ b/tests/std/tests/P0896R4_views_transform/test.cpp @@ -311,9 +311,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } // Validate transform_view::base() && (NB: do this last since it leaves r moved-from) -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 if (forward_range) { // intentionally not if constexpr same_as auto b2 = move(r).base(); STATIC_ASSERT(noexcept(move(r).base()) == is_nothrow_move_constructible_v); From cf0ffed8ecc235f5ec975944b9e2834395e8ad04 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 11 Nov 2020 15:22:28 -0800 Subject: [PATCH 10/19] Remove VSO-571749 workaround. --- stl/inc/filesystem | 8 -------- 1 file changed, 8 deletions(-) diff --git a/stl/inc/filesystem b/stl/inc/filesystem index 948ac146e73..52e41e51fec 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -622,7 +622,6 @@ namespace filesystem { _NODISCARD inline bool _Is_drive_prefix_with_slash_slash_question(const wstring_view _Text) { // test if _Text starts with a \\?\X: prefix - using namespace _STD string_view_literals; // TRANSITION, VSO-571749 return _Text.size() >= 6 && _Text._Starts_with(LR"(\\?\)"sv) && _Is_drive_prefix(_Text.data() + 4); } @@ -1250,8 +1249,6 @@ namespace filesystem { } _NODISCARD path lexically_normal() const { - using namespace _STD string_view_literals; // TRANSITION, VSO-571749 - constexpr wstring_view _Dot = L"."sv; constexpr wstring_view _Dot_dot = L".."sv; @@ -1686,8 +1683,6 @@ namespace filesystem { } _NODISCARD inline path path::lexically_relative(const path& _Base) const { - using namespace _STD string_view_literals; // TRANSITION, VSO-571749 - constexpr wstring_view _Dot = L"."sv; constexpr wstring_view _Dot_dot = L".."sv; @@ -1810,7 +1805,6 @@ namespace filesystem { private: static string _Pretty_message(const string_view _Op, const path& _Path1, const path& _Path2 = {}) { - using namespace _STD string_view_literals; // TRANSITION, VSO-571749 string _Result; // Convert the paths to narrow encoding in a way that gracefully handles non-encodable characters const auto _Code_page = __std_fs_code_page(); @@ -2550,7 +2544,6 @@ namespace filesystem { _NODISCARD static __std_win_error _Open_dir( path& _Path, const directory_options _Options_arg, _Find_file_handle& _Dir, __std_fs_find_data& _Data) { - using namespace _STD string_view_literals; // TRANSITION, VSO-571749 const size_t _Null_term_len = _CSTD wcslen(_Path.c_str()); if (_Null_term_len == 0 || _Null_term_len != _Path.native().size()) { return __std_win_error::_File_not_found; @@ -3021,7 +3014,6 @@ namespace filesystem { // FUNCTION canonical _NODISCARD inline __std_win_error _Canonical(path& _Result, const wstring& _Text) { // pre: _Result.empty() - using namespace _STD string_view_literals; // TRANSITION, VSO-571749 if (_Text.empty()) { return __std_win_error::_Success; } From 9db7cddcefe4dcafe88ef220a6e6f7df9f066741 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 11 Nov 2020 15:27:05 -0800 Subject: [PATCH 11/19] Enable test_borrowed_range for ranges::ref_view. --- tests/std/tests/P0896R4_ranges_range_machinery/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp b/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp index bb57295ec6c..576c4340517 100644 --- a/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp +++ b/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp @@ -1498,8 +1498,8 @@ namespace borrowed_range_testing { STATIC_ASSERT(test_borrowed_range, std::span::iterator>()); STATIC_ASSERT(test_borrowed_range, std::span::iterator>()); STATIC_ASSERT(test_borrowed_range, int*>()); -#if 0 // TRANSITION, future STATIC_ASSERT(test_borrowed_range, int*>()); +#if 0 // TRANSITION, future STATIC_ASSERT(test_borrowed_range, ...>()); #endif // TRANSITION, future From ca1784d8bc4fb443085988d309f702d97bdb74ca Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 11 Nov 2020 15:35:21 -0800 Subject: [PATCH 12/19] Remove VSO-587956 workaround. --- tests/std/tests/P0433R2_deduction_guides/test.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/std/tests/P0433R2_deduction_guides/test.cpp b/tests/std/tests/P0433R2_deduction_guides/test.cpp index dd11ad849d9..6a819a3216f 100644 --- a/tests/std/tests/P0433R2_deduction_guides/test.cpp +++ b/tests/std/tests/P0433R2_deduction_guides/test.cpp @@ -91,14 +91,12 @@ long add(short x, int y) { return x + y; } -struct UniqueTagCanDeduceFrom {}; // TRANSITION, VSO-587956 - template class ClassTemplate, typename... CtorArgs> struct CanDeduceFromHelper : false_type {}; template