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
[except.ctor] stack unwinding vs. automatic storage duration #4548
Comments
I think we can just strike "with automatic storage duration"; this is an intro sentence that doesn't really say much normatively. The detailed specification is in the following paragraphs. |
Since CWG 1774 was approved that destruction of subjects should be also considered as stack unwinding, the introduction of stack unwinding through associating with objects that have automatic storage duration is a bit of contradiction. |
I think we're in violent agreement here. CWG1774 cleaned up the entire section. The "with automatic storage duration" was re-introduced (out of nowhere) by commit f3a6b2e for CWG2256, ignorant of the careful redrafting that was done by CWG1774 (which stroke "with automatic storage duration" from that intro sentence). @tkoeppe, @zygoloid: I'd like to editorially strike "with automatic storage duration" from the intro sentence, because it's wrong in the case of throwing from the constructor of a partially-constructed object, where subobjects might have dynamic storage duration. Any objections? |
OK, I trust your judgement on this. |
In section [except.ctor], the rule states:
That means what the third rule says is also a part process of stack unwinding.
Since the first rule sounds like that the invocation of stack unwinding is only for the object with automatic storage duration. Doesn't that stack unwinding invoke for the object with dynamic storage duration or others duration?
Obviously, the subobject
a
occupies the storage within the complete object of the typeB
which has the dynamic storage duration. AFAIK, A's destructor should be invoked since it has been completely constructed in the initialization of B.The text was updated successfully, but these errors were encountered: