Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented Jul 17, 2021

  • Update .clang-format for Clang 12.
    • This customizes IndentRequires to true, which is our preferred convention.
  • Manually defend against clang-format damage.
    • I was a bad kitty and didn't report these bugs. 🙀
    • In <algorithm>, indirectly_copyable_storable would be formatted weirdly, so I'm disabling clang-format and manually adjusting the indentation to be more preferred.
    • requires TRAIT<_Ty> = default; would be formatted weirdly. Instead of adding parentheses around TRAIT<_Ty>, I'm disabling clang-format.
    • /* strengthened */ requires TRAIT<_Ty> { would be formatted weirdly. This can be avoided by using a C++ comment, forcing clang-format to put requires TRAIT<_Ty> { on the next line.
    • clang-format 12 has extreme trouble with complex non-parenthesized requires-clauses, even within // clang-format off - it gets confused about the level of indentation and damages the rest of the file. We need to add parentheses in order to avoid this.
    • In <ranges>, we need to add a blank line before _Nothrow_plus_equal to avoid weird damage. (Immediately above, clang-format will still change private: to private :. This seemed like a tolerable amount of weirdness for a block of code that's a TRANSITION workaround, and not worth disabling clang-format entirely.)
    • In <utility>, clang-format has trouble with our strange-looking definitions of max and min. Forcing wrapping with empty comments is sufficient.
    • In tests/std/tests/P0088R3_variant/test.cpp, clang-format wants to coalesce and sort the Standard and libcxx headers (because the latter don't have an extension of .hpp). Adding a comment both prevents this, and explains where these headers are from.
  • clang-format all files, no manual changes.
    • It's adding a space to (_STD min) (_Num1, _Num2) because it's seeing a C-style cast. (Attempting to change that setting would affect way more lines, due to our (void) casts.)
  • Update libcxx skips for Clang 12.
  • Require Clang 12 and MSVC 19.30.
  • EDG is now x64.
    • Note that we're using EDG x64 for GitHub testing, but we're still using EDG x86 for MSVC-internal testing.
  • Work around VSO-1356169 "EDG x64 is confused by overloads for __cdecl and __vectorcall PMFs".
    • Russell Johnston confirmed that this bug is specific to x64 /BE and doesn't affect the IDE. This workaround is equally specific, so we don't have to worry about IntelliSense misbehaving if someone is using a non-default calling convention.
  • Work around VSO-1356637 "EDG x64 ICE with negative pointer indexing".
  • Remove workarounds for fixed EDG bugs.
  • Activate constexpr containers (string and vector) for Clang.
    • This required modifying _Alloc_temporary, where an old workaround (_Wrap) for C++/CX was incompatible with Clang 12's strict enforcement of constexpr rules. Because C++/CX excludes C++20, we can make _Wrap specific to C++/CX, so C++20 constexpr won't attempt to activate a union member by initializing a sub-object. Then, adding _Get_value() insulates the rest of the library from caring about this.
  • Rename to _Alloc_temporary2 for ABI safety.
  • Remove unnecessary feature-test macro checks.
    • Now, all of our C++20 compilers define the Core macro __cpp_constexpr_dynamic_alloc, so we can always define the Library macros __cpp_lib_constexpr_dynamic_alloc/__cpp_lib_constexpr_string/__cpp_lib_constexpr_vector in C++20 mode.
    • Then, in tests that are C++20 (and above), we don't need to check the macros.
    • Note that tests/std/tests/P0896R4_views_join/test.cpp was using #ifndef and has been modified accordingly.
  • In C++20/23 code, change _CONSTEXPR20_DYNALLOC/_CONSTEXPR20_CONTAINER to constexpr.
  • Then, replace all remaining _CONSTEXPR20_DYNALLOC/_CONSTEXPR20_CONTAINER with _CONSTEXPR20, no manual changes.
  • Remove TRANSITION, LLVM-49342 comments - we want NRVO friendliness.
  • Cleanup: Change return X op= Y; to X op= Y; return X; for NRVO.
  • Cleanup: Manual changes to <bitset> and <filesystem> for NRVO.
  • Remove workaround in <atomic> for Clang 11 targeting ARM64.
  • Remove workaround for VSO-752709 / DevCom-409222 "Constructing rvalue reference from non-reference-related lvalue reference", but filed 2 new bugs:
    • VSO-1357053 "MSVC mishandles is_constructible_v<int const&, ExplicitTo<int&&>>"
    • VSO-1357056 "EDG mishandles is_constructible_v<int const&, ExplicitTo<int&&>>"
  • README updates:
    • Drop the sentence about not yet working on C++23.
    • Various updates for VS 2022.
    • Mention that the x64 target is recommended, and that /BE is unsupported for x86.
    • Add commas.
  • Silence Clang 12 error: unused variable 'citer' [-Werror,-Wunused-variable].
  • Simplify preprocessor logic, when there's no more compiler variation or escape hatches to worry about:
    • #ifdef __cpp_lib_constexpr_dynamic_alloc => #if _HAS_CXX20
    • #ifdef __cpp_lib_constexpr_string => #if _HAS_CXX20
    • #ifdef __cpp_lib_destroying_delete => #if _HAS_CXX20
    • #ifdef __cpp_lib_is_constant_evaluated => #if _HAS_CXX20
    • #ifdef __cpp_lib_variant => #if _HAS_CXX17
  • Update the Virtual Machine Scale Set, including VsDevCmd.bat paths.
    • Update to Python 3.9.6.
    • Don't update the WinSDK; I filed LLVM-51128 (Clang 12 targeting ARM64 is incompatible with WinSDK 10.0.20348.0).
  • Run x64 tests first (because they run /BE now).
  • Pass --allow-unsupported-compiler to CUDA, because CUDA 10.1 Update 2 rejected VS 2022 as unsupported Future Technology.
  • Silence Clang -Wignored-pragmas (for ARM64).
    • It emitted: warning: '#pragma float_control' is not supported on this target - ignored [-Wignored-pragmas]

"EDG x64 is confused by overloads for __cdecl and __vectorcall PMFs"
"EDG x64 ICE with negative pointer indexing"
@StephanTLavavej StephanTLavavej added the infrastructure Related to repository automation label Jul 17, 2021
@StephanTLavavej StephanTLavavej force-pushed the vs-2022-17.0-preview-2 branch from a8efeb3 to bf08971 Compare July 18, 2021 09:44
@StephanTLavavej StephanTLavavej marked this pull request as ready for review July 19, 2021 08:39
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner July 19, 2021 08:39
_No_throw_sentinel_for<_Out> _OSe>
requires constructible_from<iter_value_t<_Out>, iter_rvalue_reference_t<_It>>
uninitialized_move_result<_It, _Out> _Uninitialized_move_unchecked(
_It _IFirst, _Se _ILast, _Out _OFirst, _OSe _OLast) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider removing the extra level of indent from here through 1646, removing the // on 1625, and simply wrapping this entire function definition in // clang-format off.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! This is another case where clang-format is confused by a requires-clause without parentheses. If I add them, it formats the rest of the function nicely (except that it omits a space and says requires(constructible_from, and still needs help wrapping the if constexpr variable template usage).

I'll do this in a followup PR, thanks.


#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1347136
private:
private :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one is also really bad

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was worse without adding the following newline: 😹

    private : template <class _Left, class _Right>
              static constexpr bool _Nothrow_plus_equal =
                  noexcept(_STD declval<_Left&>() += _STD declval<const _Right&>());

As I mentioned in the changelog, I thought that this single space was tolerable (especially because it's in a compiler workaround that should be removed someday). Let me know if you'd rather disable clang-format here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go ahead and disable clang-format here in a followup PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Related to repository automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants