Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolset update: VS 2022 17.4 Preview 3, Clang 15 #3155

Merged
merged 37 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b2f0467
Disable Clang 15's `-Wunqualified-std-cast-call` in testing
CaseyCarter Oct 10, 2022
f6c3350
libcxx: Add spaces at the start of comments.
StephanTLavavej Oct 11, 2022
f87b7f8
libcxx: Fix newline divergence.
StephanTLavavej Oct 11, 2022
9be35a7
libcxx: Fix divergence: This doesn't appear to be an x64 vs. ARM issu…
StephanTLavavej Oct 11, 2022
84a9bb1
libcxx: Fix divergence: This was already mentioned under "generate_fe…
StephanTLavavej Oct 11, 2022
b3aaf6c
libcxx: Convention: Change AMD64 to x64. Also X86 to x86.
StephanTLavavej Oct 11, 2022
8b1a231
Drop SimplySecureV2OptInTag.
StephanTLavavej Oct 12, 2022
453a867
Python 3.10.8.
StephanTLavavej Oct 12, 2022
6ead303
New pool.
StephanTLavavej Oct 12, 2022
0756add
README.md: 17.4 Preview 3.
StephanTLavavej Oct 12, 2022
5d04d41
Require Clang 15.
StephanTLavavej Oct 12, 2022
5a7249f
Remove workarounds now that MSVC-PR-418361 has shipped; see GH 3046.
StephanTLavavej Oct 12, 2022
738e92e
Remove workarounds for VSO-1579484 "Standard Library Header Units: ch…
StephanTLavavej Oct 12, 2022
a12a4e7
Update citation: VSO-1601168 was fixed, VSO-1641993 remains.
StephanTLavavej Oct 12, 2022
99e3ae2
Update .clang-format defaults for Clang 15.
StephanTLavavej Oct 12, 2022
56441f3
Regen clang-format, no manual changes.
StephanTLavavej Oct 12, 2022
88f040f
Manually fix formatting.
StephanTLavavej Oct 13, 2022
2482b16
.clang-format: Set AfterRequiresInClause: true.
StephanTLavavej Oct 12, 2022
c94dfe0
Regen clang-format, no manual changes.
StephanTLavavej Oct 13, 2022
fe4c369
.clang-format: Set InsertBraces: true.
StephanTLavavej Oct 12, 2022
40fe8ae
Regen clang-format, no manual changes.
StephanTLavavej Oct 13, 2022
e03abb4
Add newlines.
StephanTLavavej Oct 13, 2022
9cf66c7
Add more newlines.
StephanTLavavej Oct 13, 2022
739fc25
Remove clang-format suppression, literally no changes.
StephanTLavavej Oct 13, 2022
3932fc4
Shrink clang-format suppression, literally no changes.
StephanTLavavej Oct 13, 2022
c56560f
Remove clang-format suppression, no changes other than a newline.
StephanTLavavej Oct 13, 2022
cff4795
Remove/shrink clang-format suppression, only indentation changes.
StephanTLavavej Oct 13, 2022
b53a451
Remove clang-format suppression, aligns backslashes.
StephanTLavavej Oct 13, 2022
78db39d
Remove clang-format suppression, reasonable reflows.
StephanTLavavej Oct 13, 2022
83b2557
Remove unnecessary empty comments `//`, literally no changes.
StephanTLavavej Oct 13, 2022
30796e2
Cleanup: Move binary operators to the beginning of lines.
StephanTLavavej Oct 13, 2022
2c9afaa
Add a newline to manually fix formatting.
StephanTLavavej Oct 13, 2022
9ab4181
Attempt to fix CI by restoring SimplySecureV2OptInTag.
StephanTLavavej Oct 13, 2022
8925ffa
Correct extremely poor wrapping of _RANGES _Pipe::operator|
CaseyCarter Oct 13, 2022
fc5649c
Avoid clang-format wrapping defaulted/deleted declarations
CaseyCarter Oct 13, 2022
e6daccd
Revert "Attempt to fix CI by restoring SimplySecureV2OptInTag."
StephanTLavavej Oct 13, 2022
a9acd25
Avoid /analyze warnings in tzdb.cpp.
StephanTLavavej Oct 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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-13T0903-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;
};
CaseyCarter marked this conversation as resolved.
Show resolved Hide resolved

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