Skip to content

Conversation

Quuxplusone
Copy link
Contributor

@Quuxplusone Quuxplusone commented Oct 19, 2025

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.

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}.
Copy link
Member

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.

Copy link
Contributor Author

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.")

Copy link
Member

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).

@jensmaurer jensmaurer added the changes requested Changes to the wording or approach have been requested and not yet applied. label Oct 19, 2025
\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}. &
Copy link
Contributor Author

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.

@frederick-vs-ja
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes requested Changes to the wording or approach have been requested and not yet applied.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants