-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Various cleanups #5924
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
Merged
StephanTLavavej
merged 45 commits into
microsoft:main
from
StephanTLavavej:various-cleanups
Dec 1, 2025
Merged
Various cleanups #5924
StephanTLavavej
merged 45 commits into
microsoft:main
from
StephanTLavavej:various-cleanups
Dec 1, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`.
…o be consistent with others.
We fully control the inputs here, so users don't need these static_asserts.
…")` in C++14 code.
We don't need to worry about /clr:safe. We don't need to provide a rationale.
Followup to GH 5764, GH 5817.
…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`.
cpplearner
reviewed
Dec 1, 2025
Member
Author
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
zacklj89
approved these changes
Dec 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.cppdoesn't needawint.hpp, justWindows.h.validate.cppdoesn't useassert()anymore.// namespace$=>// unnamed namespace_HAS_CXX20regions._Supports_transparencyfor_HAS_CXX23._Is_transparenthelper trait #3736 merged 2023-06-15.inlinefor function templates._STATIC_LAMBDA=>_STATIC_CALL_OPERATOR_STATIC_CALL_OPERATORto more stateless lambdas.decltype(tzdb::leap_seconds)=>vector<leap_second>tzdb::leap_secondsa fancy type._CMPXCHG_MASK_OUT_PADDING_BITSimplies_HAS_CXX20, so_INLINE_VAR=>inlinetests/utils/stl/util.py: Remove dead code, part 1.tests/utils/stl/util.py: Remove dead code, part 2._Vb_val::_Getal()is a direct member function; all other calls omitthis->.is_null_pointer.int main()=>void test()intest.compile.pass.cpp.main()functions in compile-only tests, to make it extra-clear that they aren't running any code.// COMPILE-ONLYintest.compile.pass.cpp.VSO_0000000_type_traitscompile-only.test_all_function_types()is a non-template, so we don't need to call it.main()totest_VSO_707437()and move it up. It's testing overload resolution.tests/tr1/env_single.lst.<cvt/meow>#4458 merged 2024-03-15._USE_NAMED_IDL_NAMESPACEis unused.#error.vector_algorithms.cpp: Use#ifdef _WIN64when deciding between x64 and x86._STD _In_rangecall.<execution>:_In_range=>_In_rngto avoid shadowing.stride_viewctor: Markrange_difference_t<_Vw> _Stride_as const, to be consistent with others.<random>: Add parens when mixing left shifts with bitwise OR._Zip_fnand_Zip_transform_fnshould beclass, notstruct.structs when possible.steady_clock::now()should use_STL_INTERNAL_STATIC_ASSERT.static_asserts._STL_INTERNAL_STATIC_ASSERT(false)=>static_assert(false)for C++17 and later._Always_falsemachinery. 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-expandingVCLIBS_TARGET_ARCHITECTURE.iosptrs.cpp: Test_M_CEE_PUREinstead of_M_CEE_MIXED./clr:safe. We don't need to provide a rationale.stdextmacros to<exception>and limit their scope.<hash_map>and<hash_set>#5764 merged 2025-10-10,<iterator>: Removestdext::checked_array_iteratorandstdext::unchecked_array_iterator#5817 merged 2025-11-05.xalloc.cpp: Include just<yvals.h>, we don't need<stdexcept>.yvals_core.h: Remove distinction between "directly controls" and "indirectly controls".yvals_core.h: Omit "Other deprecation warnings".is_constant_evaluated()to initialize const variables.elements[0]hackaround - that's always 0). The squirrelliness happens because under certain circumstances, the compiler can perform constant initialization, makingis_constant_evaluated()report that it was called at compile-time. For this reason, we should directly test it withif.xkeycheck.hdoesn't have an "unnamed namespace".