Skip to content
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.pre] Reword "shall not be used to" avoiding question of actual "use" #5413

Merged
merged 1 commit into from Aug 19, 2022

Conversation

hubert-reinterpretcast
Copy link
Contributor

@hubert-reinterpretcast hubert-reinterpretcast commented Apr 25, 2022

The "shall not be used to" phrasing may be taken to refer only in cases
where the actual use occurs or is the primary intent. Instead, the
intended restriction can be written in terms of static properties of the
constructs so restricted in the style of [stmt.if].

A new term of art (control-flow-limited statement) is introduced in
[stmt.label] to express the restrictions. Both [stmt.if] and
[except.pre] are updated to use the new term.

Co-authored-by: Johel Ernesto Guerrero Peña johelegp@gmail.com

source/exceptions.tex Outdated Show resolved Hide resolved
Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this.

source/statements.tex Outdated Show resolved Hide resolved
…l "use"

The "shall not be used to" phrasing may be taken to refer only in cases
where the actual use occurs or is the primary intent. Instead, the
intended restriction can be written in terms of static properties of the
constructs so restricted in the style of [stmt.if].

A new term of art (control-flow-limited statement) is introduced in
[stmt.label] to express the restrictions. Both [stmt.if] and
[except.pre] are updated to use the new term.

Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
Copy link
Member

@zygoloid zygoloid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice improvement to me.

I briefly considered whether it'd be useful to say that the body of a function is also control-flow-limited, but that doesn't seem to really allow any further simplifications. (We could maybe delete the second sentence of [stmt.goto]/1, but that seems to be about it.)

@jensmaurer
Copy link
Member

@tkoeppe , any final thoughts before I merge this?

@tkoeppe
Copy link
Contributor

tkoeppe commented Aug 18, 2022

@jensmaurer: no, this does look like a nice improvement. As long as you're CWG-happy with inventing new terms editorially here, please do feel free to merge. (Maybe CWG should be informed that we have a new term at some point? Then again, control flow is not something that we touch a lot.)

@tkoeppe tkoeppe merged commit a27e5a6 into cplusplus:main Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants