Skip to content

Commit

Permalink
Toolset update: VS 2022 17.7 Preview 1 (#3711)
Browse files Browse the repository at this point in the history
* PowerShell 7.3.4.

* New pool.

* VS 2022 17.7 Preview 1.

* Require Clang 16.

* Remove workaround for VSO-1753916 'C++23 tuple causes x86chk assertion: !"If lookup found RDSymbol before it should find something this time, too", ParseTree.cpp 10376'.

* Remove workarounds for VSO-1799670 "EDG rejects constexpr vector in debug mode with 'attempt to access expired storage' errors, part 3".

* Remove workarounds for LLVM-44833 "[concepts] deferred substitution into requirements of class template members not implemented".

* [llvm16] Clang has implemented P0960; unskip tests that now pass, and remove workaround in `P2474R2_views_repeat`.

* [llvm16] Clang now warns about overriding `/fp:strict` with `-ffp-contract`. Update `floating_point_model_matrix.lst` to silence these warnings.

* [llvm16] Fix redeclaration of `adjacent_transform_view` (atomic constraint expressions effectively cannot be reproduced since each utterance is distinct).

* [llvm16] Disambiguate `tuple` comparison operators.

* [llvm16] Workaround LLVM-62290, which has been fixed for Clang 17, in `<ranges>`.

* [llvm16] Remove workarounds for a couple of `TRANSITION, Clang 16` issues in `<ranges>` and `<type_traits>`.

* [llvm16] Perma-workaround unfiled clang bug in `P0896R4_views_take`.

* [llvm16 followup] Improve arrow comments.

* [llvm16 followup] We `_EXPORT_STD` both declarations and definitions.

* Disable UBSan to work around GH 3568 "Investigate why Clang/LLVM UBSan doesn't link".

* Guard `_addcarry_u64`/`_subborrow_u64` for Clang.

* `LDBL_DECIMAL_DIG` is now missing for Clang too.

* Although LLVM-46207 is still open, Clang now likes tgmath.h.

* Cite LLVM-62096 "Clang complains about concept depending on itself".

* Add workaround for LLVM-62762 "32-bit-only misoptimization of printf calls on Windows".

* clang-format 16, no manual changes.

The changes are almost entirely positive, with no horrible mangling,
and limited weirdness around `&`, `&&`, and `*`. No need for manual fixups.

* .clang-format: Update link to Clang 16.

* .clang-format: Sort defaults, no behavioral changes.

* .clang-format: Drop commented-out defaults, no behavioral changes.

`BreakBeforeInheritanceComma` and `BreakConstructorInitializersBeforeComma`
were never documented and aren't printed out by `-dump-config` anymore.

The weird empty `BasedOnStyle` isn't printed out by `-dump-config` anymore.

`ConstructorInitializerAllOnOneLineOrOnePerLine` and `AllowAllConstructorInitializersOnNextLine`
are now deprecated and aren't printed out by `-dump-config` anymore.

* .clang-format: `DeriveLineEnding` and `UseCRLF` were deprecated and fused into `LineEnding`, no behavioral changes.

* .clang-format: `AlignTrailingComments` is no longer a bool. Use the new options, no behavioral changes.

* .clang-format: `SortUsingDeclarations` (which we didn't customize) is no longer a bool, no behavioral changes.

* .clang-format: Add new defaults, no behavioral changes.

* .clang-format: `InsertNewlineAtEOF` is new, set it to `true`. Doesn't change any files right now.

* .clang-format: `RemoveSemicolon` is new, set it to `true`.

* clang-format 16, no manual changes - remove semicolons.

---------

Co-authored-by: Casey Carter <[email protected]>
  • Loading branch information
StephanTLavavej and CaseyCarter committed May 18, 2023
1 parent 71e404b commit a621095
Show file tree
Hide file tree
Showing 69 changed files with 485 additions and 604 deletions.
69 changes: 40 additions & 29 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/15.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormatStyleOptions.html

---
# Language: Cpp
Expand Down Expand Up @@ -42,17 +42,20 @@ AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
# AlignOperands: Align
AlignOperands: AlignAfterOperator
# AlignTrailingComments: true
AlignTrailingComments: false
# AlignTrailingComments:
# Kind: Always
# OverEmptyLines: 0
AlignTrailingComments:
Kind: Never
# AllowAllArgumentsOnNextLine: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowShortEnumsOnASingleLine: true
# AllowShortBlocksOnASingleLine: Never
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortEnumsOnASingleLine: true
# AllowShortFunctionsOnASingleLine: All
AllowShortFunctionsOnASingleLine: Empty
# AllowShortLambdasOnASingleLine: All
# AllowShortIfStatementsOnASingleLine: Never
# AllowShortLambdasOnASingleLine: All
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
Expand All @@ -63,17 +66,18 @@ AlwaysBreakTemplateDeclarations: Yes
# - __capability
# BinPackArguments: true
# BinPackParameters: true
# BitFieldColonSpacing: Both
# BraceWrapping:
# AfterCaseLabel: false
# AfterClass: false
# AfterControlStatement: Never
# AfterEnum: false
# AfterExternBlock: false
# AfterFunction: false
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
# BeforeLambdaBody: false
Expand All @@ -82,36 +86,30 @@ AlwaysBreakTemplateDeclarations: Yes
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
# BreakAfterAttributes: Never
# BreakAfterJavaFieldAnnotations: false
# BreakArrays: true
# BreakBeforeBinaryOperators: None
BreakBeforeBinaryOperators: NonAssignment
# BreakBeforeConceptDeclarations: Always
# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
# BreakInheritanceList: BeforeColon
# BreakBeforeInlineASMColon: OnlyMultiline
# BreakBeforeTernaryOperators: true
# BreakConstructorInitializersBeforeComma: false
# BreakConstructorInitializers: BeforeColon
# BreakAfterJavaFieldAnnotations: false
# BreakInheritanceList: BeforeColon
# BreakStringLiterals: true
# ColumnLimit: 80
ColumnLimit: 120
# CommentPragmas: '^ IWYU pragma:'
# QualifierAlignment: Leave
# CompactNamespaces: false
# ConstructorInitializerIndentWidth: 4
# ContinuationIndentWidth: 4
# Cpp11BracedListStyle: true
# DeriveLineEnding: true
DeriveLineEnding: false
# DerivePointerAlignment: false
# DisableFormat: false
# EmptyLineAfterAccessModifier: Never
# EmptyLineBeforeAccessModifier: LogicalBlock
# ExperimentalAutoDetectBinPacking: false
# PackConstructorInitializers: BinPack
# BasedOnStyle: ''
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
# AllowAllConstructorInitializersOnNextLine: true
# FixNamespaceComments: true
# ForEachMacros:
# - foreach
Expand Down Expand Up @@ -152,24 +150,35 @@ IncludeCategories:
# IncludeIsMainRegex: '(Test)?$'
# IncludeIsMainSourceRegex: ''
# IndentAccessModifiers: false
# IndentCaseLabels: false
# IndentCaseBlocks: false
IndentCaseBlocks: true
# IndentCaseLabels: false
# IndentExternBlock: AfterExternBlock
# IndentGotoLabels: true
# IndentPPDirectives: None
# IndentExternBlock: AfterExternBlock
# IndentRequiresClause: true
# IndentWidth: 2
IndentWidth: 4
# IndentWrappedFunctionNames: false
IndentWrappedFunctionNames: true
# InsertBraces: false
InsertBraces: true
# InsertNewlineAtEOF: false
InsertNewlineAtEOF: true
# InsertTrailingCommas: None
# IntegerLiteralSeparator:
# Binary: 0
# BinaryMinDigits: 0
# Decimal: 0
# DecimalMinDigits: 0
# Hex: 0
# HexMinDigits: 0
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
# KeepEmptyLinesAtTheStartOfBlocks: true
# LambdaBodyIndentation: Signature
# LineEnding: DeriveLF
LineEnding: CRLF
# NOTE: MacroBlockBegin/MacroBlockEnd don't work with _CATCH_ALL.
# MacroBlockBegin: ''
# MacroBlockEnd: ''
Expand All @@ -182,6 +191,7 @@ NamespaceIndentation: All
# ObjCBreakBeforeNestedBlockParam: true
# ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: true
# PackConstructorInitializers: BinPack
# PenaltyBreakAssignment: 2
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
Expand All @@ -190,24 +200,29 @@ NamespaceIndentation: All
# PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60
# PenaltyIndentedWhitespace: 0
# PenaltyReturnTypeOnItsOwnLine: 60
# PointerAlignment: Right
PointerAlignment: Left
# PPIndentWidth: -1
# QualifierAlignment: Leave
# ReferenceAlignment: Pointer
# ReflowComments: true
# RemoveBracesLLVM: false
# RemoveSemicolon: false
RemoveSemicolon: true
# RequiresClausePosition: OwnLine
# RequiresExpressionIndentation: OuterScope
# SeparateDefinitionBlocks: Leave
# ShortNamespaceLines: 1
# SortIncludes: CaseSensitive
# SortJavaStaticImport: Before
# SortUsingDeclarations: true
# SortUsingDeclarations: LexicographicNumeric
# SpaceAfterCStyleCast: false
SpaceAfterCStyleCast: true
# SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: true
# SpaceAroundPointerQualifiers: Default
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: false
# SpaceBeforeCpp11BracedList: false
Expand All @@ -227,8 +242,8 @@ SpaceAfterCStyleCast: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterRequiresInClause: true
# SpaceAroundPointerQualifiers: Default
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceBeforeSquareBrackets: false
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
Expand All @@ -241,8 +256,6 @@ SpaceBeforeParensOptions:
# Maximum: -1
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# SpaceBeforeSquareBrackets: false
# BitFieldColonSpacing: Both
# Standard: Latest
# StatementAttributeLikeMacros:
# - Q_EMIT
Expand All @@ -261,13 +274,11 @@ StatementMacros:
- _EXTERN_C_UNLESS_PURE
- _END_EXTERN_C_UNLESS_PURE
# TabWidth: 8
# UseCRLF: false
UseCRLF: true
# UseTab: Never
# WhitespaceSensitiveMacros:
# - STRINGIZE
# - PP_STRINGIZE
# - BOOST_PP_STRINGIZE
# - NS_SWIFT_NAME
# - CF_SWIFT_NAME
# - NS_SWIFT_NAME
# - PP_STRINGIZE
# - STRINGIZE
...
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.6 Preview 3 or later.
1. Install Visual Studio 2022 17.7 Preview 1 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.6 Preview 3 or later.
1. Install Visual Studio 2022 17.7 Preview 1 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 @@ -91,7 +91,7 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) {
$PsExecPath = Join-Path $ExtractedPsToolsPath 'PsExec64.exe'

# https://github.com/PowerShell/PowerShell/releases/latest
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.3/PowerShell-7.3.3-win-x64.zip'
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.4/PowerShell-7.3.4-win-x64.zip'
Write-Host "Downloading: $PowerShellZipUrl"
$ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl
$PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe'
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ variables:
benchmarkBuildOutputLocation: 'D:\benchmark'

pool:
name: 'StlBuild-2023-04-11T1428-Pool'
name: 'StlBuild-2023-05-16T1204-Pool'
demands: EnableSpotVM -equals true

pr:
Expand Down
29 changes: 16 additions & 13 deletions stl/inc/__msvc_int128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,17 @@ _STD_BEGIN
#if defined(_M_X64) && !defined(_M_ARM64EC) && !defined(_M_CEE_PURE) && !defined(__CUDACC__) \
&& !defined(__INTEL_COMPILER)
#define _STL_128_INTRINSICS 1
#ifdef __clang__ // clang doesn't have _udiv128 / _div128
#define _STL_128_DIV_INTRINSICS 0
#else // ^^^ Clang / other vvv
#define _STL_128_DIV_INTRINSICS 1
#endif // ^^^ detect _udiv128 / _div128 ^^^
#ifdef __clang__
#define _STL_128_ADD_SUB_INTRINSICS 0 // clang doesn't have _addcarry_u64 / _subborrow_u64
#define _STL_128_DIV_INTRINSICS 0 // clang doesn't have _udiv128 / _div128
#else // ^^^ Clang / other compilers vvv
#define _STL_128_ADD_SUB_INTRINSICS 1
#define _STL_128_DIV_INTRINSICS 1
#endif // ^^^ other compilers ^^^
#else // ^^^ intrinsics available / intrinsics unavailable vvv
#define _STL_128_INTRINSICS 0
#define _STL_128_DIV_INTRINSICS 0
#define _STL_128_INTRINSICS 0
#define _STL_128_ADD_SUB_INTRINSICS 0
#define _STL_128_DIV_INTRINSICS 0
#endif // ^^^ intrinsics unavailable ^^^

struct
Expand Down Expand Up @@ -111,11 +114,11 @@ struct
static constexpr unsigned char _AddCarry64(
unsigned char _Carry, uint64_t _Left, uint64_t _Right, uint64_t& _Result) noexcept {
// _STL_INTERNAL_CHECK(_Carry < 2);
#if _STL_128_INTRINSICS
#if _STL_128_ADD_SUB_INTRINSICS
if (!_Is_constant_evaluated()) {
return _addcarry_u64(_Carry, _Left, _Right, &_Result);
}
#endif // _STL_128_INTRINSICS
#endif // _STL_128_ADD_SUB_INTRINSICS

const uint64_t _Sum = _Left + _Right + _Carry;
_Result = _Sum;
Expand All @@ -125,11 +128,11 @@ struct
static constexpr unsigned char _SubBorrow64(
unsigned char _Carry, uint64_t _Left, uint64_t _Right, uint64_t& _Result) noexcept {
// _STL_INTERNAL_CHECK(_Carry < 2);
#if _STL_128_INTRINSICS
#if _STL_128_ADD_SUB_INTRINSICS
if (!_Is_constant_evaluated()) {
return _subborrow_u64(_Carry, _Left, _Right, &_Result);
}
#endif // _STL_128_INTRINSICS
#endif // _STL_128_ADD_SUB_INTRINSICS

const auto _Difference = _Left - _Right - _Carry;
_Result = _Difference;
Expand Down Expand Up @@ -511,7 +514,7 @@ struct
return __qhat;
#else // ^^^ 128-bit intrinsics / no such intrinsics vvv
#if _HAS_CXX20
auto __d = _STD countl_zero(_Den._Word[1]);
auto __d = _STD countl_zero(_Den._Word[1]);
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
auto __d = _Countl_zero_fallback(_Den._Word[1]);
#endif // ^^^ !_HAS_CXX20 ^^^
Expand Down Expand Up @@ -646,7 +649,7 @@ struct
}
#else // ^^^ 128-bit intrinsics / no such intrinsics vvv
#if _HAS_CXX20
auto __d = _STD countl_zero(_Den._Word[1]);
auto __d = _STD countl_zero(_Den._Word[1]);
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
auto __d = _Countl_zero_fallback(_Den._Word[1]);
#endif // ^^^ !_HAS_CXX20 ^^^
Expand Down
22 changes: 11 additions & 11 deletions stl/inc/__msvc_iter_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ _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; };
Expand Down Expand Up @@ -77,8 +77,8 @@ struct incrementable_traits<_Ty> {

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

template <class _Ty>
requires (!_Has_member_difference_type<_Ty> && _Can_difference<_Ty>)
Expand Down Expand Up @@ -291,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 @@ -363,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
Loading

0 comments on commit a621095

Please sign in to comment.