-
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
<exception>: std::exception::what has wrong signature #948
Comments
Thanks, I've linked the Microsoft-internal bug to this issue. This is a rare example of a |
After thinking about this again, I suspect that this is not actually ABI-breaking, but the source-breaking change is indeed severe and I still don't know how to logistically go about doing this: https://godbolt.org/z/PjEnhxdjW We could explore guarding the change for C++23, so only |
Is it time for us to have our first There doesn't seem to be a technical reason to put this off. We know we want to be conformant eventually, it feels like we're waiting for a "good time" to do this that's never going to appear. |
It would still be a lot of work to clean up RWC but (I see how we could use our hack to apply noexcept to the signature, but it would be gross and having a macro to finally sense the mode would be better.) |
I suggest a visit to this STL project's stated mission, goals, and non-goals to help in this discussion...
Nowhere is it stated this project's goal is to consider private internal needs of other Microsoft divisions (MSVC and VS, Office, Windows, etc). Someone somewhere in Microsoft might question the P&L of correcting 🤔Am I reading correctly that the source-breaking behavior is primarily when code derives from what/exceptions? void myfunc() noexcept {
try {
// do work
throw std::exception("my text");
}
catch (const std::exception& err) {
printf("%s", err.what());
}
} If both 🤔 are true, then I suggest breaking a subset of old code's |
Since it is no longer |
My proposal(as this is only source breaking thing) is to make a preprocessor define(documented), which people would be able to use to restore the non-conforming behavior so the migration would be less noisy. |
That's the "escape hatch" that Stephan mentioned in #948 (comment) |
@cpplearner Sorry, not sure how I missed that. |
Describe the bug
std::exception::what
is notnoexcept
.See also #882 - should probably be fixed together. #808 is also in similar area
Command-line test case
Expected behavior
Should print 1 as ctor is noexcept.
STL version
Additional context
This item is also tracked on Developer Community as DevCom-785027 and by Microsoft-internal VSO-1006425 / AB#1006425.
vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.
The text was updated successfully, but these errors were encountered: