-
Notifications
You must be signed in to change notification settings - Fork 1.6k
<xstring>: Strengthen exception specification for sv.compare("NTBS")
#3738
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
<xstring>: Strengthen exception specification for sv.compare("NTBS")
#3738
Conversation
Since they are already called by `noexcept` functions.
|
I think we should do strengthening for I'm hesitant about other functions, because
|
|
(off topic) Lines 2539 to 2553 in a621095
|
|
I'm speculatively mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
strega-nil-ms
left a comment
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.
nit
|
@StephanTLavavej minor change pushed |
|
@strega-nil-ms I believe you have flipped the sense of the message; compare the previous message. (The message is admittedly confusing about whether it's stating what is currently observed, or what should be observed.) |
|
@strega-nil-ms @CaseyCarter I've pushed changes to restore the |
🦾
|
As discovered in #3735, both
basic_string_view's constructor from aconst _Elem*(strengthened) andbasic_string_view::compareoverload for twobasic_string_views (mandatory)are already
noexcept, sobasic_string_view::comparefor abasic_string_viewand aconst _Elem*should also benoexcept.The exception specification strengthening is already done for
basic_string.STL/stl/inc/xstring
Lines 4646 to 4649 in a621095
The message in the
static_assert"(this is bad, char_traits)" no longer holds, since the exception specifications of allchar_traits::comparein MSVC STL are already strengthened.Driven-by changes: make
basic_string::_Eos,basic_string::_Swap_proxy_and_iterators, andbasic_string::_Swap_datanoexceptsince they are non-throwing and already called bynoexceptfunctions.