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

"ill-formed with no diagnostic required" is odd #3673

Closed
CaseyCarter opened this issue Feb 12, 2020 · 5 comments · Fixed by #3789
Closed

"ill-formed with no diagnostic required" is odd #3673

CaseyCarter opened this issue Feb 12, 2020 · 5 comments · Fixed by #3789
Labels
decision-required A decision of the editorial group (or the Project Editor) is required.

Comments

@CaseyCarter
Copy link
Contributor

There are several occurrences of the novel phrase ""ill-formed with no diagnostic required" in the [ranges] wording; P2091R0 will add more. These should all be changed to a more common form such as "ill-formed, no diagnostic is required."

(Feel free to assign this issue to me.)

@jensmaurer
Copy link
Member

It seems to me that all such occurrences in the ranges-related wording are actually misuses of "ill-formed, no diagnostic required".
In these cases, the phrase denotes runtime requirements for (possibly customized) functions. "Undefined behavior" seems to be a much nicer outcome here.
(Note that "ill-formed, no diagnostic required" could mean a program-wide meltdown as devastating as ODR-violated, which is probably not intended here.)

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Feb 22, 2020
@CaseyCarter
Copy link
Contributor Author

We chose IFNDR in these cases over UB to allow a sufficiently smart compiler to reject the program if it can prove that a selected operation does not have the required semantics whether or not it can prove that the operation is necessarily executed at runtime.

@jensmaurer
Copy link
Member

jensmaurer commented Feb 22, 2020

@CaseyCarter , thanks for the explanation. So, this was intentional and needs an LWG issue to change.

(I disagree with your reasoning, btw; the resulting outcome is much worse than "undefined behavior" and a compiler is free to give warnings or similar even when otherwise successfully compiling the program. Also, the use of IF-NDR for this purpose seems to be rather unique, also among the core language clauses.)

@CaseyCarter
Copy link
Contributor Author

Clarifying: the problem in this issue isn't that IFNDR should be some other behavior, it's that LWG noticed my particular phrasing "ill formed with no diagnostic required" is novel and wanted to harmonize it with other phrasings.

@jensmaurer
Copy link
Member

I understand that, but it's still morally the wrong thing to say here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision-required A decision of the editorial group (or the Project Editor) is required.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants