-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Mitigate non-conformance of extensions of non-reserved names by the push_macro
/pop_macro
mechanism
#4285
Mitigate non-conformance of extensions of non-reserved names by the push_macro
/pop_macro
mechanism
#4285
Conversation
stl/inc/exception
Outdated
|
||
// 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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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`
tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp
Outdated
Show resolved
Hide resolved
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. |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for defending the STL against technically conformant macroization! 🛡️ 🎯 🎉 |
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.