-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
C++ compiler should forbid throw move-only type #53224
Comments
@llvm/issue-subscribers-clang-frontend |
This is https://quuxplusone.github.io/blog/2019/05/11/msvc-what-are-you-doing/ Basically, MSVC's ABI can't handle move-only exception types, but every other ABI in the world can. I would bet that it's not possible to forbid move-only exception types in Clang (because I bet some non-Windows customers rely on it), but it could certainly be made into a warning diagnostic, enabled with |
@llvm/issue-subscribers-c-1 Author: Igor Zhukov (fsb4000)
Hello.
We were reported a bug: https://github.com/microsoft/STL/issues/2466
But we think that the report is wrong.
https://godbolt.org/z/q3cYGfneP We think that the compiler should reject the program because the program violates [except.throw]/5: https://eel.is/c++draft/except.throw#5 >When the thrown object is a class object, the constructor selected for the copy-initialization as well as the constructor selected for a copy-initialization considering the thrown object as an lvalue shall be non-deleted and accessible, even if the copy/move operation is elided We decided to notify developers of other C++ compilers too. |
Hello.
We were reported a bug: microsoft/STL#2466
But we think that the report is wrong.
https://godbolt.org/z/q3cYGfneP
We think that the compiler should reject the program because the program violates [except.throw]/5: https://eel.is/c++draft/except.throw#5
We decided to notify developers of other C++ compilers too.
The text was updated successfully, but these errors were encountered: