-
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>: exception's constructor from const char* is non-conforming #882
Comments
Could you please edit the issue so that the content is in the description and the title is short and precise? |
exception class should not have constructor with string it brokes compatibility with gcc stl and clang stl... Also standart describe that exception should be just base class without any strings or pointers to characters internally... |
Can you give an example of a program that would be well-formed in the absence of this constructor that is rendered ill-formed by its presence?
The standard does not specify private class members. It does sometimes depict private class members for purposes of exposition, but a standard library class isn't required to have private members depicted in the standard and may have other private members not depicted in the standard. |
Direct-initialization from a type with user-defined conversions to both |
I think we all misread the code. This |
Unfortunately we haven't managed to open-source vcruntime yet, so at least that part will have to be done by a MSFT employee. The fact that it's weirdness in vcruntime means we'll also need to determine if the compiler depends on that weirdness or not, and possibly spread the fixing even further. |
Ok, I didn't notice Actually I don't think it is problematic. The standard library should allow all conforming code, but needn't prevent nonconforming code. There are many extensions in this STL, and all could be stated as nonconforming - some methods is marked I agree that if you write some code like template <typename T, typename = void>
struct has_pointer_to_const_char_constructor : std::false_type {}
template <typename T>
struct has_pointer_to_const_char_constructor<T, std::enable_if_t<decltype(T{std::declval<const char*>()})>> : std::true_type {}
static_assert(!has_pointer_to_const_char_constructor<std::exception>::value); you will get unexcepted result, but I cannot understand why you would do that. |
The whole point of Casey's original question (and my comment in response) is that this extension in fact breaks some (arguably contrived) conforming code. |
Seems weird, but OK. But there are many other classes which has constructors not conforming. Do you mean that they should all be modified? |
The Standard explicitly permits The problem with removing this, aside from the |
|
OMG Microsoft still not fixed it? Really? It was created 3 years ago. Thanks all for help them completely to fix that and be close to universal solution which will work the same on different compilers! |
Lines 33 to 34 in 60f1885
This looks non-conforming too. |
I think MSVC needs to be fixed. When a backing array (shown as |
@fredefick-vs-ja I think Microsoft does not completely understand still the problem. Big software organisation in this world not equal to expert in C++. It is completely different things. I really very upset than Microsoft given 100500 their certified employees and nobody still can answer something close to technical understanding this problem!!! |
I understand this problem, and I could fix it today if I wanted to. But it would break an absolutely ridiculous amount of non-conforming user code, and many users don't immediately realize what's happening (i.e. "oh, my code is bad, I need to fix it") when they encounter such breaks. Sometimes third-party libraries are involved which is legitimately logistically challenging. This interferes with timely upgrading, which is counterproductive for moving the C++ ecosystem forward. MSVC's STL is actually fairly aggressive (for a C++ implementation in general, and Microsoft in particular) about making changes to improve conformance at the cost of breaking user builds. We routinely deprecate and remove (with escape hatches, usually) things all the time. But in this specific case, we currently believe that the benefits don't outweigh the considerable costs, both to users (who have to deal with the breaks) and to maintainers (who have to fix a significant amount of broken code ourselves - both in the open-source "Real World Code" projects we build in our test suite, and in the massive amount of Microsoft-internal code that we're indirectly responsible for). In particular, the maintainer team is both very busy (reviewing feature and bugfix work) and very time-constrained for the foreseeable future (I am currently the only FTE able to dedicate ~100% of my time to the STL), so we have to ruthlessly prioritize our work, and this is not a priority. Sorry. |
STL/stl/inc/exception
Line 91 in 0c34074
The text was updated successfully, but these errors were encountered: