Implement P2467R1 ios_base::noreplace: Exclusive Mode For fstreams (#2932)#3065
Implement P2467R1 ios_base::noreplace: Exclusive Mode For fstreams (#2932)#3065StephanTLavavej merged 12 commits intomicrosoft:mainfrom
ios_base::noreplace: Exclusive Mode For fstreams (#2932)#3065Conversation
|
Thanks! I updated your PR description to say "Fixes <issue number>", which tells GitHub to link the tracking issue and close it when this PR is merged. |
…`mode` Remove macro guards from .cpp files and use _HAS_CXX23 for the .h files. Additionally, as @MattStephanson pointed out, since _fsopen already handles the 'x' modifiers correctly, the masking out and additional check of ios_base::_Noreplace has been removed in favour of just passing it directly to _Xfsopen and adding strings for the modes there. This also avoids the "test open" to check if the file already exists which avoids a TOCTOU issue.
CaseyCarter
left a comment
There was a problem hiding this comment.
Just style nits with the test, for which I'll push a cleanup.
|
Thanks @Atari2, this looks great! I've pushed a merge with While some ✅ Also, no changes are needed for modules, as this simply adds a |
|
VS 2022 17.6 Preview 1's redist will be unlocked, so we should be able to mirror this now. I've pushed a conflict-free merge with |
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
|
Thanks for implementing this feature in a binary-compatible way! 😻 🚀 🎉 |
As was pointed out by @StephanTLavavej, since this PR has changes to
fiopen.cpp, it will beaffects redist.While writing the tests I tried to avoid having to change things that could affect binary compatibility but it seemed like the only option was to add the now-valid entries to the array in
_Xfiopen, otherwise the calls to it would just fail.Fixes #2932.