Mitigate non-conformance of extensions of non-reserved names by the push_macro/pop_macro mechanism#4285
Merged
StephanTLavavej merged 5 commits intomicrosoft:mainfrom Jan 11, 2024
Conversation
CaseyCarter
suggested changes
Jan 4, 2024
stl/inc/exception
Outdated
Comment on lines
+34
to
+42
|
|
||
| // TRANSITION, terminate_function and unexpected_function are defined for source compatibility. | ||
| #pragma push_macro("terminate_function") | ||
| #pragma push_macro("unexpected_function") | ||
| #undef terminate_function | ||
| #undef unexpected_function | ||
| #include <vcruntime_exception.h> | ||
| #pragma pop_macro("unexpected_function") | ||
| #pragma pop_macro("terminate_function") |
Contributor
There was a problem hiding this comment.
This seems fragile against other inclusions of public VCRuntime headers. I suggest you remove all changes regarding terminate_function and unexpected_function, I've opened MSVC-PR-519139 to change eh.h directly.
- Avoid touching `terminate_function` and `unexpected_function`. - Remove the `// TRANSITION, vNext` comments. - Simplify comments for `stdext`
CaseyCarter
approved these changes
Jan 4, 2024
tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp
Outdated
Show resolved
Hide resolved
StephanTLavavej
approved these changes
Jan 11, 2024
Member
|
Thanks! I pushed a conflict-free merge with I would not be eager to add dozens/hundreds/thousands of such lines to defend against names in arm64_neon.h/ppltasks/UCRT headers, but defending "our own" extensions is a very limited and reasonable thing to do. |
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for defending the STL against technically conformant macroization! 🛡️ 🎯 🎉 |
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
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.
Towards #2206. The posted example should compile with the changes landed when pre-standard hash containers are disabled.
stdext, because<__msvc_all_public_headers.hpp>is currently including non-Standard<hash_map>&<hash_set>.<arm64_neon.h>(which is surprisingly heavy),<ppltasks.h>, and UCRT stuffs are not handled currently.Some extensions may become conforming with deprecation warnings enabled, others are not yet because they're visible via SFINAE.