Skip to content

Commit

Permalink
Toolset update: VS 2022 17.4 Preview 3, Clang 15 (#3155)
Browse files Browse the repository at this point in the history
Co-authored-by: Casey Carter <[email protected]>
  • Loading branch information
StephanTLavavej and CaseyCarter authored Oct 14, 2022
1 parent b29a16b commit 2f8342a
Show file tree
Hide file tree
Showing 170 changed files with 2,140 additions and 2,079 deletions.
45 changes: 36 additions & 9 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# https://releases.llvm.org/15.0.0/tools/clang/docs/ClangFormatStyleOptions.html

---
# Language: Cpp
Expand All @@ -12,12 +12,32 @@ AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
# AlignArrayOfStructures: None
# TRANSITION, LLVM-51935 (try using AlignArrayOfStructures after this crash is fixed)
# AlignConsecutiveMacros: None
AlignConsecutiveMacros: Consecutive
# AlignConsecutiveAssignments: None
# AlignConsecutiveAssignments:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCompound: false
# PadOperators: true
AlignConsecutiveAssignments: Consecutive
# AlignConsecutiveBitFields: None
# AlignConsecutiveDeclarations: None
# AlignConsecutiveBitFields:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCompound: false
# PadOperators: false
# AlignConsecutiveDeclarations:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCompound: false
# PadOperators: false
# AlignConsecutiveMacros:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCompound: false
# PadOperators: false
AlignConsecutiveMacros: Consecutive
# AlignEscapedNewlines: Right
AlignEscapedNewlines: Left
# AlignOperands: Align
Expand Down Expand Up @@ -64,7 +84,7 @@ AlwaysBreakTemplateDeclarations: Yes
# SplitEmptyNamespace: true
# BreakBeforeBinaryOperators: None
BreakBeforeBinaryOperators: NonAssignment
# BreakBeforeConceptDeclarations: true
# BreakBeforeConceptDeclarations: Always
# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
# BreakInheritanceList: BeforeColon
Expand Down Expand Up @@ -138,12 +158,13 @@ IndentCaseBlocks: true
# IndentGotoLabels: true
# IndentPPDirectives: None
# IndentExternBlock: AfterExternBlock
# IndentRequires: false
IndentRequires: true
# IndentRequiresClause: true
# IndentWidth: 2
IndentWidth: 4
# IndentWrappedFunctionNames: false
IndentWrappedFunctionNames: true
# InsertBraces: false
InsertBraces: true
# InsertTrailingCommas: None
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
Expand Down Expand Up @@ -177,6 +198,7 @@ PointerAlignment: Left
# ReferenceAlignment: Pointer
# ReflowComments: true
# RemoveBracesLLVM: false
# RequiresClausePosition: OwnLine
# SeparateDefinitionBlocks: Leave
# ShortNamespaceLines: 1
# SortIncludes: CaseSensitive
Expand All @@ -199,7 +221,12 @@ SpaceAfterCStyleCast: true
# AfterFunctionDeclarationName: false
# AfterIfMacros: true
# AfterOverloadedOperator: false
# AfterRequiresInClause: false
# AfterRequiresInExpression: false
# BeforeNonEmptyParentheses: false
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterRequiresInClause: true
# SpaceAroundPointerQualifiers: Default
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyBlock: false
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,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

1. Install Visual Studio 2022 17.4 Preview 2 or later.
1. Install Visual Studio 2022 17.4 Preview 3 or later.
* Select "Windows 11 SDK (10.0.22000.0)" 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.
Expand All @@ -157,7 +157,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

1. Install Visual Studio 2022 17.4 Preview 2 or later.
1. Install Visual Studio 2022 17.4 Preview 3 or later.
* Select "Windows 11 SDK (10.0.22000.0)" 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.
Expand Down
6 changes: 1 addition & 5 deletions azure-devops/create-1es-hosted-pool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,9 @@ Display-ProgressBar -Status 'Creating resource group'

$ResourceGroupName = 'StlBuild-' + $CurrentDate.ToString('yyyy-MM-ddTHHmm')

# TRANSITION, this opt-in tag should be unnecessary after 2022-09-30.
$SimplySecureV2OptInTag = @{ 'NRMSV2OptIn' = $CurrentDate.ToString('yyyyMMdd'); }

New-AzResourceGroup `
-Name $ResourceGroupName `
-Location $Location `
-Tag $SimplySecureV2OptInTag | Out-Null
-Location $Location | Out-Null

####################################################################################################
Display-ProgressBar -Status 'Creating credentials'
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $Workloads = @(
$ReleaseInPath = 'Preview'
$Sku = 'Enterprise'
$VisualStudioBootstrapperUrl = 'https://aka.ms/vs/17/pre/vs_enterprise.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.10.7/python-3.10.7-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.10.8/python-3.10.8-amd64.exe'

$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_511.23_windows.exe'

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variables:
buildOutputLocation: 'D:\build'

pool:
name: 'StlBuild-2022-09-14T1332-Pool'
name: 'StlBuild-2022-10-11T1916-Pool'
demands: EnableSpotVM -equals true

pr:
Expand Down
11 changes: 4 additions & 7 deletions stl/inc/__msvc_chrono.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,16 @@ namespace chrono {
constexpr duration() = default;

template <class _Rep2,
enable_if_t<is_convertible_v<const _Rep2&,
_Rep> && (treat_as_floating_point_v<_Rep> || !treat_as_floating_point_v<_Rep2>),
enable_if_t<is_convertible_v<const _Rep2&, _Rep>
&& (treat_as_floating_point_v<_Rep> || !treat_as_floating_point_v<_Rep2>),
int> = 0>
constexpr explicit duration(const _Rep2& _Val) noexcept(
is_arithmetic_v<_Rep>&& is_arithmetic_v<_Rep2>) // strengthened
: _MyRep(static_cast<_Rep>(_Val)) {}

template <class _Rep2, class _Period2,
enable_if_t<
treat_as_floating_point_v<
_Rep> || (_Ratio_divide_sfinae<_Period2, _Period>::den == 1 && !treat_as_floating_point_v<_Rep2>),
enable_if_t<treat_as_floating_point_v<_Rep>
|| (_Ratio_divide_sfinae<_Period2, _Period>::den == 1 && !treat_as_floating_point_v<_Rep2>),
int> = 0>
constexpr duration(const duration<_Rep2, _Period2>& _Dur) noexcept(
is_arithmetic_v<_Rep>&& is_arithmetic_v<_Rep2>) // strengthened
Expand Down Expand Up @@ -408,13 +407,11 @@ namespace chrono {
}

#ifdef __cpp_lib_concepts
// clang-format off
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
requires three_way_comparable<typename common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>::rep>
_NODISCARD constexpr auto
operator<=>(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept(
is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ {
// clang-format on
using _CT = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
return _CT(_Left).count() <=> _CT(_Right).count();
}
Expand Down
64 changes: 21 additions & 43 deletions stl/inc/__msvc_iter_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,43 +34,29 @@ _EXPORT_STD struct contiguous_iterator_tag : random_access_iterator_tag {};

template <class _Ty>
concept _Dereferenceable = requires(_Ty& __t) {
{ *__t } -> _Can_reference;
};
{ *__t } -> _Can_reference;
};

template <class _Ty>
concept _Has_member_iterator_concept = requires {
typename _Ty::iterator_concept;
};
concept _Has_member_iterator_concept = requires { typename _Ty::iterator_concept; };

template <class _Ty>
concept _Has_member_iterator_category = requires {
typename _Ty::iterator_category;
};
concept _Has_member_iterator_category = requires { typename _Ty::iterator_category; };

template <class _Ty>
concept _Has_member_value_type = requires {
typename _Ty::value_type;
};
concept _Has_member_value_type = requires { typename _Ty::value_type; };

template <class _Ty>
concept _Has_member_element_type = requires {
typename _Ty::element_type;
};
concept _Has_member_element_type = requires { typename _Ty::element_type; };

template <class _Ty>
concept _Has_member_difference_type = requires {
typename _Ty::difference_type;
};
concept _Has_member_difference_type = requires { typename _Ty::difference_type; };

template <class _Ty>
concept _Has_member_pointer = requires {
typename _Ty::pointer;
};
concept _Has_member_pointer = requires { typename _Ty::pointer; };

template <class _Ty>
concept _Has_member_reference = requires {
typename _Ty::reference;
};
concept _Has_member_reference = requires { typename _Ty::reference; };

_EXPORT_STD template <class>
struct incrementable_traits {};
Expand All @@ -91,16 +77,14 @@ struct incrementable_traits<_Ty> {

template <class _Ty>
concept _Can_difference = requires(const _Ty& __a, const _Ty& __b) {
{ __a - __b } -> integral;
};
{ __a - __b } -> integral;
};

// clang-format off
template <class _Ty>
requires (!_Has_member_difference_type<_Ty> && _Can_difference<_Ty>)
struct incrementable_traits<_Ty> {
using difference_type = make_signed_t<decltype(_STD declval<_Ty>() - _STD declval<_Ty>())>;
};
// clang-format on

template <class _Ty>
concept _Is_from_primary = _Same_impl<typename _Ty::_From_primary, _Ty>;
Expand Down Expand Up @@ -142,16 +126,14 @@ struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::value_ty
template <_Has_member_element_type _Ty>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::element_type> {};

// clang-format off
template <_Has_member_value_type _Ty>
requires _Has_member_element_type<_Ty>
struct indirectly_readable_traits<_Ty> {};

template <_Has_member_value_type _Ty>
requires _Has_member_element_type<_Ty>
&& same_as<remove_cv_t<typename _Ty::value_type>, remove_cv_t<typename _Ty::element_type>>
&& same_as<remove_cv_t<typename _Ty::value_type>, remove_cv_t<typename _Ty::element_type>>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::value_type> {};
// clang-format on

_EXPORT_STD template <class _Ty>
using iter_value_t = typename conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
Expand All @@ -165,7 +147,7 @@ struct _Iterator_traits_base {};

template <class _It>
concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_type<_It> //
&& _Has_member_reference<_It> && _Has_member_iterator_category<_It>;
&& _Has_member_reference<_It> && _Has_member_iterator_category<_It>;

template <bool _Has_member_typedef>
struct _Old_iter_traits_pointer {
Expand Down Expand Up @@ -257,9 +239,7 @@ struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_decltype> {
};

template <class _Ty>
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 <bool _Has_member_typedef>
struct _Iter_traits_reference {
Expand Down Expand Up @@ -311,10 +291,10 @@ struct _Iter_traits_category3<false> {

template <class _It>
concept _Cpp17_bidi_delta = requires(_It __i) {
{ --__i } -> same_as<_It&>;
{ __i-- } -> convertible_to<const _It&>;
requires same_as<decltype(*__i--), iter_reference_t<_It>>;
};
{ --__i } -> same_as<_It&>;
{ __i-- } -> convertible_to<const _It&>;
requires same_as<decltype(*__i--), iter_reference_t<_It>>;
};

template <bool _Is_forward>
struct _Iter_traits_category2 {
Expand Down Expand Up @@ -383,9 +363,9 @@ struct iterator_traits<_Ty*> {

template <class _Ty>
inline constexpr bool _Integer_class = requires {
typename _Ty::_Signed_type;
typename _Ty::_Unsigned_type;
};
typename _Ty::_Signed_type;
typename _Ty::_Unsigned_type;
};

template <class _Ty>
concept _Integer_like = _Is_nonbool_integral<remove_cv_t<_Ty>> || _Integer_class<_Ty>;
Expand Down Expand Up @@ -431,7 +411,6 @@ concept sized_sentinel_for = sentinel_for<_Se, _It>
// clang-format on

namespace ranges {
// clang-format off
_EXPORT_STD enum class subrange_kind : bool { unsized, sized };

_EXPORT_STD template <input_or_output_iterator _It, sentinel_for<_It> _Se = _It,
Expand All @@ -446,7 +425,6 @@ namespace ranges {
_EXPORT_STD template <size_t _Idx, class _It, class _Se, subrange_kind _Ki>
requires (_Idx < 2)
_NODISCARD constexpr auto get(subrange<_It, _Se, _Ki>&& _Val);
// clang-format on
} // namespace ranges

_EXPORT_STD using ranges::get;
Expand Down
Loading

0 comments on commit 2f8342a

Please sign in to comment.