mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-19 18:11:39 -05:00
Switch to VS17 and C++20 (#13368)
C++20 goodies include: * 3-way comparison operator `<=>` and `operator==() = default` * designated initializers * constraints and concepts * abbreviated function templates (`void foo(auto bar)`) * pack-expansions in lambda init-captures * heterogeneous lookups in `unordered_set` / `unordered_map` * `consteval` / `constinit` * `starts_with` / `ends_with` for `string` / `string_view` * `midpoint`, `lerp` * `<bit>` * `<ranges>` * `<span>` * `<barrier>` * `<latch>` * `<semaphore>`
This commit is contained in:
8
.github/actions/spelling/allow/allow.txt
vendored
8
.github/actions/spelling/allow/allow.txt
vendored
@@ -1,15 +1,16 @@
|
|||||||
admins
|
admins
|
||||||
|
allcolors
|
||||||
apc
|
apc
|
||||||
Apc
|
Apc
|
||||||
bsd
|
|
||||||
breadcrumb
|
breadcrumb
|
||||||
breadcrumbs
|
breadcrumbs
|
||||||
|
bsd
|
||||||
calt
|
calt
|
||||||
CMMI
|
|
||||||
ccmp
|
ccmp
|
||||||
changelog
|
changelog
|
||||||
clickable
|
clickable
|
||||||
clig
|
clig
|
||||||
|
CMMI
|
||||||
copyable
|
copyable
|
||||||
cybersecurity
|
cybersecurity
|
||||||
dalet
|
dalet
|
||||||
@@ -59,7 +60,6 @@ maxed
|
|||||||
mkmk
|
mkmk
|
||||||
mnt
|
mnt
|
||||||
mru
|
mru
|
||||||
noreply
|
|
||||||
nje
|
nje
|
||||||
noreply
|
noreply
|
||||||
ogonek
|
ogonek
|
||||||
@@ -86,6 +86,7 @@ timestamped
|
|||||||
TLDR
|
TLDR
|
||||||
tokenizes
|
tokenizes
|
||||||
tonos
|
tonos
|
||||||
|
toolset
|
||||||
tshe
|
tshe
|
||||||
uiatextrange
|
uiatextrange
|
||||||
UIs
|
UIs
|
||||||
@@ -97,4 +98,3 @@ We'd
|
|||||||
wildcards
|
wildcards
|
||||||
yeru
|
yeru
|
||||||
zhe
|
zhe
|
||||||
allcolors
|
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
https://(?:(?:[-a-zA-Z0-9?&=]*\.|)microsoft\.com)/[-a-zA-Z0-9?&=_#\/.]*
|
https?://\S+
|
||||||
https://aka\.ms/[-a-zA-Z0-9?&=\/_]*
|
|
||||||
https://www\.itscj\.ipsj\.or\.jp/iso-ir/[-0-9]+\.pdf
|
|
||||||
https://www\.vt100\.net/docs/[-a-zA-Z0-9#_\/.]*
|
|
||||||
https://www.w3.org/[-a-zA-Z0-9?&=\/_#]*
|
|
||||||
https://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]*
|
|
||||||
https://(?:[a-z-]+\.|)github(?:usercontent|)\.com/[-a-zA-Z0-9?%&=_\/.+]*
|
|
||||||
https://www.xfree86.org/[-a-zA-Z0-9?&=\/_#]*
|
|
||||||
[Pp]ublicKeyToken="?[0-9a-fA-F]{16}"?
|
[Pp]ublicKeyToken="?[0-9a-fA-F]{16}"?
|
||||||
(?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|</UniqueIdentifier)
|
(?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|</UniqueIdentifier)
|
||||||
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
|
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ pr: none
|
|||||||
|
|
||||||
pool:
|
pool:
|
||||||
name: WinDevPool-L
|
name: WinDevPool-L
|
||||||
demands: ImageOverride -equals WinDevVS16-latest
|
demands: ImageOverride -equals WinDevVS17-latest
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
- name: branding
|
- name: branding
|
||||||
@@ -195,7 +195,6 @@ jobs:
|
|||||||
condition: true
|
condition: true
|
||||||
inputs:
|
inputs:
|
||||||
solution: '**\OpenConsole.sln'
|
solution: '**\OpenConsole.sln'
|
||||||
vsVersion: 16.0
|
|
||||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /t:Terminal\CascadiaPackage /p:WindowsTerminalReleaseBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /t:Terminal\CascadiaPackage /p:WindowsTerminalReleaseBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||||
platform: $(BuildPlatform)
|
platform: $(BuildPlatform)
|
||||||
configuration: $(BuildConfiguration)
|
configuration: $(BuildConfiguration)
|
||||||
@@ -222,7 +221,6 @@ jobs:
|
|||||||
displayName: Build solution **\OpenConsole.sln for PublicTerminalCore
|
displayName: Build solution **\OpenConsole.sln for PublicTerminalCore
|
||||||
inputs:
|
inputs:
|
||||||
solution: '**\OpenConsole.sln'
|
solution: '**\OpenConsole.sln'
|
||||||
vsVersion: 16.0
|
|
||||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /p:WindowsTerminalReleaseBuild=true /t:Terminal\wpf\PublicTerminalCore
|
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /p:WindowsTerminalReleaseBuild=true /t:Terminal\wpf\PublicTerminalCore
|
||||||
platform: $(BuildPlatform)
|
platform: $(BuildPlatform)
|
||||||
configuration: $(BuildConfiguration)
|
configuration: $(BuildConfiguration)
|
||||||
@@ -231,7 +229,6 @@ jobs:
|
|||||||
displayName: Build solution **\OpenConsole.sln for ConPTY
|
displayName: Build solution **\OpenConsole.sln for ConPTY
|
||||||
inputs:
|
inputs:
|
||||||
solution: '**\OpenConsole.sln'
|
solution: '**\OpenConsole.sln'
|
||||||
vsVersion: 16.0
|
|
||||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /p:WindowsTerminalReleaseBuild=true /t:Conhost\Host_EXE;Conhost\winconpty_DLL
|
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /p:WindowsTerminalReleaseBuild=true /t:Conhost\Host_EXE;Conhost\winconpty_DLL
|
||||||
platform: $(BuildPlatform)
|
platform: $(BuildPlatform)
|
||||||
configuration: $(BuildConfiguration)
|
configuration: $(BuildConfiguration)
|
||||||
@@ -546,7 +543,6 @@ jobs:
|
|||||||
displayName: Build solution **\OpenConsole.sln for WPF Control
|
displayName: Build solution **\OpenConsole.sln for WPF Control
|
||||||
inputs:
|
inputs:
|
||||||
solution: '**\OpenConsole.sln'
|
solution: '**\OpenConsole.sln'
|
||||||
vsVersion: 16.0
|
|
||||||
msbuildArgs: /p:WindowsTerminalReleaseBuild=$(UseReleaseBranding);Version=$(XES_PACKAGEVERSIONNUMBER) /t:Pack
|
msbuildArgs: /p:WindowsTerminalReleaseBuild=$(UseReleaseBranding);Version=$(XES_PACKAGEVERSIONNUMBER) /t:Pack
|
||||||
platform: Any CPU
|
platform: Any CPU
|
||||||
configuration: $(BuildConfiguration)
|
configuration: $(BuildConfiguration)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
name: WinDevPoolOSS-L
|
name: WinDevPoolOSS-L
|
||||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
name: WinDevPool-L
|
name: WinDevPool-L
|
||||||
demands: ImageOverride -equals WinDevVS16-latest
|
demands: ImageOverride -equals WinDevVS17-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
@@ -27,7 +27,6 @@ jobs:
|
|||||||
displayName: 'Build solution **\OpenConsole.sln'
|
displayName: 'Build solution **\OpenConsole.sln'
|
||||||
inputs:
|
inputs:
|
||||||
solution: '**\OpenConsole.sln'
|
solution: '**\OpenConsole.sln'
|
||||||
vsVersion: 16.0
|
|
||||||
platform: '$(BuildPlatform)'
|
platform: '$(BuildPlatform)'
|
||||||
configuration: '$(BuildConfiguration)'
|
configuration: '$(BuildConfiguration)'
|
||||||
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
name: WinDevPoolOSS-L
|
name: WinDevPoolOSS-L
|
||||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
name: WinDevPool-L
|
name: WinDevPool-L
|
||||||
demands: ImageOverride -equals WinDevVS16-latest
|
demands: ImageOverride -equals WinDevVS17-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- template: build-console-steps.yml
|
- template: build-console-steps.yml
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
name: WinDevPoolOSS-L
|
name: WinDevPoolOSS-L
|
||||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
name: WinDevPool-L
|
name: WinDevPool-L
|
||||||
demands: ImageOverride -equals WinDevVS16-latest
|
demands: ImageOverride -equals WinDevVS17-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
@@ -37,7 +37,6 @@ jobs:
|
|||||||
displayName: 'Build solution **\OpenConsole.sln'
|
displayName: 'Build solution **\OpenConsole.sln'
|
||||||
inputs:
|
inputs:
|
||||||
solution: '**\OpenConsole.sln'
|
solution: '**\OpenConsole.sln'
|
||||||
vsVersion: 16.0
|
|
||||||
platform: '$(BuildPlatform)'
|
platform: '$(BuildPlatform)'
|
||||||
configuration: '$(BuildConfiguration)'
|
configuration: '$(BuildConfiguration)'
|
||||||
msbuildArgs: "${{ parameters.additionalBuildArguments }}"
|
msbuildArgs: "${{ parameters.additionalBuildArguments }}"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
name: WinDevPoolOSS-L
|
name: WinDevPoolOSS-L
|
||||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
name: WinDevPool-L
|
name: WinDevPool-L
|
||||||
demands: ImageOverride -equals WinDevVS16-latest
|
demands: ImageOverride -equals WinDevVS17-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- template: build-console-steps.yml
|
- template: build-console-steps.yml
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ steps:
|
|||||||
displayName: 'Build solution **\OpenConsole.sln'
|
displayName: 'Build solution **\OpenConsole.sln'
|
||||||
inputs:
|
inputs:
|
||||||
solution: '**\OpenConsole.sln'
|
solution: '**\OpenConsole.sln'
|
||||||
vsVersion: 16.0
|
|
||||||
platform: '$(BuildPlatform)'
|
platform: '$(BuildPlatform)'
|
||||||
configuration: '$(BuildConfiguration)'
|
configuration: '$(BuildConfiguration)'
|
||||||
msbuildArgs: "${{ parameters.additionalBuildArguments }} /p:PGOBuildMode=$(PGOBuildMode) /bl:$(Build.SourcesDirectory)\\msbuild.binlog"
|
msbuildArgs: "${{ parameters.additionalBuildArguments }} /p:PGOBuildMode=$(PGOBuildMode) /bl:$(Build.SourcesDirectory)\\msbuild.binlog"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
name: WinDevPoolOSS-L
|
name: WinDevPoolOSS-L
|
||||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
name: WinDevPool-L
|
name: WinDevPool-L
|
||||||
demands: ImageOverride -equals WinDevVS16-latest
|
demands: ImageOverride -equals WinDevVS17-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ winrt::Windows::Foundation::IAsyncOperation<winrt::hstring> FilePicker(HWND pare
|
|||||||
DWORD flags{};
|
DWORD flags{};
|
||||||
THROW_IF_FAILED(fileDialog->GetOptions(&flags));
|
THROW_IF_FAILED(fileDialog->GetOptions(&flags));
|
||||||
THROW_IF_FAILED(fileDialog->SetOptions(flags | FOS_FORCEFILESYSTEM | FOS_NOCHANGEDIR | FOS_DONTADDTORECENT)); // filesystem objects only; no recent places
|
THROW_IF_FAILED(fileDialog->SetOptions(flags | FOS_FORCEFILESYSTEM | FOS_NOCHANGEDIR | FOS_DONTADDTORECENT)); // filesystem objects only; no recent places
|
||||||
|
|
||||||
|
// BODGY: The MSVC 14.31.31103 toolset seems to misdiagnose this line.
|
||||||
|
#pragma warning(suppress : 26481) // Don't use pointer arithmetic. Use span instead (bounds.1).
|
||||||
customize(fileDialog.get());
|
customize(fileDialog.get());
|
||||||
|
|
||||||
const auto hr{ fileDialog->Show(parentHwnd) };
|
const auto hr{ fileDialog->Show(parentHwnd) };
|
||||||
|
|||||||
@@ -98,16 +98,20 @@
|
|||||||
<!--<WarningLevel>EnableAllWarnings</WarningLevel>-->
|
<!--<WarningLevel>EnableAllWarnings</WarningLevel>-->
|
||||||
<TreatWarningAsError>true</TreatWarningAsError>
|
<TreatWarningAsError>true</TreatWarningAsError>
|
||||||
<!--
|
<!--
|
||||||
C4103: alignment changed after including header, may be due to missing #pragma pack(pop)
|
|
||||||
Caused by a regression in VS 16.10, it detects the use of /pshpack[1248].h/ in system headers.
|
|
||||||
C4201: nonstandard extension used: nameless struct/union
|
C4201: nonstandard extension used: nameless struct/union
|
||||||
Conhost code uses a lot of nameless structs/unions.
|
Conhost code uses a lot of nameless structs/unions.
|
||||||
C4312: 'type cast': conversion from 'A' to 'B' of greater size
|
C4312: 'type cast': conversion from 'A' to 'B' of greater size
|
||||||
Conhost code converts DWORDs to HANDLEs for instance.
|
Conhost code converts DWORDs to HANDLEs for instance.
|
||||||
C4467: usage of ATL attributes is deprecated
|
C4467: usage of ATL attributes is deprecated
|
||||||
Conhost code still uses ATL.
|
Conhost code still uses ATL.
|
||||||
|
C26445: Do not assign gsl::span or std::string_view to a reference. They are cheap to construct and are not owners of the underlying data. (gsl.view).
|
||||||
|
Even for MSVC v19.32 this is actually far from true. Copying (as opposed to referencing) larger
|
||||||
|
than register-sized structures is fairly expensive. Example: https://godbolt.org/z/oPco88PaP
|
||||||
|
C26813: Use 'bitwise and' to check if a flag is set.
|
||||||
|
The MSVC v19.31 toolset has a bug where a pointer to an enum is incorrectly flagged with C26813.
|
||||||
|
It's supposed to be fixed with VS 17.2.1 and 17.3.0 and later respectively.
|
||||||
-->
|
-->
|
||||||
<DisableSpecificWarnings>4103;4201;4312;4467;5105;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4201;4312;4467;5105;26445;26813;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
<PreprocessorDefinitions>_WINDOWS;EXTERNAL_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_WINDOWS;EXTERNAL_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
|
||||||
@@ -118,8 +122,7 @@
|
|||||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
<UseStandardPreprocessor>true</UseStandardPreprocessor>
|
||||||
<LanguageStandard Condition="$(MSBuildVersion) < '17.0.0'">stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
<LanguageStandard Condition="$(MSBuildVersion) >= '17.0.0'">stdcpp20</LanguageStandard>
|
|
||||||
<LanguageStandard_C>stdc17</LanguageStandard_C>
|
<LanguageStandard_C>stdc17</LanguageStandard_C>
|
||||||
<AdditionalOptions>%(AdditionalOptions) /utf-8 /Zc:externConstexpr /Zc:lambda /Zc:throwingNew</AdditionalOptions>
|
<AdditionalOptions>%(AdditionalOptions) /utf-8 /Zc:externConstexpr /Zc:lambda /Zc:throwingNew</AdditionalOptions>
|
||||||
<ControlFlowGuard>Guard</ControlFlowGuard>
|
<ControlFlowGuard>Guard</ControlFlowGuard>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ USE_NATIVE_EH = 1
|
|||||||
# Compiler Settings
|
# Compiler Settings
|
||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
|
|
||||||
|
USE_STD_CPP20 = 1
|
||||||
MSC_WARNING_LEVEL = /W4 /WX
|
MSC_WARNING_LEVEL = /W4 /WX
|
||||||
USER_C_FLAGS = $(USER_C_FLAGS) /fp:fast /utf-8
|
USER_C_FLAGS = $(USER_C_FLAGS) /fp:fast /utf-8
|
||||||
|
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ void DxFontRenderData::_SetFeatures(const std::unordered_map<std::wstring_view,
|
|||||||
// Update our feature map with the provided features
|
// Update our feature map with the provided features
|
||||||
if (!features.empty())
|
if (!features.empty())
|
||||||
{
|
{
|
||||||
for (const auto [tag, param] : features)
|
for (const auto& [tag, param] : features)
|
||||||
{
|
{
|
||||||
if (tag.length() == TAG_LENGTH)
|
if (tag.length() == TAG_LENGTH)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user