<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. |
|
@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.