-
Notifications
You must be signed in to change notification settings - Fork 795
[meta.unary.prop] [meta.rel] P/R for LWG3967 #8348
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
base: main
Are you sure you want to change the base?
Conversation
This intends to eliminate all instances of "is known not to throw any exception" from the library clauses. "Is known" is too vague a condition (known to whom?); we ought to define it explicitly in terms of potentially-throwing expressions, i.e., we expect these traits to exactly match the result of the `noexcept` operator.
variable definition for \tcode{is_constructible}, as defined below, is known not to | ||
throw any exceptions\iref{expr.unary.noexcept}. | ||
variable definition for \tcode{is_constructible}, as defined below, | ||
contains no potentially-throwing expression\iref{except.spec}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "contains" mean? The variable definition itself is not an expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a fair question. I think what we're trying to say here is that below we have, textually, a variable definition T t(declval<Args>()...);
, and we're asking whether that text produces any potentially-throwing expressions... but if the English word "contains" doesn't suffice to convey that, I don't immediately have any better suggestions.
I think https://eel.is/c++draft/except.spec#6 is the closest we come to prior art here. (It doesn't say "contains.")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the only expressions I'm seeing here are the argument expressions involving declval. The constructor invocation is not a (grammatical) expression, and neither are the default arguments (if any).
\tcode{is_convertible_v<From, To>} is \tcode{true} and | ||
the conversion, as defined by \tcode{is_convertible}, | ||
is known not to throw any exceptions\iref{expr.unary.noexcept} & | ||
is not a potentially-throwing expression\iref{except.spec}. & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably have another problem here, because a conversion is not an expression.
Perhaps we want to say "contains no potentially-throwing expression or potentially-throwing implicit function invocation in its immediate context". But CWG1844 is not yet resolved. |
https://cplusplus.github.io/LWG/issue3967
This intends to eliminate all instances of "is known not to throw any exception" from the library clauses. "Is known" is too vague a condition (known to whom?); we ought to define it explicitly in terms of potentially-throwing expressions, i.e., we expect these traits to exactly match the result of the
noexcept
operator.