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

Skip to content

Conversation

@StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented Dec 1, 2025

Overview

I notice a lot of things while reviewing code, not all of which I immediately address. I spent my Thanksgiving weekend draining some of my todo backlog (I still have ~160 lines).

As a general rule, we don't like "grab bag PRs" touching lots of code, because they increase risk and are more difficult to review. (We especially dislike mixing features/fixes with unrelated cleanups.) To mitigate this, I've separated out all of the changes with behavioral impact (#5921), higher risk and MSVC-internal impact (#5922), and complicated multi-step transformations (#5923). The commits here are low risk and cleanly organized for ease of reviewing. I believe that decomposing this further wouldn't be productive.

Commits

  • xtime.cpp doesn't need awint.hpp, just Windows.h.
  • validate.cpp doesn't use assert() anymore.
  • // namespace$ => // unnamed namespace
    • We had 11 occurrences of the former, now being added to 39 occurrences of the latter.
  • Fuse _HAS_CXX20 regions.
  • Guard _Supports_transparency for _HAS_CXX23.
  • Exclude charconv tables and test cases from VSCode search.
    • They pollute search results when looking for numbers, and generally don't need to be searched. (There's a UI button to "Use Exclude Settings and Ignore Files", so this exclusion can be easily bypassed.)
  • Drop unnecessary inline for function templates.
  • _STATIC_LAMBDA => _STATIC_CALL_OPERATOR
  • Add _STATIC_CALL_OPERATOR to more stateless lambdas.
  • decltype(tzdb::leap_seconds) => vector<leap_second>
    • This was a relic of an early attempt to give tzdb::leap_seconds a fancy type.
  • Drop unnecessary newlines in do-while loops.
  • _CMPXCHG_MASK_OUT_PADDING_BITS implies _HAS_CXX20, so _INLINE_VAR => inline
  • tests/utils/stl/util.py: Remove dead code, part 1.
  • tests/utils/stl/util.py: Remove dead code, part 2.
    • We're never AIX.
    • psutil 2.0.0 was released on 2014-03-10. The current version is 7.1.3.
  • Unwrap "strengthened" comments.
  • _Vb_val::_Getal() is a direct member function; all other calls omit this->.
  • Use is_null_pointer.
    • These locations are happy to ignore cv-quals.
  • Add newlines to indicate that we don't like to interleave includes and conditionals.
  • Avoid interleaving includes and conditionals.
  • Include test support headers with angle brackets.
  • int main() => void test() in test.compile.pass.cpp.
    • We don't like to have main() functions in compile-only tests, to make it extra-clear that they aren't running any code.
  • Drop // COMPILE-ONLY in test.compile.pass.cpp.
    • These comments are redundant.
  • Make VSO_0000000_type_traits compile-only.
    • test_all_function_types() is a non-template, so we don't need to call it.
    • Rename main() to test_VSO_707437() and move it up. It's testing overload resolution.
  • Delete tests/tr1/env_single.lst.
  • _USE_NAMED_IDL_NAMESPACE is unused.
    • IIRC this was intended for WCFB02 (the stranded vNext branch in Team Foundation Version Control).
  • Consistently say "Unknown architecture".
    • And don't give string literals to #error.
  • vector_algorithms.cpp: Use #ifdef _WIN64 when deciding between x64 and x86.
  • Qualify a _STD _In_range call.
  • <execution>: _In_range => _In_rng to avoid shadowing.
  • Consistently reduce code duplication when checking intrinsic availability.
  • stride_view ctor: Mark range_difference_t<_Vw> _Stride_ as const, to be consistent with others.
  • <random>: Add parens when mixing left shifts with bitwise OR.
  • _Zip_fn and _Zip_transform_fn should be class, not struct.
  • Make ranges function objects structs when possible.
  • steady_clock::now() should use _STL_INTERNAL_STATIC_ASSERT.
    • We fully control the inputs here, so users don't need these static_asserts.
  • _STL_INTERNAL_STATIC_ASSERT(false) => static_assert(false) for C++17 and later.
    • These don't impose any costs, as they occur on "can't happen" branches and we've eliminated the _Always_false machinery. We should just leave them in for user code.
  • _STL_INTERNAL_STATIC_ASSERT(false) => static_assert(false, "reason") in C++14 code.
  • CMakeLists.txt: Avoid inconsistently quote-expanding VCLIBS_TARGET_ARCHITECTURE.
  • iosptrs.cpp: Test _M_CEE_PURE instead of _M_CEE_MIXED.
    • We don't need to worry about /clr:safe. We don't need to provide a rationale.
  • Move stdext macros to <exception> and limit their scope.
  • xalloc.cpp: Include just <yvals.h>, we don't need <stdexcept>.
  • yvals_core.h: Remove distinction between "directly controls" and "indirectly controls".
    • This was confusing for contributors to maintain, and didn't provide value.
  • yvals_core.h: Omit "Other deprecation warnings".
    • Listing this isn't useful; the messages clearly explain what Standard deprecates stuff, and how to silence them.
  • Avoid using is_constant_evaluated() to initialize const variables.
    • This is confusing and hazardous (witness the elements[0] hackaround - that's always 0). The squirrelliness happens because under certain circumstances, the compiler can perform constant initialization, making is_constant_evaluated() report that it was called at compile-time. For this reason, we should directly test it with if.
  • Oops: xkeycheck.h doesn't have an "unnamed namespace".

We had 11 occurrences of the former, now being added to 39 occurrences of the latter.
We're never AIX.

psutil 2.0.0 was released on 2014-03-10. The current version is 7.1.3.
These locations are happy to ignore cv-quals.
test_all_function_types() is a non-template, so we don't need to call it.

Rename main() to test_VSO_707437() and move it up. It's testing overload resolution.
This became unused after GH 4458 on 2024-03-15.
And don't give string literals to `#error`.
We fully control the inputs here, so users don't need these static_asserts.
We don't need to worry about /clr:safe. We don't need to provide a rationale.
…irectly controls".

This was confusing for contributors to maintain, and didn't provide value.
Listing this isn't useful; the messages clearly explain what Standard deprecates stuff, and how to silence them.
This is confusing and hazardous (witness the `elements[0]` hackaround - that's always 0). We should directly test it with `if`.
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner December 1, 2025 11:15
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Dec 1, 2025
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Dec 1, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in STL Code Reviews Dec 1, 2025
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej moved this from Final Review to Ready To Merge in STL Code Reviews Dec 1, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Dec 1, 2025
@StephanTLavavej StephanTLavavej merged commit 8cc5158 into microsoft:main Dec 1, 2025
45 checks passed
@StephanTLavavej StephanTLavavej deleted the various-cleanups branch December 1, 2025 18:38
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants